Skip to content

Abstract Class: AssetLoader ​

Optional base for IAssetLoader. Owns the descriptor / loaded / data maps and the progress-driven sequential load loop. Backends supply loadAsset / unloadAsset and override the optional sprite-sheet / texture-grid helpers if they support them.

Implements ​

Constructors ​

Constructor ​

ts
new AssetLoader(): AssetLoader;

Returns ​

AssetLoader

Methods ​

Get() ​

ts
Get<T>(id): T | undefined;

Type Parameters ​

Type ParameterDefault type
Tunknown

Parameters ​

ParameterType
idstring

Returns ​

T | undefined

Implementation of ​

IAssetLoader.Get


GetDescriptor() ​

ts
GetDescriptor(id): 
  | AssetDescriptor
  | undefined;

Parameters ​

ParameterType
idstring

Returns ​

| AssetDescriptor | undefined

Implementation of ​

IAssetLoader.GetDescriptor


GetDescriptors() ​

ts
GetDescriptors(): AssetDescriptor[];

Every descriptor registered so far, loaded or in flight. Editor asset browsers read this.

Returns ​

AssetDescriptor[]

Implementation of ​

IAssetLoader.GetDescriptors


GetSpritesheetAnimations() ​

ts
GetSpritesheetAnimations(_spritesheetAssetId): Record<string, string[]> | undefined;

Map of animation name → frame ids, from a TexturePacker 'animations' block.

Parameters ​

ParameterType
_spritesheetAssetIdstring

Returns ​

Record<string, string[]> | undefined

Implementation of ​

IAssetLoader.GetSpritesheetAnimations


GetSpritesheetFrames() ​

ts
GetSpritesheetFrames(_spritesheetAssetId): string[] | undefined;

Parameters ​

ParameterType
_spritesheetAssetIdstring

Returns ​

string[] | undefined

Implementation of ​

IAssetLoader.GetSpritesheetFrames


Init() ​

ts
Init(baseUrl?): Promise<void>;

Parameters ​

ParameterTypeDefault value
baseUrlstring""

Returns ​

Promise<void>

Implementation of ​

IAssetLoader.Init


IsLoaded() ​

ts
IsLoaded(id): boolean;

Parameters ​

ParameterType
idstring

Returns ​

boolean

Implementation of ​

IAssetLoader.IsLoaded


Load() ​

ts
Load(descriptors, onProgress?): Promise<void>;

Parameters ​

ParameterType
descriptorsreadonly AssetDescriptor[]
onProgress?(p) => void

Returns ​

Promise<void>

Implementation of ​

IAssetLoader.Load


LoadOne() ​

ts
LoadOne(descriptor): Promise<void>;

Parameters ​

ParameterType
descriptorAssetDescriptor

Returns ​

Promise<void>

Implementation of ​

IAssetLoader.LoadOne


SliceTextureGrid() ​

ts
SliceTextureGrid(_sourceAssetId, _options): string[] | undefined;

Optional capabilities — override in backends that support them.

Parameters ​

ParameterType
_sourceAssetIdstring
_optionsTextureGridSliceOptions

Returns ​

string[] | undefined

Implementation of ​

IAssetLoader.SliceTextureGrid


Unload() ​

ts
Unload(id): Promise<void>;

Parameters ​

ParameterType
idstring

Returns ​

Promise<void>

Implementation of ​

IAssetLoader.Unload


UnloadAll() ​

ts
UnloadAll(): Promise<void>;

Returns ​

Promise<void>

Implementation of ​

IAssetLoader.UnloadAll

© 2026 PlayAdGentic