Moai SDK  1.5 revision 1 (MoaiEdition)
MOAINode Class Reference
Inheritance diagram for MOAINode:
MOAIInstanceEventSource MOAIEventSource MOAIAnimCurveBase MOAICameraAnchor2D MOAICameraFitter2D MOAIColor MOAIDeckRemapper MOAIFmodExChannel MOAIScriptNode MOAIShader MOAITextStyle MOAITimer MOAITransformBase MOAIUntzSound

List of all members.

Function List

  clearAttrLink
  clearNodeLink
  forceUpdate
  getAttr
  getAttrLink
  moveAttr
  scheduleUpdate
  seekAttr
  setAttrLink
  setAttr
  setNodeLink

Function Documentation

Clears an attribute *pull* link - call this from the node receiving the attribute value.


function clearAttrLink ( MOAINode self, number attrID )
Parameters:
self ( MOAINode )
attrID ( number )
Returns:
nil

Clears a dependency on a foreign node.


function clearNodeLink ( MOAINode self, MOAINode sourceNode )
Parameters:
self ( MOAINode )
sourceNode ( MOAINode )
Returns:
nil

Evaluates the dependency graph for this node. Typically, the entire active dependency graph is evaluated once per frame, but in some cases it may be desirable to force evaluation of a node to make sure source dependencies are propagated to it immediately.


function forceUpdate ( MOAINode self )
Parameters:
self ( MOAINode )
Returns:
nil

Returns the value of the attribute if it exists or nil if it doesn't.


function getAttr ( MOAINode self, number attrID )
Parameters:
self ( MOAINode )
attrID ( number )
Returns:
value ( number )

Returns the link if it exists or nil if it doesn't.


function getAttrLink ( MOAINode self, number attrID )
Parameters:
self ( MOAINode )
attrID ( number )
Returns:
sourceNode ( MOAINode ), sourceAttrID ( number )

Animate the attribute by applying a delta. Creates and returns a MOAIEaseDriver initialized to apply the delta.


function moveAttr ( MOAINode self, number attrID, number delta, number length [, number mode ] )
Parameters:
self ( MOAINode )
attrID ( number ) ID of the attribute to animate.
delta ( number ) Total change to be added to attribute.
length ( number ) Length of animation in seconds.
mode ( number ) Optional. The ease mode. One of MOAIEaseType.EASE_IN, MOAIEaseType.EASE_OUT, MOAIEaseType.FLAT MOAIEaseType.LINEAR, MOAIEaseType.SMOOTH, MOAIEaseType.SOFT_EASE_IN, MOAIEaseType.SOFT_EASE_OUT, MOAIEaseType.SOFT_SMOOTH. Defaults to MOAIEaseType.SMOOTH.
Returns:
easeDriver ( MOAIEaseDriver )

Schedule the node for an update next time the dependency graph is processed. Any dependent nodes will also be updated.


function scheduleUpdate ( MOAINode self )
Parameters:
self ( MOAINode )
Returns:
nil

Animate the attribute by applying a delta. Delta is computed given a target value. Creates and returns a MOAIEaseDriver initialized to apply the delta.


function seekAttr ( MOAINode self, number attrID, number goal, number length [, number mode ] )
Parameters:
self ( MOAINode )
attrID ( number ) ID of the attribute to animate.
goal ( number ) Desired resulting value for attribute.
length ( number ) Length of animation in seconds.
mode ( number ) Optional. The ease mode. One of MOAIEaseType.EASE_IN, MOAIEaseType.EASE_OUT, MOAIEaseType.FLAT MOAIEaseType.LINEAR, MOAIEaseType.SMOOTH, MOAIEaseType.SOFT_EASE_IN, MOAIEaseType.SOFT_EASE_OUT, MOAIEaseType.SOFT_SMOOTH. Defaults to MOAIEaseType.SMOOTH.
Returns:
easeDriver ( MOAIEaseDriver )

Sets the value of an attribute.


function setAttr ( MOAINode self, number attrID, number value )
Parameters:
self ( MOAINode )
attrID ( number )
value ( number )
Returns:
nil

Sets a *pull* attribute connecting an attribute in the node to an attribute in a foreign node.


function setAttrLink ( MOAINode self, number attrID, MOAINode sourceNode [, number sourceAttrID ] )
Parameters:
self ( MOAINode )
attrID ( number ) ID of attribute to become dependent of foreign node.
sourceNode ( MOAINode ) Foreign node.
sourceAttrID ( number ) Optional. Attribute in foreign node to control value of attribue. Default value is attrID.
Returns:
nil

Creates a dependency between the node and a foreign node without the use of attributes; if the foreign node is updated, the dependent node will be updated after.


function setNodeLink ( MOAINode self, MOAINode sourceNode )
Parameters:
self ( MOAINode )
sourceNode ( MOAINode )
Returns:
nil