Interface AnimatorOptions

Animator component configuration

const walkAnimation = new Animation({
image: "walk.png",
slice: { size: new Vector2(32, 32) },
frames: [0, 1, 2, 3, 4, 5],
fps: 12,
loop: true
});

const idleAnimation = new Animation({
image: "idle.png",
slice: { size: new Vector2(32, 32) },
frames: [6, 7, 8, 9]
fps: 8,
loop: true
});

const animator = new Animator({
animations: new Map([
["walk", walkAnimation],
["idle", idleAnimation]
]),
animation: "idle",
speed: 1,
playing: true
});
interface AnimatorOptions {
    animation: string;
    animations: Map<string, Animation>;
    playing: boolean;
    speed: number;
}

Properties

animation: string
animations: Map<string, Animation>
playing: boolean
speed: number