API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

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
9
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.

Constructors1
Methods9
Register a single frame by name, creating its Rectangle and pre-configured Sprite.
clear(): this
Destroy all registered frames, sprites, and animations, resetting the spritesheet to an empty state.
defineAnimation(name: string, frameNames: readonly string[]): this
Register an animation sequence as an ordered list of frame names. All referenced frames must already exist.
destroy(): void
getAnimationFrameNames(name: string): readonly string[]
Return the ordered frame-name list for the named animation. Throws if the animation does not exist.
Return the pre-configured Sprite for the named frame. Throws if the frame does not exist.
Parse a SpritesheetData descriptor, populating frames, sprites, and animations. When keepFrames is false (default), all existing frames and sprites are destroyed before parsing.
removeFrame(name: string): this
Destroy and remove a single frame's Rectangle and Sprite by name. No-op if the frame does not exist.
Properties4
animations: Map<string, readonly string[]>
Source