royibernthal Posted June 26, 2017 Share Posted June 26, 2017 Rarely I get this error: Quote ionic Resource named "..." already exists. For resources that I loaded again after I deleted them. Here is how I delete a (texture) resource: PIXI.loader.resources[image].texture.destroy(true); delete PIXI.loader.resources[image]; Is that not enough? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 26, 2017 Share Posted June 26, 2017 Its a very good question. No, destroying the base texture is not enough I summon @xerver in this topic, he knows what to do. Quote Link to comment Share on other sites More sharing options...
xerver Posted June 26, 2017 Share Posted June 26, 2017 If you want to reuse a loader instance, you need to call reset() first. Quote Link to comment Share on other sites More sharing options...
royibernthal Posted June 26, 2017 Author Share Posted June 26, 2017 Does loader.reset() also destroy existing resources (e.g. textures) or will I have to do that manually? Quote Link to comment Share on other sites More sharing options...
xerver Posted June 26, 2017 Share Posted June 26, 2017 No it does not call the destroy() method of resources. The loader has no semantic knowledge of what the resources are. It simply clears it's list of resources and prepares to load new resources. Quote Link to comment Share on other sites More sharing options...
royibernthal Posted June 27, 2017 Author Share Posted June 27, 2017 I understand. Thanks 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.