Class cocos.scenes.transitions.TransitionScene

             object --+        
                      |        
    cocosnode.CocosNode --+    
                          |    
             object --+   |    
                      |   |    
scene.EventHandlerMixin --+    
                          |    
                scene.Scene --+
                              |
                             TransitionScene

TransitionScene A Scene that takes two scenes and makes a transition between them.

These scenes are children of the transition scene.

Methods

  __init__(self, dst, duration=1.25, src=None)
Initializes the transition
  start(self)
Adds the incoming scene with z=1 and the outgoing scene with z=0
  finish(self)
Called when the time is over.
  hide_out_show_in(self)
Hides the outgoing scene and shows the incoming scene
  hide_all(self)
Hides both the incoming and outgoing scenes
  restore_out(self)
Restore the position, visible and scale attributes of the outgoing scene to the original values
Inherited from scene.Scene: enable_handlers, end, on_enter, push_all_handlers, remove_all_handlers Inherited from cocosnode.CocosNode: __contains__, add, are_actions_running, do, draw, get, get_ancestor, get_children, on_exit, pause, pause_scheduler, remove, remove_action, resume, resume_scheduler, schedule, schedule_interval, stop, transform, unschedule, visit, walk Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Instance Variables

  in_scene
scene that will replace the old one
  out_scene
scene that will be replaced
  duration
duration in seconds of the transition
Inherited from cocosnode.CocosNode: actions, camera, children, children_anchor_x, children_anchor_y, children_names, grid, is_running, rotation, scale, scheduled_calls, scheduled_interval_calls, skip_frame, to_remove, transform_anchor_x, transform_anchor_y, visible, x, y

Class Variables

Inherited from cocosnode.CocosNode: anchor, anchor_x, anchor_y, children_anchor, parent, position, transform_anchor

Method Details

__init__

(Constructor) __init__(self, dst, duration=1.25, src=None)
Initializes the transition
Parameters:
dst : Scene
Incoming scene
duration : float
Duration of the transition in seconds. Default: 1.25
src : Scene
Outgoing scene. Default: current scene
Overrides:
scene.Scene.__init__

finish

finish(self)
Called when the time is over. It removes both the incoming and the outgoing scenes from the transition scene, and restores the outgoing scene's attributes like: position, visible and scale.