Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

defineSpriteSheet

defineSpriteSheet<Clip>(options): SpriteSheet<Clip>

Declares a sprite sheet at module scope: one image with Aseprite’s or TexturePacker’s JSON, or one image cut into a grid. Every clip it holds plays through playClip and a Sprite’s clip. The data is checked here, throwing naming the file and the frame, and the image is checked against it when it loads.

Type Parameter
Clip extends string
Parameter Type
options SpriteSheetDataOptions<Clip> & object

SpriteSheet<Clip>

defineSpriteSheet(options): SpriteSheet<string>

Declares a sprite sheet at module scope: one image with Aseprite’s or TexturePacker’s JSON, or one image cut into a grid. Every clip it holds plays through playClip and a Sprite’s clip. The data is checked here, throwing naming the file and the frame, and the image is checked against it when it loads.

Parameter Type
options SpriteSheetDataOptions<string>

SpriteSheet<string>

defineSpriteSheet<Clip>(options): SpriteSheet<Clip>

Declares a sprite sheet at module scope: one image with Aseprite’s or TexturePacker’s JSON, or one image cut into a grid. Every clip it holds plays through playClip and a Sprite’s clip. The data is checked here, throwing naming the file and the frame, and the image is checked against it when it loads.

Type Parameter
Clip extends string
Parameter Type
options SpriteSheetGridOptions<Clip> & object

SpriteSheet<Clip>

defineSpriteSheet(options): SpriteSheet<"all">

Declares a sprite sheet at module scope: one image with Aseprite’s or TexturePacker’s JSON, or one image cut into a grid. Every clip it holds plays through playClip and a Sprite’s clip. The data is checked here, throwing naming the file and the frame, and the image is checked against it when it loads.

Parameter Type
options SpriteSheetGridOptions<string> & object

SpriteSheet<"all">