Skip to content

sliceGrid

sliceGrid(base, options): Texture<TextureSource<any>>[]

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

Slice a texture into frame Textures on a uniform grid.

Frame i is read at column i % columns, row floor(i / columns). Without columns, the column count is derived from the texture width; without count, a single full row is read.

Throws when a field is not a finite number at or above its minimum, or when the resulting grid extends past the texture.

Texture

TextureSliceOptions

Texture<TextureSource<any>>[]