Jump to content

Sprite Add/Remove callbacks


jim716
 Share

Recommended Posts

Hi,

 

Are there any functions or callbacks that are invoked when a Sprite is added or removed from the stage/world?  I would like certain sprites to be able to initialize or shutdown input, etc. based on being on stage.

 

Thanks!

Link to comment
Share on other sites

sprite.events.onAddedToGroupsprite.events.onRemovedFromGroup

Don't forget that the World is a Group. So adding and removing from the World will fire the above events. They will NOT be fired if the sprite is added as a child of another sprite.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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