Module ncine.scenenode
The table containing scenenode related functions.
A scene node is the base class for many other classes that can be organized in a scene graph.
Functions
ncine.scenenode.get_parent (node) | Returns the parent node, if there is any |
ncine.scenenode.set_parent (node, parent) | Sets the parent node |
ncine.scenenode.num_children (node) | Returns the number of children |
ncine.scenenode.get_child (node, index) | Returns the n-th child |
ncine.scenenode.get_children (node) | Returns the array of children |
ncine.scenenode.add_child (parent, node) | Adds a child node to the specified parent |
ncine.scenenode.remove_child (parent, node) | Removes a child node from the specified parent |
ncine.scenenode.remove_child_at (parent, index) | Removes a child node at the specified index from the specified parent |
ncine.scenenode.remove_all_children (parent) | Removes all children from the specified parent |
ncine.scenenode.unlink_child (parent, node) | Unlinks a child node from the specified parent. |
ncine.scenenode.get_child_order_index (node) | Returns the order index of this node among its siblings |
ncine.scenenode.swap_children (parent, firstIndex, secondIndex) | Swaps two children at the specified indices |
ncine.scenenode.swap_node_forward (node) | Brings this node one node forward in the parent’s list of children |
ncine.scenenode.swap_node_back (node) | Brings this node one node back in the parent’s list of children |
ncine.scenenode.get_visit_order_state (node) | Returns the visit order state for the specified node |
ncine.scenenode.set_visit_order_state (node, state) | Sets the visit order state for the specified node |
ncine.scenenode.get_visit_order_index (node) | Returns the visit drawing order of the node |
ncine.scenenode.is_enabled (node) | Returns true if the node is both updating and drawing |
ncine.scenenode.set_enabled (node, enabled) | Enables or disables both node updating and drawing |
ncine.scenenode.get_position (node) | Returns the node position relative to its parent |
ncine.scenenode.set_position (node, pos) | Sets a new position for the node |
ncine.scenenode.set_position (node, x, y) | Sets a new position for the node |
ncine.scenenode.get_abs_anchor_point (node) | Returns the absolute transformation anchor point in pixels |
ncine.scenenode.set_abs_anchor_point (node, pos) | Sets the absolute transformation anchor point in pixels |
ncine.scenenode.set_abs_anchor_point (node, x, y) | Sets the absolute transformation anchor point in pixels |
ncine.scenenode.get_scale (node) | Returns the node scale factors |
ncine.scenenode.set_scale_x (node, factor) | Sets the node scale X factor |
ncine.scenenode.set_scale_y (node, factor) | Sets the node scale Y factor |
ncine.scenenode.set_scale (node, factor) | Sets both node scale factors to the specified value |
ncine.scenenode.get_rotation (node) | Returns the node rotation in degress |
ncine.scenenode.set_rotation (node, rot) | Sets the node rotation in degrees |
ncine.scenenode.get_color (node) | Returns the node color |
ncine.scenenode.set_color (node, color) | Sets the node color |
ncine.scenenode.set_color (node, red, green, blue, alpha) | Sets the node color through its components |
ncine.scenenode.get_alpha (node) | Returns the node alpha color component |
ncine.scenenode.set_alpha (node, alpha) | Sets the node alpha color component |
ncine.scenenode.get_layer (node) | Returns the node rendering layer |
ncine.scenenode.set_layer (node, layer) | Sets the node rendering layer. |
ncine.scenenode.get_last_frame_updated (node) | Returns the last frame in which any of the viewports have updated this node |
Tables
scenenodeObj | The light user data of a scenenode object |
ncine.visit_order_state | Visit order states (enumeration) |
Functions
- ncine.scenenode.get_parent (node)
-
Returns the parent node, if there is any
Parameters:
- node scenenodeObj
Returns:
-
scenenodeObj or nil
- ncine.scenenode.set_parent (node, parent)
-
Sets the parent node
Parameters:
- node scenenodeObj
- parent scenenodeObj or nil
Returns:
-
boolean
true
if the parent has been set - ncine.scenenode.num_children (node)
-
Returns the number of children
Parameters:
- node scenenodeObj
Returns:
-
integer
- ncine.scenenode.get_child (node, index)
-
Returns the n-th child
Parameters:
- node scenenodeObj
- index integer
Returns:
-
scenenodeObj or nil
- ncine.scenenode.get_children (node)
-
Returns the array of children
Parameters:
- node scenenodeObj
Returns:
- ncine.scenenode.add_child (parent, node)
-
Adds a child node to the specified parent
Parameters:
- parent scenenodeObj
- node scenenodeObj
Returns:
-
boolean
true
if the node has been added - ncine.scenenode.remove_child (parent, node)
-
Removes a child node from the specified parent
Parameters:
- parent scenenodeObj
- node scenenodeObj
Returns:
-
boolean
true
if the node has been removed - ncine.scenenode.remove_child_at (parent, index)
-
Removes a child node at the specified index from the specified parent
Parameters:
- parent scenenodeObj
- index integer
Returns:
-
boolean
true
if the node has been removed - ncine.scenenode.remove_all_children (parent)
-
Removes all children from the specified parent
Parameters:
- parent scenenodeObj
Returns:
-
boolean
true
if there were at least one node to remove - ncine.scenenode.unlink_child (parent, node)
-
Unlinks a child node from the specified parent.
The children of the unlinked node will be reparented with the grandparent node.
Parameters:
- parent scenenodeObj
- node scenenodeObj
Returns:
-
boolean
true
if the node has been unlinked - ncine.scenenode.get_child_order_index (node)
-
Returns the order index of this node among its siblings
Parameters:
- node scenenodeObj
Returns:
-
integer
The order index or zero if the node has no parent
- ncine.scenenode.swap_children (parent, firstIndex, secondIndex)
-
Swaps two children at the specified indices
Parameters:
- parent scenenodeObj
- firstIndex integer
- secondIndex integer
Returns:
-
boolean
true
if the two nodes have been swapped - ncine.scenenode.swap_node_forward (node)
-
Brings this node one node forward in the parent’s list of children
Parameters:
- node scenenodeObj
Returns:
-
boolean
true
if the node has been brought one position forward - ncine.scenenode.swap_node_back (node)
-
Brings this node one node back in the parent’s list of children
Parameters:
- node scenenodeObj
Returns:
-
boolean
true
if the node has been brought one position back - ncine.scenenode.get_visit_order_state (node)
-
Returns the visit order state for the specified node
Parameters:
- node scenenodeObj
Returns:
-
ncine.visit_order_state
- ncine.scenenode.set_visit_order_state (node, state)
-
Sets the visit order state for the specified node
Parameters:
- node scenenodeObj
- state ncine.visit_order_state
- ncine.scenenode.get_visit_order_index (node)
-
Returns the visit drawing order of the node
Parameters:
- node scenenodeObj
Returns:
-
integer
- ncine.scenenode.is_enabled (node)
-
Returns
true
if the node is both updating and drawingParameters:
- node scenenodeObj
Returns:
-
boolean
- ncine.scenenode.set_enabled (node, enabled)
-
Enables or disables both node updating and drawing
Parameters:
- node scenenodeObj
- enabled boolean
- ncine.scenenode.get_position (node)
-
Returns the node position relative to its parent
Parameters:
- node scenenodeObj
Returns:
-
ncine.vec2
- ncine.scenenode.set_position (node, pos)
-
Sets a new position for the node
Parameters:
- node scenenodeObj
- pos ncine.vec2
- ncine.scenenode.set_position (node, x, y)
-
Sets a new position for the node
Parameters:
- node scenenodeObj
- x number
- y number
- ncine.scenenode.get_abs_anchor_point (node)
-
Returns the absolute transformation anchor point in pixels
Parameters:
- node scenenodeObj
Returns:
-
ncine.vec2
- ncine.scenenode.set_abs_anchor_point (node, pos)
-
Sets the absolute transformation anchor point in pixels
Parameters:
- node scenenodeObj
- pos ncine.vec2
- ncine.scenenode.set_abs_anchor_point (node, x, y)
-
Sets the absolute transformation anchor point in pixels
Parameters:
- node scenenodeObj
- x number
- y number
- ncine.scenenode.get_scale (node)
-
Returns the node scale factors
Parameters:
- node scenenodeObj
Returns:
-
ncine.vec2
- ncine.scenenode.set_scale_x (node, factor)
-
Sets the node scale X factor
Parameters:
- node scenenodeObj
- factor number
- ncine.scenenode.set_scale_y (node, factor)
-
Sets the node scale Y factor
Parameters:
- node scenenodeObj
- factor number
- ncine.scenenode.set_scale (node, factor)
-
Sets both node scale factors to the specified value
Parameters:
- node scenenodeObj
- factor number
- ncine.scenenode.get_rotation (node)
-
Returns the node rotation in degress
Parameters:
- node scenenodeObj
Returns:
-
number
- ncine.scenenode.set_rotation (node, rot)
-
Sets the node rotation in degrees
Parameters:
- node scenenodeObj
- rot number The amount of degrees
- ncine.scenenode.get_color (node)
-
Returns the node color
Parameters:
- node scenenodeObj
Returns:
-
ncine.color
- ncine.scenenode.set_color (node, color)
-
Sets the node color
Parameters:
- node scenenodeObj
- color ncine.color
- ncine.scenenode.set_color (node, red, green, blue, alpha)
-
Sets the node color through its components
Parameters:
- node scenenodeObj
- red number
- green number
- blue number
- alpha number
- ncine.scenenode.get_alpha (node)
-
Returns the node alpha color component
Parameters:
- node scenenodeObj
Returns:
-
number
- ncine.scenenode.set_alpha (node, alpha)
-
Sets the node alpha color component
Parameters:
- node scenenodeObj
- alpha number
- ncine.scenenode.get_layer (node)
-
Returns the node rendering layer
Parameters:
- node scenenodeObj
Returns:
-
integer
- ncine.scenenode.set_layer (node, layer)
-
Sets the node rendering layer.
The lowest value (bottom) is 0 and the highest one (top) is 65535.
When the value is 0, the final layer value is inherited from the parent.
Parameters:
- node scenenodeObj
- layer integer
- ncine.scenenode.get_last_frame_updated (node)
-
Returns the last frame in which any of the viewports have updated this node
Parameters:
- node scenenodeObj
Returns:
-
integer