FlxAtlasRegistry
Registry that loads and stores named FlxAtlas instances. Access the singleton via FlxG.atlas.
export declare class FlxAtlasRegistryMethods
clear()
clear(): voidRemove all atlases from the registry.
Returns: void
get()
get(key: string): FlxAtlasReturn a previously loaded atlas.
Parameters:
| Parameter | Type | Description |
|---|---|---|
key | string | - |
Returns: FlxAtlas
has()
has(key: string): booleanReturns true if an atlas with key is registered.
Parameters:
| Parameter | Type | Description |
|---|---|---|
key | string | - |
Returns: boolean
load()
load(key: string, imageUrl: string, meta: FlxAtlasMeta): Promise<FlxAtlas>Load an atlas from an image URL and metadata, then store it under key. Overwrites any previously stored atlas with the same key.
meta can be: - A URL string ending in .json → TexturePacker/Pixi JSON format. - Any other URL string → TextureAtlas XML format. - Inline XML / JSON text (starts with < or {) → parsed directly. - A { frameWidth, frameHeight } object → uniform fixed-size grid.
Parameters:
| Parameter | Type | Description |
|---|---|---|
key | string | - |
imageUrl | string | - |
meta | FlxAtlasMeta | - |
Returns: Promise<FlxAtlas>
registerFromAssets()
registerFromAssets(key: string, assets: FlxAssets, source: FlxAtlasAssetSource): FlxAtlasRegister an atlas from aliases that an FlxAssets bundle already loaded.
The asset cache retains ownership of the base texture and metadata. Remove the atlas before unloading its bundle; live sprites may continue retaining their own texture views.
TexturePacker JSON descriptors should set parser: 'text'. Keeping the payload as text prevents Pixi's post-load spritesheet parser from eagerly converting it before Flixel can validate and normalize the metadata.
Parameters:
| Parameter | Type | Description |
|---|---|---|
key | string | - |
assets | FlxAssets | - |
source | FlxAtlasAssetSource | - |
Returns: FlxAtlas
remove()
remove(key: string): voidRemove one atlas from the registry. Does not destroy textures already referenced by live sprites.
Parameters:
| Parameter | Type | Description |
|---|---|---|
key | string | - |
Returns: void