Skip to content

TextureAtlasRegistry

Defined in: src/modules/texture-atlas/texture-atlas.ts:101

Resolves sprite atlas + frame names to a drawable image and source rectangle. Register one or more loaded atlases, then pass the registry to the renderer via Canvas2DRenderContext.atlases.

new TextureAtlasRegistry(): TextureAtlasRegistry

TextureAtlasRegistry

add(name, image, frames): this

Defined in: src/modules/texture-atlas/texture-atlas.ts:111

Registers a loaded atlas image under name with its parsed frames. Re-registering the same name replaces the previous entry.

string

CanvasImageSource

Record<string, AtlasFrame>

this


getFrame(atlas, frame): ResolvedAtlasFrame | undefined

Defined in: src/modules/texture-atlas/texture-atlas.ts:120

Resolves atlas + frame to a drawable image and source rect, or undefined when either is unknown.

string

string

ResolvedAtlasFrame | undefined


has(atlas, frame?): boolean

Defined in: src/modules/texture-atlas/texture-atlas.ts:133

True when atlas is registered (and, if given, contains frame).

string

string

boolean