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 Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
T | undefined
Implementation of
GetDescriptor()
ts
GetDescriptor(id):
| AssetDescriptor
| undefined;Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
| AssetDescriptor | undefined
Implementation of
GetDescriptors()
ts
GetDescriptors(): AssetDescriptor[];Every descriptor registered so far, loaded or in flight. Editor asset browsers read this.
Returns
Implementation of
GetSpritesheetAnimations()
ts
GetSpritesheetAnimations(_spritesheetAssetId): Record<string, string[]> | undefined;Map of animation name → frame ids, from a TexturePacker 'animations' block.
Parameters
| Parameter | Type |
|---|---|
_spritesheetAssetId | string |
Returns
Record<string, string[]> | undefined
Implementation of
IAssetLoader.GetSpritesheetAnimations
GetSpritesheetFrames()
ts
GetSpritesheetFrames(_spritesheetAssetId): string[] | undefined;Parameters
| Parameter | Type |
|---|---|
_spritesheetAssetId | string |
Returns
string[] | undefined
Implementation of
IAssetLoader.GetSpritesheetFrames
Init()
ts
Init(baseUrl?): Promise<void>;Parameters
| Parameter | Type | Default value |
|---|---|---|
baseUrl | string | "" |
Returns
Promise<void>
Implementation of
IsLoaded()
ts
IsLoaded(id): boolean;Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
boolean
Implementation of
Load()
ts
Load(descriptors, onProgress?): Promise<void>;Parameters
| Parameter | Type |
|---|---|
descriptors | readonly AssetDescriptor[] |
onProgress? | (p) => void |
Returns
Promise<void>
Implementation of
LoadOne()
ts
LoadOne(descriptor): Promise<void>;Parameters
| Parameter | Type |
|---|---|
descriptor | AssetDescriptor |
Returns
Promise<void>
Implementation of
SliceTextureGrid()
ts
SliceTextureGrid(_sourceAssetId, _options): string[] | undefined;Optional capabilities — override in backends that support them.
Parameters
| Parameter | Type |
|---|---|
_sourceAssetId | string |
_options | TextureGridSliceOptions |
Returns
string[] | undefined
Implementation of
Unload()
ts
Unload(id): Promise<void>;Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<void>
Implementation of
UnloadAll()
ts
UnloadAll(): Promise<void>;Returns
Promise<void>