The ITouchable property interface. More...
#include "murl_graph_i_touchable.h"
Public Member Functions | |
virtual Bool | SetEnabled (Bool enabled)=0 |
Enable or disable the button. More... | |
virtual Bool | IsEnabled () const =0 |
Check if the button is enabled. More... | |
virtual Bool | SetActiveFaces (IEnums::PolygonFaces faces)=0 |
Set which faces of the button are active. More... | |
virtual IEnums::PolygonFaces | GetActiveFaces () const =0 |
Check which faces of the button are active. More... | |
virtual Bool | SetOutCoordSize (Real sizeX, Real sizeY)=0 |
Set the output coordinate reference size. More... | |
virtual Bool | SetOutCoordSizeX (Real sizeX)=0 |
Set the horizontal output coordinate reference size. More... | |
virtual Bool | SetOutCoordSizeY (Real sizeY)=0 |
Set the vertical output coordinate reference size. More... | |
virtual Real | GetOutCoordSizeX () const =0 |
Get the horizontal output coordinate reference size. More... | |
virtual Real | GetOutCoordSizeY () const =0 |
Get the vertical output coordinate reference size. More... | |
virtual Bool | SetOutCoord (Real x1, Real y1, Real x2, Real y2)=0 |
Set the button's output coordinate range. More... | |
virtual Bool | SetOutCoord1 (Real x1, Real y1)=0 |
Set the button's output coordinate start. More... | |
virtual Bool | SetOutCoord2 (Real x2, Real y2)=0 |
Set the button's output coordinate end. More... | |
virtual Bool | SetOutCoordX1 (Real x1)=0 |
Set the button's horizontal start output coordinate. More... | |
virtual Bool | SetOutCoordY1 (Real y1)=0 |
Set the button's vertical start output coordinates. More... | |
virtual Bool | SetOutCoordX2 (Real x2)=0 |
Set the button's horizontal end output coordinate. More... | |
virtual Bool | SetOutCoordY2 (Real y2)=0 |
Set the button's vertical end output coordinates. More... | |
virtual Real | GetOutCoordX1 () const =0 |
Get the button's horizontal start output coordinate. More... | |
virtual Real | GetOutCoordY1 () const =0 |
Get the button's vertical start output coordinate. More... | |
virtual Real | GetOutCoordX2 () const =0 |
Get the button's horizontal end output coordinate. More... | |
virtual Real | GetOutCoordY2 () const =0 |
Get the button's vertical end output coordinate. More... | |
virtual Bool | SetOutCoordClippingEnabled (Bool enable)=0 |
Enable or disable output coordinate clipping. More... | |
virtual Bool | IsOutCoordClippingEnabled () const =0 |
Check if output coordinate clipping is enabled. More... | |
virtual Bool | SetResponseButton (IEnums::MouseButton button)=0 |
Set the mouse button this button responds to. More... | |
virtual IEnums::MouseButton | GetResponseButton () const =0 |
Get the mouse button this button responds to. More... | |
virtual Bool | SetPassEventsEnabled (Bool enable)=0 |
Enable or disable event pass through. More... | |
virtual Bool | IsPassEventsEnabled () const =0 |
Check event pass through is enabled. More... | |
virtual Bool | SetMaxNumberOfEvents (UInt32 value)=0 |
Set the maximum number of simultaneous touch events. More... | |
virtual UInt32 | GetMaxNumberOfEvents () const =0 |
Get the maximum number of simultaneous touch events. More... | |
virtual Bool | ResetEvents ()=0 |
Reset the tracking of all current events. More... | |
virtual UInt32 | GetNumberOfActiveEvents () const =0 |
Get the total number of active events. More... | |
virtual UInt32 | GetActiveEventId (UInt32 activeEventIndex) const =0 |
Get the unique ID of a specific active event. More... | |
virtual UInt32 | GetNumberOfTrackedEvents () const =0 |
Get the number of currently tracked events. More... | |
virtual UInt32 | GetTrackedEventId (UInt32 trackedEventIndex) const =0 |
Get the unique ID of a specific tracked event. More... | |
virtual Bool | HasEventUpdate (UInt32 id) const =0 |
Check if a given event has received updates from any input device during the most recent logic tick. More... | |
virtual IEnums::InputDeviceType | GetEventDeviceType (UInt32 id) const =0 |
Get the type of input device that reported the event with a given ID. More... | |
virtual const Vector & | GetEventOutCoord (UInt32 id) const =0 |
Get the output coordinate of an event with a given ID, in 2D space. More... | |
virtual const Vector & | GetLocalEventPosition (UInt32 id) const =0 |
Get the position of an event with a given ID, in 3D object space. More... | |
virtual const Vector & | GetLocalEventDelta (UInt32 id) const =0 |
Get the current position delta of an event with a given ID, in object space. More... | |
virtual Bool | IsEventTracked (UInt32 id) const =0 |
Check if a given event is in the "tracked" state. More... | |
virtual Bool | IsEventInside (UInt32 id) const =0 |
Check if a given event's incidence point is within the button's bounds. More... | |
virtual Bool | IsEventPressed (UInt32 id) const =0 |
Check if a given event is in the pressed state. More... | |
virtual Bool | WasPressed () const =0 |
Check if the button was pressed. More... | |
virtual Bool | WasReleasedInside () const =0 |
Check if the button was released inside. More... | |
virtual Bool | WasReleasedOutside () const =0 |
Check if the button was released outside. More... | |
virtual const Vector & | GetEventPosition () const =0 |
Get the position of the current button event, in object space. More... | |
virtual IEnums::ButtonState | GetButtonState () const =0 |
Get the current button state. More... | |
Detailed Description
The ITouchable property interface.
This interface provides common properties of a touchable input object.
Member Function Documentation
◆ SetEnabled()
Enable or disable the button.
When the button is disabled, it is still being processed and drawn, but not reacting on any user input. To define the node that is active in the disabled state, use SetStateNodeId() or SetStateChildIndex() with IEnums::BUTTON_STATE_DISABLED.
- Parameters
-
enabled If false, the button gets disabled.
- Returns
- true if successful.
◆ IsEnabled()
|
pure virtual |
Check if the button is enabled.
- Returns
- true if enabled.
◆ SetActiveFaces()
|
pure virtual |
Set which faces of the button are active.
- Parameters
-
faces One of the available IEnums::PolygonFaces enumeration values.
- Returns
- true if successful.
◆ GetActiveFaces()
|
pure virtual |
Check which faces of the button are active.
- Returns
- One of the available IEnums::PolygonFaces enumeration values.
◆ SetOutCoordSize()
Set the output coordinate reference size.
Generally, output coordinates are represented by values ranging from -1.0 to 1.0. As a convenience, this method can be used to set an arbitrary reference size for both dimensions of the button; this way it is possible to specify integer (pixel) values instead of (quite unreadable) floats. By default, both sizeX and sizeY are set to 1.0. See also Graph::IPlaneGeometry::SetTextureSize() for a texture equivalent, and Graph::IFrameBuffer::SetInCoordSize() for the counterpart taking the button's out coordinates as input. Note that if it is desired to map button coordinates directly to texture coordinates e.g. for using a button on a frame buffer, it may be useful to call SetOutCoord()/SetOutCoordSize() and the frame buffer's SetInCoord()/SetInCoordSize() with values equivalent to the texture coordinate values of the plane displaying the frame buffer contents.
- Parameters
-
sizeX The horizontal coordinate reference size. sizeY The vertical coordinate reference size.
- Returns
- true if successful.
◆ SetOutCoordSizeX()
Set the horizontal output coordinate reference size.
See SetOutCoordSize().
- Parameters
-
sizeX The horizontal coordinate reference size.
- Returns
- true if successful.
◆ SetOutCoordSizeY()
Set the vertical output coordinate reference size.
See SetOutCoordSize().
- Parameters
-
sizeY The vertical coordinate reference size.
- Returns
- true if successful.
◆ GetOutCoordSizeX()
|
pure virtual |
Get the horizontal output coordinate reference size.
See SetOutCoordSize().
- Returns
- The horizontal output coordinate reference size.
◆ GetOutCoordSizeY()
|
pure virtual |
Get the vertical output coordinate reference size.
See SetOutCoordSize().
- Returns
- The vertical output coordinate reference size.
◆ SetOutCoord()
|
pure virtual |
Set the button's output coordinate range.
This method sets the button's start and end output coordinates. In contrast to a button event's local intersection point, which always represents the actual intersection in object-space 3D coordinates, an event's output coordinate represents a 2D intersection on the button's clickable surface. This can be interpreted analogously to a renderable geometry, with 3D vertex coordinates and 2D texture coordinates.
- Parameters
-
x1 The start coordinate in X direction. y1 The start coordinate in Y direction. x2 The end coordinate in X direction. y2 The end coordinate in Y direction.
- Returns
- true if successful.
◆ SetOutCoord1()
Set the button's output coordinate start.
See SetOutCoord().
- Parameters
-
x1 The start coordinate in X direction. y1 The start coordinate in Y direction.
- Returns
- true if successful.
◆ SetOutCoord2()
Set the button's output coordinate end.
See SetOutCoord().
- Parameters
-
x2 The end coordinate in X direction. y2 The end coordinate in Y direction.
- Returns
- true if successful.
◆ SetOutCoordX1()
Set the button's horizontal start output coordinate.
See SetOutCoord().
- Parameters
-
x1 The start coordinate in X direction.
- Returns
- true if successful.
◆ SetOutCoordY1()
Set the button's vertical start output coordinates.
See SetOutCoord().
- Parameters
-
y1 The start coordinate in Y direction.
- Returns
- true if successful.
◆ SetOutCoordX2()
Set the button's horizontal end output coordinate.
See SetOutCoord().
- Parameters
-
x2 The end coordinate in X direction.
- Returns
- true if successful.
◆ SetOutCoordY2()
Set the button's vertical end output coordinates.
See SetOutCoord().
- Parameters
-
y2 The end coordinate in Y direction.
- Returns
- true if successful.
◆ GetOutCoordX1()
|
pure virtual |
Get the button's horizontal start output coordinate.
See SetOutCoord().
- Returns
- The start coordinate in X direction.
◆ GetOutCoordY1()
|
pure virtual |
Get the button's vertical start output coordinate.
See SetOutCoord().
- Returns
- The start coordinate in Y direction.
◆ GetOutCoordX2()
|
pure virtual |
Get the button's horizontal end output coordinate.
See SetOutCoord().
- Returns
- The end coordinate in X direction.
◆ GetOutCoordY2()
|
pure virtual |
Get the button's vertical end output coordinate.
See SetOutCoord().
- Returns
- The end coordinate in Y direction.
◆ SetOutCoordClippingEnabled()
Enable or disable output coordinate clipping.
By default, clipping is disabled. If the button delegates its events to a given frame buffer (see GetFrameBufferNodeTarget()), this means that other buttons defined in the frame buffer also receive events even if they are actually outside this buttons range. Set enabled to true to restrict the frame buffer's input event area to this button's bounds.
- Parameters
-
enable If true, output coordinates are being clipped.
- Returns
- true if successful.
◆ IsOutCoordClippingEnabled()
|
pure virtual |
Check if output coordinate clipping is enabled.
- Returns
- true if enabled.
◆ SetResponseButton()
|
pure virtual |
Set the mouse button this button responds to.
- Parameters
-
button The mouse button used for input.
- Returns
- true if successful.
◆ GetResponseButton()
|
pure virtual |
Get the mouse button this button responds to.
- Returns
- The mouse button used for input.
◆ SetPassEventsEnabled()
Enable or disable event pass through.
- Parameters
-
enable If true events are passed through underlying buttons.
- Returns
- true if successful.
◆ IsPassEventsEnabled()
|
pure virtual |
Check event pass through is enabled.
- Returns
- true if events are passed through underlying buttons.
◆ SetMaxNumberOfEvents()
Set the maximum number of simultaneous touch events.
- Parameters
-
value The maximum number of touch events that are evaluated simultaneously.
- Returns
- true if successful.
◆ GetMaxNumberOfEvents()
|
pure virtual |
Get the maximum number of simultaneous touch events.
- Returns
- The maximum number of touch events that are evaluated simultaneously.
◆ ResetEvents()
|
pure virtual |
Reset the tracking of all current events.
Set the button state to IEnums::BUTTON_STATE_UP if enabled otherwise to IEnums::BUTTON_STATE_DISABLED.
- Returns
- true if successful.
◆ GetNumberOfActiveEvents()
|
pure virtual |
Get the total number of active events.
This method returns the total number of active input events, including any non-tracked events and events that are already in the "up" state. For mouse-like devices, this simply means move events without any button pressed. For touch screen-like devices, there is no actual move event in the "up" state, so any active event retains the state immediately before the finger was lifted.
- Returns
- The total number of active events.
◆ GetActiveEventId()
|
pure virtual |
Get the unique ID of a specific active event.
- Parameters
-
activeEventIndex The event's index, in the range from 0 to GetNumberOfActiveEvents() - 1.
- Returns
- The active event's ID.
◆ GetNumberOfTrackedEvents()
|
pure virtual |
Get the number of currently tracked events.
This method returns the number of currently tracked events, i.e. all those events that began with a "down" action inside the button's bounds.
- Returns
- The number of currently tracked events.
◆ GetTrackedEventId()
|
pure virtual |
Get the unique ID of a specific tracked event.
- Parameters
-
trackedEventIndex The event's index, in the range from 0 to GetNumberOfTrackedEvents() - 1.
- Returns
- The tracked event's ID.
◆ HasEventUpdate()
Check if a given event has received updates from any input device during the most recent logic tick.
Has to be considered when using GetLocalEventDelta().
- Parameters
-
id The ID of the event to query, retrieved from GetActiveEventId() or GetTrackedEventId().
- Returns
- true if the event has received updates.
◆ GetEventDeviceType()
|
pure virtual |
Get the type of input device that reported the event with a given ID.
- Parameters
-
id The ID of the event to query, retrieved from GetActiveEventId() or GetTrackedEventId().
- Returns
- The input device type.
◆ GetEventOutCoord()
Get the output coordinate of an event with a given ID, in 2D space.
- Parameters
-
id The ID of the event to query, retrieved from GetActiveEventId() or GetTrackedEventId().
- Returns
- A const reference to the event's current out coordinate.
◆ GetLocalEventPosition()
|
pure virtual |
Get the position of an event with a given ID, in 3D object space.
- Parameters
-
id The ID of the event to query, retrieved from GetActiveEventId() or GetTrackedEventId().
- Returns
- A const reference to the event's current local position.
◆ GetLocalEventDelta()
Get the current position delta of an event with a given ID, in object space.
If HasEventUpdate() returns false the delta is zero and should be ignored.
- Parameters
-
id The ID of the event to query, retrieved from GetActiveEventId() or GetTrackedEventId().
- Returns
- A const reference to the event's current local position delta.
◆ IsEventTracked()
Check if a given event is in the "tracked" state.
- Parameters
-
id The ID of the event to query, retrieved from GetActiveEventId() or GetTrackedEventId().
- Returns
- true if the event is currently tracked.
◆ IsEventInside()
Check if a given event's incidence point is within the button's bounds.
As an example, for a rectangular button (SetShape(IEnums::TOUCH_AREA_SHAPE_RECTANGLE)) without additional scale factor, this method returns true whenever the event's local X and Y coordinates are both in the range from -0.5 to +0.5.
- Parameters
-
id The ID of the event to query, retrieved from GetActiveEventId() or GetTrackedEventId().
- Returns
- true if the event is inside.
◆ IsEventPressed()
Check if a given event is in the pressed state.
- Parameters
-
id The ID of the event to query, retrieved from GetActiveEventId() or GetTrackedEventId().
- Returns
- true if the event is currently in the pressed state.
◆ WasPressed()
|
pure virtual |
Check if the button was pressed.
This method returns true when a "down" action occurred during the most recent logic tick at a coordinate within the button's bounds, and the button was not already in the "down" state.
- Returns
- true if the button was pressed.
◆ WasReleasedInside()
|
pure virtual |
Check if the button was released inside.
This method returns true when the button was actually released during the most recent logic tick, i.e. when first a "down" action occurred on that button, and later on the corresponding "up" action occurred at a coordinate within the button's bounds.
- Returns
- true if the button was clicked.
◆ WasReleasedOutside()
|
pure virtual |
Check if the button was released outside.
This method returns true when a pending click action on the button was actually dismissed during the most recent logic tick, i.e. when first a "down" action occurred on that button, and later on the corresponding "up" action occurred at a coordinate outside the button's bounds.
- Returns
- true if the button was released.
◆ GetEventPosition()
|
pure virtual |
Get the position of the current button event, in object space.
This method returns the current position of the last WasReleasedInside(), WasPressed() or WasReleased() event.
- Returns
- A const reference to the event's current local position.
◆ GetButtonState()
|
pure virtual |
Get the current button state.
- Returns
- The current button state.
The documentation for this interface was generated from the following file:
- murl_graph_i_touchable.h