Interface: IAssetLoader
Core interface types.
Methods
Get()
ts
Get<T>(id): T | undefined;Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
T | undefined
GetDescriptor()
ts
GetDescriptor(id): AssetDescriptor | undefined;Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
AssetDescriptor | undefined
GetDescriptors()
ts
GetDescriptors(): AssetDescriptor[];Every descriptor registered so far, loaded or in flight. Editor asset browsers read this.
Returns
GetSpritesheetAnimations()?
ts
optional 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
GetSpritesheetFrames()?
ts
optional GetSpritesheetFrames(spritesheetAssetId): string[] | undefined;Parameters
| Parameter | Type |
|---|---|
spritesheetAssetId | string |
Returns
string[] | undefined
Init()
ts
Init(baseUrl?): Promise<void>;Parameters
| Parameter | Type |
|---|---|
baseUrl? | string |
Returns
Promise<void>
IsLoaded()
ts
IsLoaded(id): boolean;Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
boolean
Load()
ts
Load(descriptors, onProgress?): Promise<void>;Parameters
| Parameter | Type |
|---|---|
descriptors | readonly AssetDescriptor[] |
onProgress? | (p) => void |
Returns
Promise<void>
LoadOne()
ts
LoadOne(descriptor): Promise<void>;Parameters
| Parameter | Type |
|---|---|
descriptor | AssetDescriptor |
Returns
Promise<void>
SliceTextureGrid()?
ts
optional SliceTextureGrid(sourceAssetId, options): string[] | undefined;Optional capabilities — return undefined when the backend lacks the needed pipeline.
Parameters
| Parameter | Type |
|---|---|
sourceAssetId | string |
options | TextureGridSliceOptions |
Returns
string[] | undefined
Unload()
ts
Unload(id): Promise<void>;Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<void>
UnloadAll()
ts
UnloadAll(): Promise<void>;Returns
Promise<void>