Interface CreateSpriteOptionsAnimationFrame

Defines a specific frame in a sprite's Animation To do this you must have a sprite sheet, and define the bounds for each different animation frame

interface CreateSpriteOptionsAnimationFrame {
    duration?: number;
    height: number;
    sourceHeight: number;
    sourceWidth: number;
    sourceX: number;
    sourceY: number;
    width: number;
}

Properties

duration?: number

The amount of time the specific frame should play for. Leave blank to create a frame that doesn't end

height: number

Height of the sprite within the game world

sourceHeight: number

Height of the sprite on the provided image sheet

sourceWidth: number

Width of the sprite on the provided image sheet

sourceX: number

The X coordinate of the sprite on the provided image sheet

sourceY: number

The Y coordinate of the sprite on the provided image sheet

width: number

Width of the sprite within the game world