Jump to content

PIXI.Texture.EMPTY gets destroyed


colourclash
 Share

Recommended Posts

Hi,
This may not be a typical use case, but in my project I have some sprites which are created without a texture (in a sprite pool) and later on, those sprites may get destroyed.
The side effect I experienced, is that the PIXI.Texture.EMPTY property is also destroyed.
This will reproduce the problem:

var s = new PIXI.Sprite();
this.addChild(s);
s.destroy(true);
this.addChild(new PIXI.Sprite()); //rte :(

It's easy enough to work around the problem by checking whether the sprite has a texture before destroying it, but I thought I'd write this down in case anyone else gets tripped up by it!

Link to comment
Share on other sites

  • 4 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...