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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TextureAtlasRegistry():
TextureAtlasRegistry
Returns
Section titled “Returns”TextureAtlasRegistry
Methods
Section titled “Methods”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.
Parameters
Section titled “Parameters”string
CanvasImageSource
frames
Section titled “frames”Record<string, AtlasFrame>
Returns
Section titled “Returns”this
getFrame()
Section titled “getFrame()”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.
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”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).
Parameters
Section titled “Parameters”string
frame?
Section titled “frame?”string
Returns
Section titled “Returns”boolean