Andrey Andreev Andrey Andreev - 28 days ago 8x
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.


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);