Skip to content

sliceSheet

sliceSheet(source, frameWidth, frameHeight?): Texture<TextureSource<any>>[]

Defined in: renderer/src/spritesheet.ts:15

Slice a single-row horizontal spritesheet into individual frame Textures.

Only reads the top row of the image (y = 0). For multi-row sheets or non-uniform frame layouts, use PixiJS’s Spritesheet class with a JSON atlas descriptor (TexturePacker / Aseprite JSON export format) instead.

string | Texture<TextureSource<any>>

A PixiJS Texture or asset path string.

number

Width of each frame in pixels.

number

Height of each frame (defaults to frameWidth for square frames).

Texture<TextureSource<any>>[]