Jump to content

When you 'kill' a sprite, what happens


onedayitwillmake
 Share

Recommended Posts

Trying to find out the best way to, remove a sprite.

I notice there is an add method, but I don't see an accompanying remove method for sprites.

 

What is the correct method to remove a sprite, currently i'm calling "kill" (my sprites are created using the GameObjectFactory), that doesn't seem to completely remove it, only stop drawing / updating it?

 

Is this correct? If so what is the right way to go about removing a sprite

Link to comment
Share on other sites

  • 2 weeks later...

I can't seem to find the destroy function on the dev branch, is it no longer being added?

How do we handle removing the inputs, previously I was doing this

 if( this._view.input ) {  this._view.input.destroy(); } this._view.kill();

However this leads to a memory leak after the game is running for a prolonged period of time.

I'll try the work around above for now though

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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