import Component from '@/ecs/component.js'; import vector2d from "./helpers/vector-2d"; export default class Sprite extends Component { async load(instance) { instance.$$sourceJson = await this.ecs.readJson(instance.source); } static properties = { anchor: vector2d('float32', {x: 0.5, y: 0.5}), animation: {type: 'string'}, elapsed: {type: 'float32'}, frame: {type: 'uint16'}, frames: {type: 'uint16'}, scale: vector2d('float32', {x: 1, y: 1}), source: {type: 'string'}, speed: {type: 'float32'}, }; }