Trees | Indices | Toggle frames |
---|
Action --+ | IntervalAction
IntervalAction()
Interval Actions are the ones that have fixed duration, known when the worker instance is created, and, conceptually, the expected duration must be positive. Degeneratated cases, when a particular instance gets a zero duration, are allowed for convenience.
IntervalAction adds the method update to the public interfase, and it expreses the changes to target as a function of the time elapsed, relative to the duration, ie f(time_elapsed/duration). Also, it is guaranted that in normal termination .update(1.0) is called. Degenerate cases, when a particular instance gets a zero duration, also are guaranted to call .update(1.0) Note that when a premature termination happens stop will be called but update(1.0) is not called.
Examples: MoveTo , MoveBy , RotateBy are strictly Interval Actions, while Place, Show and CallFunc aren't.
While RotateBy(angle, duration) will usually receive a positive duration, it will accept duration = 0, to ease on cases like action = RotateBy( angle, a-b )
step(self,
dt)
Dont customize this method: it will not be called when in the component
role for certain composite actions (like Sequence_IntervalAction).
|
|
update(self,
t)
Gets called on every frame
't' is the time elapsed normalized to [0, 1]
If this action takes 5 seconds to execute,
t will be equal to 0
at 0 seconds. |
|
done(self)
When in the worker role, this method is reliable.
|
|
__mul__(self,
other)
repeats ntimes the action
action * n -> action_result
where action result performs as:
repeat n times the changes that action would do
|
|
__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)
|
|
__init__(self,
*args,
**kwargs)
dont override - use init
(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)
|
|
start(self)
External code sets self.target and then calls this method.
(Inherited from cocos.actions.base_actions.Action)
|
|
stop(self)
When the action must cease to perform this function is called by
external code; after this call no other method should be called.
(Inherited from cocos.actions.base_actions.Action)
|
target
CocosNode object that is the target of the action
(Inherited from cocos.actions.base_actions.Action)
|
Trees | Indices | Toggle frames |
---|
Generated by Epydoc 3.0beta1 on Wed Sep 08 23:50:17 2010 | http://epydoc.sourceforge.net |