These are chat archives for pixijs/pixi.js

Oct 2017
Thomas Persson
Oct 18 2017 10:55
Hi, how should I handle teardown?
can I call destroy on the root container and all it's children will be destroyed as well? what about mouse events for sprites?
Looking at this, for me it seems I can just pass true to the options and it will remove the children and the sprites, but what about mouse events for a particular sprite? will it be removed as well?
Thomas Persson
Oct 18 2017 11:11
guess not, I did a destroy, .destroy({children: true, texture:true, baseTexture: true}) on the rootContainer and then I did .destroy(true) on the renderer but then it complained when I loaded the page with the pixi creation that there was already a texture with same name, so I did loader.reset() which worked because I don't get the error anymore but now it gives me a warning that it's already added.
can't find a good guide about teardown, can anyone point me in the right direction?
got pass my problem, utils.destroyTextureCache(); seemed to do the trick!