Murl Engine Lua Addon API  Version 1.0 beta
Murl.Graph.ISwitch

The ISwitch graph node interface.

Graph::ISwitch nodes provide an easy and efficient way to select at most one child among a given number of children to be active and visible at the same time.

The currently active child can be either selected via the Graph::IIndexed base interface by specifying that child's index, or by calling SetSelectedChild() with a given child node ID. When doing so, any previously active other child gets deactivated.


Table members

Inherited


Murl.Graph.IIndexed

Methods


GetNodeInterface()

Get the constant Graph::INode interface. This method returns a constant pointer to the node's Graph::INode interface, to be able to query common node properties such as active state, visibility or ID.

Murl.Graph.INode GetNodeInterface()

Returns
Murl.Graph.INode The constant Graph::INode interface, or null if not available

SetSelectedChild(id)

Set the currently active child node.

Boolean SetSelectedChild(String id)

Parameters
idThe node ID of the child to activate.
Returns
Boolean true if successful.

GetSelectedChild()

Get the currently active child node.

Murl.Graph.INode GetSelectedChild()

Returns
Murl.Graph.INode The currently active node, or a null pointer if none is active.

IsChildSelected(id)

Check if a child with a given node ID is currently active.

Boolean IsChildSelected(String id)

Parameters
idThe child node ID to check.
Returns
Boolean true if the child with the given ID is active.