Skip to content

1681-engine / index / addAsepriteTextures

Function: addAsepriteTextures() ​

ts
function addAsepriteTextures(
   textures, 
   key, 
   canvas, 
   sheet
): CanvasTexture;

Defined in: src/assets/loadAseprite.ts:20

Registers canvas (the sheet image) under key with one frame per sheet frame, named by its index ("0", "1"…), so the clips parseAseprite returns play on an Image of that key as they are. A trimmed frame keeps its untrimmed size and offset (Pixi's orig and trim), so a sprite anchored at its feet does not jump as the trim changes.

Parameters ​

ParameterType
texturesAsepriteTextureSink
keystring
canvasHTMLCanvasElement
sheetAsepriteSheet

Returns ​

CanvasTexture

Released under the MIT License.