silphius/app/ecs-components/sprite.js

16 lines
404 B
JavaScript
Raw Normal View History

2024-06-26 21:08:09 -05:00
import Component from '@/ecs/component.js';
2024-06-22 12:12:13 -05:00
import vector2d from "./helpers/vector-2d";
2024-06-26 21:08:09 -05:00
export default class Sprite extends Component {
static properties = {
anchor: vector2d('float32', {x: 0.5, y: 0.5}),
animation: {type: 'string'},
elapsed: {type: 'float32'},
frame: {type: 'uint16'},
frames: {type: 'uint16'},
source: {type: 'string'},
speed: {type: 'float32'},
};
}