Pufferoon Posted January 19, 2017 Share Posted January 19, 2017 Hi guys, Is there a way to get a callback from Texture.fromImage once the image has loaded? I'm loading SVG sprites, but have no way of knowing when they'll be available, or of showing a loader progress bar. Pixi version 4.2.2 Quote Link to comment Share on other sites More sharing options...
themoonrat Posted January 19, 2017 Share Posted January 19, 2017 http://pixijs.download/release/docs/PIXI.Texture.html According to the bottom of that, there is an event you can subscribe to called 'update' texture = Texture.fromImage( 'blah.svg' ); texture.on('update', () => { console.log('yay'} ); But is there any reason you can't use the built in loader to do this for you? http://pixijs.download/release/docs/PIXI.loaders.Loader.html Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.