Class cocos.actions.interval_actions.MoveBy

             object --+            
                      |            
    base_actions.Action --+        
                          |        
base_actions.IntervalAction --+    
                              |    
                         MoveTo --+
                                  |
                                 MoveBy

Moves a CocosNode object x,y pixels by modifying it's position attribute. x and y are relative to the position of the object. Duration is is seconds.

Example:

# Move the sprite 50 pixels to the left in 8 seconds
action = MoveBy( (-50,0), 8 )
sprite.do( action )

Methods

  init(self, delta, duration=5)
Init method.
  start(self)
  __reversed__(self)
  update(self, t)
Gets called on every frame.
(Inherited from cocos.actions.interval_actions.MoveTo)
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, delta, duration=5)
Init method.
Parameters:
delta : (x,y)
Delta coordinates
duration : float
Duration time in seconds
Overrides:
MoveTo.init

start

start(self)
Overrides:
MoveTo.start

__reversed__

__reversed__(self)
Overrides:
base_actions.Action.__reversed__