Artenus 2D Framework
Artenus Reference
Represents a touch event in the Artenus framework.
public class TouchEvent

Field Summary

Modifier and TypeField and Description
public static final EVENT_DOWN
Indicates that a pressed gesture has just started.
public static final EVENT_LEAVE
Indicates that a pressed gesture has finished outside the desired area.
public static final EVENT_MOVE
Indicates that a change has happened during a press gesture (between EVENT_UP and EVENT_DOWN).
public static final EVENT_UP
Indicates that a pressed gesture has finished.

Constructor Summary

Modifier and TypeConstructor and Description
public TouchEvent(int action, int pointerId, float x, float y)
Creates a new touch event.

Method Summary

Modifier and TypeMethod and Description
public intgetAction()
Gets the action associated to this touch event.
public intgetPointerId()
Gets the pointer identifier associated with this touch event (for multi-touch systems).
public floatgetX()
Gets the x coordinate of the touched or released point (depending on the action).
public floatgetY()
Gets the y coordinate of the touched or released point (depending on the action).

Methods inherited from java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

EVENT_DOWN
public static final EVENT_DOWN
Indicates that a pressed gesture has just started.
EVENT_LEAVE
public static final EVENT_LEAVE
Indicates that a pressed gesture has finished outside the desired area. This value is used internally to signal touch buttons when the touch sequence is finished and they should cancel the button press event.
EVENT_MOVE
public static final EVENT_MOVE
Indicates that a change has happened during a press gesture (between EVENT_UP and EVENT_DOWN).
EVENT_UP
public static final EVENT_UP
Indicates that a pressed gesture has finished.

Constructor Detail

TouchEvent
public  TouchEvent(
    int action,
    int pointerId,
    float x,
    float y
)
Creates a new touch event.
Parameters:
actionAction type, which can be one of EVENT_DOWN, EVENT_MOVE, EVENT_UP, or EVENT_LEAVE
pointerIdThe pointer identifier associated with this touch event
xThe x coordinate of the touched or released point
yThe y coordinate of the touched or released point

Method Detail

getAction
public int getAction()
Gets the action associated to this touch event.
Returns:
getPointerId
public int getPointerId()
Gets the pointer identifier associated with this touch event (for multi-touch systems).
Returns:
The pointer identifier
getX
public float getX()
Gets the x coordinate of the touched or released point (depending on the action).
Returns:
The x coordinate
getY
public float getY()
Gets the y coordinate of the touched or released point (depending on the action).
Returns:
The y coordinate