Class cocos.actions.interval_actions.Bezier

             object --+        
                      |        
    base_actions.Action --+    
                          |    
base_actions.IntervalAction --+
                              |
                             Bezier

Moves a CocosNode object through a bezier path by modifying it's position attribute.

Example:

action = Bezier( bezier_conf.path1, 5 )   # Moves the sprite using the
sprite.do( action )                       # bezier path 'bezier_conf.path1'
                                          # in 5 seconds

Methods

  init(self, bezier, duration=5, forward=True)
Init method
  start(self)
Before we start executing an action, self.target is assigned and this method is called.
  update(self, t)
Gets called on every frame.
  __reversed__(self)
Inherited from base_actions.IntervalAction: done Inherited from base_actions.Action: __add__, __init__, __mul__, __or__, step, stop Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Instance Variables

Inherited from base_actions.Action: target

Method Details

init

init(self, bezier, duration=5, forward=True)
Init method
Parameters:
bezier : bezier_configuration instance
A bezier configuration
duration : float
Duration time in seconds
Overrides:
base_actions.Action.init

start

start(self)
Before we start executing an action, self.target is assigned and this method is called. It will be called for every execution of the action.
Overrides:
base_actions.Action.start

update

update(self, t)
Gets called on every frame. t is in [0,1] If this action takes 5 seconds to execute, t will be equal to 0 at 0 seconds. t will be 0.5 at 2.5 seconds and t will be 1 at 5sec.
Overrides:
base_actions.IntervalAction.update

__reversed__

__reversed__(self)
Overrides:
base_actions.Action.__reversed__