Constructors
constructor
- new Sprite(renderer: any, image: HTMLImageElement, sWidth: number, sHeight: number, frames: number[][], duration: number, dWidth: number, dHeight: number): Sprite
Parameters
renderer: any
image: HTMLImageElement
sWidth: number
sHeight: number
frames: number[][]
duration: number
dWidth: number
dHeight: number
Properties
frames
frames: number[][] = []
grid
grid
: { height
: number; position
: { x
: number; y
: number }; positions
: { x
: number; y
: number }[]; tile
: Tile; width
: number }[][]image
image: HTMLImageElement
index
index: number[] = []
Methods
draw
- draw(dX: number, dY: number, renderLoop: RenderLoop, frameIndex?: number[]): void
Parameters
dX: number
dY: number
Optional frameIndex: number[]
Returns void