whizzkid Posted July 6, 2015 Share Posted July 6, 2015 I'm upgrading an existing project from pixi 2 to pixi 3. In pixi 2 I could load an assets several times and it would automatically: load it the 1st time but use the cached version on subsequent loads. (and simulated a load complete as well, so everything works nicely)this was very handy. Now with Pixi 3, a second load of the same asset triggers an error : Resource with name bla.png already exists. So now I need to fix ALL my loads to check if an asset has already been loaded or not (while the loader itself also does this, but only throws an error) I know in the examples you only load something once, so its an issue you don't really encounter. and I'm hoping this is just a little missed feature or something. or was this change in behaviour on purpose? (i.e. having the programmer implement lots of extra checks which were previously done by the loader) Quote Link to comment Share on other sites More sharing options...
xerver Posted July 6, 2015 Share Posted July 6, 2015 If you want to use the loader to load a new set of assets call .reset() first. If you try to load the same asset again after reset, the loader relies on the browser caching. Quote Link to comment Share on other sites More sharing options...
whizzkid Posted July 6, 2015 Author Share Posted July 6, 2015 Cool, that works.Too bad its an extra step though.. thanks. Quote Link to comment Share on other sites More sharing options...
xerver Posted July 6, 2015 Share Posted July 6, 2015 Cool, that works.Too bad its an extra step though.. thanks. It is because .reset() drops the internal cache of objects and reset the loader for loading again. The extra step is there because the loader does a lot of extra stuff that didn't happen before, and we can't know when you want us to dump the cached resources and start over. Quote Link to comment Share on other sites More sharing options...
vitolipari Posted July 15, 2015 Share Posted July 15, 2015 Hi to everybody, could you post an example? Please! Quote Link to comment Share on other sites More sharing options...
xerver Posted July 15, 2015 Share Posted July 15, 2015 PIXI.loader.reset(); 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.