On Mon, Apr 9, 2012 at 12:38 PM, Oninoshiko <[email protected]> wrote:

>
>
> Of course! What I have is this:
>
>  class ReplaceScene(InstantAction):
>     def init(self, newscene):
>         self.newscene = newscene
>
>     def start(self):
>         director.replace(self.newscene)
>
>  Ideally, I just want to be able to add "ReplaceAction(Scene(layer))" to
> the end of a Action sequence.
> --
>

I see.
A clean way to obtain an action with this behavior is this:

def get_action_replace_scene(scene):
      def changer():
          director.replace(scene)

      template_action = ac.CallFunc(changer)
      return template_action

and you use like

template_action = ac.Delay(1.0) + get_action_replace_scene(scene2)
scene1.do(template_action)
director.run(scene1)
See test demo for this in http://pastebin.com/xVW3WYJW


claudio

--

-- 
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cocos-discuss?hl=en.

Reply via email to