Class cocos.actions.base_actions.InstantAction

    Action --+    
             |    
IntervalAction --+
                 |
                InstantAction
Known Subclasses:
audio.actions.PlayAction, instant_actions.CallFunc, instant_actions.Hide, instant_actions.Place, instant_actions.Show, instant_actions.ToggleVisibility, basegrid_actions.ReuseGrid, basegrid_actions.StopGrid, Loop_Instant_Action, Sequence_InstantAction, Spawn_InstantAction
Instant actions are actions that promises to do nothing when the methods step, update, and stop are called. Any changes that the action must perform on his target will be done in the .start() method The interface must be keept compatible with IntervalAction to allow the basic operators to combine an InstantAction with an IntervalAction and give an IntervalAction as a result.

Methods

  __init__(self, *args, **kwargs)
dont override - use init
  step(self, dt)
does nothing - dont override
  start(self)
Here we must do out stuff
  done(self)
When in the worker role, this method is reliable.
  update(self, t)
does nothing - dont override
  stop(self)
does nothing - dont override
  __mul__(self, other)
  __add__(self, action)
sequence operator - concatenates actions action1 + action2 -> action_result where action_result performs as: first do all that action1 would do; then perform all that action2 would do
(Inherited from cocos.actions.base_actions.Action)
  __or__(self, action)
spawn operator - runs two actions in parallel action1 | action2 -> action_result
(Inherited from cocos.actions.base_actions.Action)
  __reversed__(self) (Inherited from cocos.actions.base_actions.Action)
  init(*args, **kwargs)
Gets called by __init__ with all the parameteres received, At this time the target for the action is unknown.
(Inherited from cocos.actions.base_actions.Action)

Instance Variables

  target
CocosNode object that is the target of the action
(Inherited from cocos.actions.base_actions.Action)

Method Details

__init__

(Constructor) __init__(self, *args, **kwargs)
dont override - use init
Overrides:
Action.__init__

step

step(self, dt)
does nothing - dont override
Overrides:
IntervalAction.step

start

start(self)
Here we must do out stuff
Overrides:
Action.start

done

done(self)
When in the worker role, this method is reliable. When in the component role, if the composite spares the call to step this method cannot be relied (an then the composite must decide by itself when the action is done). Example of later situation is Sequence_IntervalAction.
Overrides:
IntervalAction.done

update

update(self, t)
does nothing - dont override
Overrides:
IntervalAction.update

stop

stop(self)
does nothing - dont override
Overrides:
Action.stop

__mul__

__mul__(self, other)
Overrides:
IntervalAction.__mul__