![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
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.
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()
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()
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()
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)
state | The internal state to which the given node will be assigned. |
nodeId | The node ID of the node to assign. |
Get the ID of the touch area's active node for a given state.
String GetStateNodeId(Murl.IEnums.ButtonState state)
state | The internal state for which to query the assigned node. |
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)
state | The internal state to which the given child will be assigned. |
childIndex | The zero-based index of the child node to assign. |
Get the index of the touch area's active child for a given state.
Integer GetStateChildIndex(Murl.IEnums.ButtonState state)
state | The internal state for which to query the assigned child. |
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)
state | The state for which to set the target time value. |
time | The target time value. |
Get the target time value set for a given state.
Number GetStateAnimationTime(Murl.IEnums.ButtonState state)
state | The state for which to query the target time. |
Reset the target time value for a given state to 0.
Boolean ResetStateAnimationTime(Murl.IEnums.ButtonState state)
state | The state for which to reset the target time value. |
Query if a target time value was set for a given state.
Boolean IsStateAnimationTimeSet(Murl.IEnums.ButtonState state)
state | The state to query. |
Define a timeline node from within the current graph namespace.
Boolean SetTimelineNodeId(String nodeId)
nodeId | The node ID of the timeline to assign. |
Query the node ID of an assigned timeline child.
String GetTimelineNodeId()
Define a timeline node among the touch area's children.
Boolean SetTimelineChildIndex(Integer nodeIndex)
nodeIndex | The zero-based child index of the timeline child to assign. |
Query the child index of an assigned timeline child.
Integer GetTimelineChildIndex()