Jump to content

Loading assets more than once in pixi 3


whizzkid
 Share

Recommended Posts

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...