Spritesheet metadata
Spritesheet format
Each instanced mesh has to be provided with a spritesheet formatted like this. The library provides utilities to parse aseprite json metadata and to generate it from a image file, but you can (should?) write your own
type SpritesheetFormat = {
frames: [x: number, y: number, width: number, height: number][];
animations: Record<string, [frameId: number, duration: number][]>;
sheetSize: [width: number, height: number][];
animationLengths: number[];
};
frames
: each frame of the spritesheet has its cooridnates and size specified separately - this will allow for non-uniform sized framesanimations
:Map
of named animations. Each animation is defined by an array of frames it consists of (frameId is the index of a frame inframes
)sheetSize
- size of an imageanimationLengths
- util, how many frames does each animation have