com.annahid.libs.artenus.input
TouchEvent
Represents a touch event in the Artenus framework.
public class TouchEvent
Field Summary
| Modifier and Type | Field and Description |
|---|---|
public static final | EVENT_DOWNIndicates that a pressed gesture has just started. |
public static final | EVENT_LEAVEIndicates that a pressed gesture has finished outside the desired area. |
public static final | EVENT_MOVEIndicates that a change has happened during a press gesture (between
EVENT_UP and EVENT_DOWN). |
public static final | EVENT_UPIndicates that a pressed gesture has finished. |
Constructor Summary
| Modifier and Type | Constructor and Description |
|---|---|
public | TouchEvent(int action, int pointerId, float x, float y) Creates a new touch event. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
public int | getAction() Gets the action associated to this touch event. |
public int | getPointerId() Gets the pointer identifier associated with this touch event (for multi-touch systems). |
public float | getX() Gets the x coordinate of the touched or released point (depending on the action). |
public float | getY() 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, waitField 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:
|
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 |