Do I Need To Remove Scene Listeners?

Hi,

Simple question about scene and listeners  :

when you create a scene, traditionally you create at the end of your lua file some listeners :

scene:addEventListener( "createScene", scene ) scene:addEventListener( "enterScene", scene ) scene:addEventListener( "exitScene", scene ) scene:addEventListener( "destroyScene", scene )

Do I need to remove this listeners somewhere when I leave this scene?

  • If yes when and how?
  • if no, “who” do the job?

Thanks for your help!

Best,

Olivier

You do not need to remove them.  Storyboard manages those for you.  

You do not need to remove them.  Storyboard manages those for you.  

Is that why everything has to be added to the group? So they can be removed when storyboard runs low on memory?

Thanks!
Stu

That is one reason.  The other is so that the scenes can be transitioned on and off screen.  Display objects not in storyboard scenes sit on top of all storyboard managed objects, so if you want them to play nice with everything, you need to put it into a scene’s group.

Is that why everything has to be added to the group? So they can be removed when storyboard runs low on memory?

Thanks!
Stu

That is one reason.  The other is so that the scenes can be transitioned on and off screen.  Display objects not in storyboard scenes sit on top of all storyboard managed objects, so if you want them to play nice with everything, you need to put it into a scene’s group.