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:

Returns:

    scenenodeObj or nil
ncine.scenenode.set_parent (node, parent)
Sets the parent node

Parameters:

Returns:

    boolean true if the parent has been set
ncine.scenenode.num_children (node)
Returns the number of children

Parameters:

Returns:

    integer
ncine.scenenode.get_child (node, index)
Returns the n-th child

Parameters:

Returns:

    scenenodeObj or nil
ncine.scenenode.get_children (node)
Returns the array of children

Parameters:

Returns:

    scenenodeObj[]
ncine.scenenode.add_child (parent, node)
Adds a child node to the specified parent

Parameters:

Returns:

    boolean true if the node has been added
ncine.scenenode.remove_child (parent, node)
Removes a child node from the specified parent

Parameters:

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:

Returns:

    boolean true if the node has been removed
ncine.scenenode.remove_all_children (parent)
Removes all children from the specified parent

Parameters:

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:

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:

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:

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:

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:

Returns:

    ncine.visit_order_state
ncine.scenenode.set_visit_order_state (node, state)
Sets the visit order state for the specified node

Parameters:

ncine.scenenode.get_visit_order_index (node)
Returns the visit drawing order of the node

Parameters:

Returns:

    integer
ncine.scenenode.is_enabled (node)
Returns true if the node is both updating and drawing

Parameters:

Returns:

    boolean
ncine.scenenode.set_enabled (node, enabled)
Enables or disables both node updating and drawing

Parameters:

ncine.scenenode.get_position (node)
Returns the node position relative to its parent

Parameters:

Returns:

    ncine.vec2
ncine.scenenode.set_position (node, pos)
Sets a new position for the node

Parameters:

ncine.scenenode.set_position (node, x, y)
Sets a new position for the node

Parameters:

ncine.scenenode.get_abs_anchor_point (node)
Returns the absolute transformation anchor point in pixels

Parameters:

Returns:

    ncine.vec2
ncine.scenenode.set_abs_anchor_point (node, pos)
Sets the absolute transformation anchor point in pixels

Parameters:

ncine.scenenode.set_abs_anchor_point (node, x, y)
Sets the absolute transformation anchor point in pixels

Parameters:

ncine.scenenode.get_scale (node)
Returns the node scale factors

Parameters:

Returns:

    ncine.vec2
ncine.scenenode.set_scale_x (node, factor)
Sets the node scale X factor

Parameters:

ncine.scenenode.set_scale_y (node, factor)
Sets the node scale Y factor

Parameters:

ncine.scenenode.set_scale (node, factor)
Sets both node scale factors to the specified value

Parameters:

ncine.scenenode.get_rotation (node)
Returns the node rotation in degress

Parameters:

Returns:

    number
ncine.scenenode.set_rotation (node, rot)
Sets the node rotation in degrees

Parameters:

ncine.scenenode.get_color (node)
Returns the node color

Parameters:

Returns:

    ncine.color
ncine.scenenode.set_color (node, color)
Sets the node color

Parameters:

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:

Returns:

    number
ncine.scenenode.set_alpha (node, alpha)
Sets the node alpha color component

Parameters:

ncine.scenenode.get_layer (node)
Returns the node rendering layer

Parameters:

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:

ncine.scenenode.get_last_frame_updated (node)
Returns the last frame in which any of the viewports have updated this node

Parameters:

Returns:

    integer

Tables

scenenodeObj
The light user data of a scenenode object
ncine.visit_order_state
Visit order states (enumeration)

Fields:

  • ENABLED
  • DISABLED
  • SAME_AS_PARENT
generated by LDoc 1.5.0 Last updated 2024-12-18 15:08:56