Class cocos.actions.base_actions.Action

object --+
         |
        Action
Mother of all actions

Methods

  __init__(self, *args, **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  init(self)
Gets called at initialization time, before a target is defined
  start(self)
Before we start executing an action, self.target is assigned and this method is called.
  stop(self)
After we finish executing an action this method is called.
  step(self, dt)
Gets called every frame.
  __add__(self, action)
Is the Sequence Action
  __mul__(self, other)
  __or__(self, action)
Is the Spawn Action
  __reversed__(self)
Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Instance Variables

  target
CocosNode object that is the target of the action

Method Details

__init__

(Constructor) __init__(self, *args, **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides:
object.__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.

stop

stop(self)
After we finish executing an action this method is called. It will be called for every execution of the action.

step

step(self, dt)

Gets called every frame. dt is the number of seconds that elapsed since the last call. If there was a pause and resume in the middle, the actual elapsed time may be bigger.

This function will only be called by the Layer, but interval actions will be updated with the IntervalAction.update method.