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

The ITouchArea graph node interface.

This interface represents an input object in world space (i.e. a "button").

A touch area by itself does not actually have any renderable geometry; instead, it only holds a specific surface shape on which any pointing events are evaluated in 3D space.

In general, a touch area can be in one of 3 available states: "Up", "Down" or "Disabled". For devices that provide a point input method other than a touch screen, such as a mouse, there also exists an additional "Hover" state. Internally, a touch area node acts similar to a Graph::ISwitch node, managing visibility of a subset of its child nodes that are assigned to these states. Depending on the actual state the touch area is in, the respective child node gets activated, and all other ones deactivated. If a child node is not assigned to one of these states, it is left unmanaged.

In addition, it is possible to define a single child node implementing the Graph::ITimeline interface to react on state changes. The assigned timeline will then be started to run up to a given time value set for that state.


Table members

Inherited


Murl.Graph.ITouchable

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

GetTransformInterface()

Get the constant Graph::ITransform interface. This method returns a constant pointer to the node's Graph::ITransform interface, to be able to query the node's transformation matrix and depth order.

Murl.Graph.ITransform GetTransformInterface()

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

GetFrameBufferNodeTarget()

Get the constant IFrameBufferNodeTarget container. This method returns a constant pointer to the node's IFrameBufferNodeTarget container, which allows to query the frame buffer object the touch area object delegates its input to.

Murl.Graph.IGenericNodeTarget.GraphIFrameBuffer GetFrameBufferNodeTarget()

Returns
Murl.Graph.IGenericNodeTarget.GraphIFrameBuffer The constant IFrameBufferNodeTarget container, or null if not available

SetStateNodeId(state, nodeId)

Set the touch area's active node ID for a given state. Calling this method assigns one of the touch area's nodes to a given internal state. If done so, that node will be activated whenever the touch area changes to this state, and deactivated when it changes to a different state.

Boolean SetStateNodeId(Murl.IEnums.ButtonState state, String nodeId)

Parameters
stateThe internal state to which the given node will be assigned.
nodeIdThe node ID of the node to assign.
Returns
Boolean true if successful.

GetStateNodeId(state)

Get the ID of the touch area's active node for a given state.

String GetStateNodeId(Murl.IEnums.ButtonState state)

Parameters
stateThe internal state for which to query the assigned node.
Returns
String The ID of the assigned node, or an empty string if there is no present assignment for the givent state.

SetStateChildIndex(state, childIndex)

Set the touch area's active child for a given state. Calling this method assigns one of the touch area's children to a given internal state. If done so, that child will be activated whenever the touch area changes to this state, and deactivated when it changes to a different state. All children that are not assigned to a specific state behave normally.

As an example, a touch area may have four Graph::IParametersState children representing different colors, each assigned to one of the four possible internal states, and a Graph::PlaneGeometry as an additional fifth child without state assignment. Depending on the touch area's current state, one of these parameter sets will be selected, and the plane geometry will be rendered in different colors.

Boolean SetStateChildIndex(Murl.IEnums.ButtonState state, Integer childIndex)

Parameters
stateThe internal state to which the given child will be assigned.
childIndexThe zero-based index of the child node to assign.
Returns
Boolean true if successful.

GetStateChildIndex(state)

Get the index of the touch area's active child for a given state.

Integer GetStateChildIndex(Murl.IEnums.ButtonState state)

Parameters
stateThe internal state for which to query the assigned child.
Returns
Integer The zero-based index into the touch area's array of children, or -1 if there is no present assignment for the givent state.

SetStateAnimationTime(state, time)

Set the target time value for a given state. When a timeline child node is defined via SetTimelineNodeId() or SetTimelineChildIndex(), this method sets the target time value to run to when the touch area is entering the given state.

Boolean SetStateAnimationTime(Murl.IEnums.ButtonState state, Number time)

Parameters
stateThe state for which to set the target time value.
timeThe target time value.
Returns
Boolean true if successful.

GetStateAnimationTime(state)

Get the target time value set for a given state.

Number GetStateAnimationTime(Murl.IEnums.ButtonState state)

Parameters
stateThe state for which to query the target time.
Returns
Number The target time value.

ResetStateAnimationTime(state)

Reset the target time value for a given state to 0.

Boolean ResetStateAnimationTime(Murl.IEnums.ButtonState state)

Parameters
stateThe state for which to reset the target time value.
Returns
Boolean true if successful.

IsStateAnimationTimeSet(state)

Query if a target time value was set for a given state.

Boolean IsStateAnimationTimeSet(Murl.IEnums.ButtonState state)

Parameters
stateThe state to query.
Returns
Boolean true if a target time value was set for the given state.

SetTimelineNodeId(nodeId)

Define a timeline node from within the current graph namespace.

Boolean SetTimelineNodeId(String nodeId)

Parameters
nodeIdThe node ID of the timeline to assign.
Returns
Boolean true if successful.

GetTimelineNodeId()

Query the node ID of an assigned timeline child.

String GetTimelineNodeId()

Returns
String The node id of the assigned timeline child, or an empty string if no timeline was assigned or a child was explicitly assigned by its child index.

SetTimelineChildIndex(nodeIndex)

Define a timeline node among the touch area's children.

Boolean SetTimelineChildIndex(Integer nodeIndex)

Parameters
nodeIndexThe zero-based child index of the timeline child to assign.
Returns
Boolean true if successful.

GetTimelineChildIndex()

Query the child index of an assigned timeline child.

Integer GetTimelineChildIndex()

Returns
Integer The zero-based child index of the assigned timeline child, or -1 if no explicit child was assigned or a different timeline node was used from the current namespace via SetTimelineNodeId().