Hello,

I see some problems with the Scenes transitions. First here is what I'm 
trying to achieve. Imagine a Layer (let's call is static) in a scene. You 
can transition to another scene with another layer (let's call it action). 
This action layer has some actions that should be run when the layer comes 
into play.

So I thought I would launch my action in the `on_enter` method. But with 
the scenes.transitions, it turns out that when creating the scene for the 
transition, the action layer gets its `on_enter` method called. So it 
starts doing its thing while the scenes are transitioning. When the 
transition is done, the director replace the transition scene with the new 
scene containing our action layer. So its `on_enter` gets called again!

Here is a quick demo. You can go from scene 1 to 2 with or without 
transition. Notice that without transition the label jumps twice while 
shaking a bit. If we use a transition, it appears while already jumping and 
jumps more than twice (because of the second call to `on_enter`).

See code here: https://gist.github.com/dangillet/cbd23d5ec4162e960eff

Also I think there is a memory leak! When the transition is completed, if 
you look at the new scene (containing the action layer), you will notice 
that it still has a parent (a scene) which has also a parent (the 
FadeTransition scene) ! Indeed, when the transition finished in 
cocos/director.py we call `director.replace(dst)` but we never delete the 
`self.parent` attribute.

Dan.

-- 
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to