API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classSpritesheet
@codexo/exojs / rendering / stable
Slices a single Texture into named frames and optional named animation sequences. Each frame is stored as both a Rectangle (the pixel region) and a pre-configured Sprite ready for direct rendering. Animations are ordered lists of frame names that AnimatedSprite.fromSpritesheet consumes to create playback clips.
4
props
8
methods
0
events
Import
import { Spritesheet } from '@codexo/exojs' Slices a single Texture into named frames and optional named animation sequences.
Each frame is stored as both a Rectangle (the pixel region) and a pre-configured Sprite ready for direct rendering. Animations are ordered lists of frame names that AnimatedSprite.fromSpritesheet consumes to create playback clips.
Constructors 1
new(texture: Texture, data: SpritesheetData): Spritesheet Methods 8
addFrame(name: string, data: SpritesheetFrame): void clear(): this defineAnimation(name: string, frameNames: readonly string[]): this destroy(): void getAnimationFrameNames(name: string): readonly string[] getFrame(name: string): Rectangle getFrameSprite(name: string): Sprite parse(data: SpritesheetData, keepFrames: boolean): void Properties 4
animations: Map<string, readonly string[]> frames: Map<string, Rectangle> sprites: Map<string, Sprite> texture: Texture Source