Andrey Andreev Andrey Andreev - 1 year ago 129
TypeScript Question

Using AssetsLoader in Pixi.js with typescript

It seems that in latest definitions of pixi (like there is no more property onComplete in AssetLoader. So how should I use AssetLoader now? Please, provide examples, if possible.

Answer Source

Just add a listener on your AssetLoader for the "onComplete" event. Something like this (assuming your Assetloader is instantiated into this._assetsLoader):

var allAssetsLoadedCallback = () => this.allAssetsLoaded();
this._assetsLoader.addEventListener("onComplete", allAssetsLoadedCallback);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download