Moai SDK  2.0
MOAIAction Class Reference
+ Inheritance diagram for MOAIAction:

Function List

addChild
 
attach
 
clear
 
defer
 
detach
 
getChildren
 
hasChildren
 
isActive
 
isBusy
 
isDone
 
isPaused
 
pause
 
setAutoStop
 
start
 
stop
 
throttle
 
update
 
- Function List inherited from MOAIInstanceEventSource
getListener
 
setListener
 

Detailed Description

ConstantsDescription
MOAIAction.EVENT_START
MOAIAction.EVENT_STOP ID of event stop callback. Signature is: nil onStop ()

Function Documentation

addChild

Attaches a child action for updating.


function addChild ( MOAIAction self, MOAIAction child [, boolean defer ] )

Parameters
MOAIActionself
MOAIActionchild
booleandefer Optional. Default value is 'false.'
Returns
MOAIAction self
attach

Attaches a child to a parent action. The child will receive updates from the parent only if the parent is in the action tree.


function attach ( MOAIAction self [, MOAIAction parent, boolean defer ] )

Parameters
MOAIActionself
MOAIActionparent Optional. Default value is nil; same effect as calling detach ().
booleandefer Optional. Default value is 'false.'
Returns
MOAIAction self
clear

Removes all child actions.


function clear ( MOAIAction self )

Parameters
MOAIActionself
Returns
MOAIAction self
defer

Defers action's update until the next time the action tree is processed.


function defer ( MOAIAction self )

Parameters
MOAIActionself
Returns
nil
detach

Detaches an action from its parent (if any) thereby removing it from the action tree. Same effect as calling stop ().


function detach ( MOAIAction self )

Parameters
MOAIActionself
Returns
MOAIAction self
getChildren

Get action's children (if any).


function getChildren ( MOAIAction self )

Parameters
MOAIActionself
Returns
...
hasChildren

Returns 'true; if action has children and the number of children.


function hasChildren ( MOAIAction self )

Parameters
MOAIActionself
Returns
boolean hasChildren, number nChildren
isActive

Checks to see if an action is currently in the action tree.


function isActive ( MOAIAction self )

Parameters
MOAIActionself
Returns
boolean isActive
isBusy

Checks to see if an action is currently busy. An action is 'busy' only if it is 'active' and not 'done.'.


function isBusy ( MOAIAction self )

Parameters
MOAIActionself
Returns
boolean isBusy
isDone

Checks to see if an action is 'done.' Definition of 'done' is up to individual action implementations.


function isDone ( MOAIAction self )

Parameters
MOAIActionself
Returns
boolean isDone
isPaused

Checks to see if an action is 'paused.'.


function isPaused ( MOAIAction self )

Parameters
MOAIActionself
Returns
bool isPaused
pause

Leaves the action in the action tree but prevents it from receiving updates. Call pause ( false ) or start () to unpause.


function pause ( MOAIAction self [, boolean pause ] )

Parameters
MOAIActionself
booleanpause Optional. Default value is 'true.'
Returns
nil
setAutoStop

Flag action to automatically stop (and be removed from action tree) when no longer busy.


function setAutoStop ( MOAIAction self )

Parameters
MOAIActionself
Returns
nil
start

Adds the action to a parent action or the root of the action tree.


function start ( MOAIAction self [, MOAIAction parent, boolean defer ] )

Parameters
MOAIActionself
MOAIActionparent Optional. Default value is MOAIActionMgr.getRoot ()
booleandefer Optional. Action will first run during the next sim step, even if it visited during the current sim step. Default value is 'false.'
Returns
MOAIAction self
stop

Removed the action from its parent action; action will stop being updated.


function stop ( MOAIAction self )

Parameters
MOAIActionself
Returns
MOAIAction self
throttle

Sets the actions throttle. Throttle is a scalar on time. Is is passed to the action's children.


function throttle ( MOAIAction self [, number throttle ] )

Parameters
MOAIActionself
numberthrottle Optional. Default value is 1.
Returns
MOAIAction self
update

Update action manually. This call will not update child actions.


function update ( MOAIAction self [, number step ] )

Parameters
MOAIActionself
numberstep Optional. Default value is sim step
Returns
MOAIAction self