onLoadError(action: (name: string, failedAsset: Asset)=>void): KEventController | undefined
Register an event that runs once for each asset that failed to load, after all others have completed.
param
actionThe function to run when the event is triggered.
// this will not load
loadSprite("bobo", "notavalidURL");
// process the error
// you decide whether to ignore it, or throw an error and halt the game
onLoadError((name, asset) => {
debug.error(`${name} failed to load: ${asset.error}`);
});
returns
The event controller.
since
v3001.0
group
Events