public class GGTouch
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
click
Pressed and released in a quick sequence.
|
static int |
doubleClick
Pressed, released, pressed, released in a quick sequence.
|
static int |
drag
Pressed followed by a move
(for touch listeners, press must be inside touch area)
|
static int |
idle
No touch event occured.
|
static int |
longPress
Pressed a long time.
|
static int |
press
Screen pressed (touched).
|
static int |
release
Screen released.
|
Modifier and Type | Method and Description |
---|---|
static GGTouch |
create()
Creates a GGTouch instance with default values for the instance variables.
|
static GGTouch |
create(GGTouchListener listener,
int evt,
int x,
int y)
Creates a GGTouch instance with given values for the instance variables.
|
int |
getEvent()
Retrieves the current event type as integer.
|
java.lang.String |
getEventType()
Returns the event type as string.
|
GGTouchListener |
getSource()
Retrieves the GGTouchListener reference that created the event.
|
int |
getX()
Retrieves the current x-coordinate of the touch position
with respect to the upper left vertex of the visible area in pixels.
|
int |
getY()
Retrieves the current x-coordinate of the touch position
with respect to the upper left vertex of the visible area in pixels.
|
public static final int idle
public static final int press
public static final int release
public static final int click
public static final int doubleClick
public static final int drag
public static final int longPress
public static GGTouch create()
public static GGTouch create(GGTouchListener listener, int evt, int x, int y)
listener
- the listener instances that created the eventevt
- the event type (an or-combination of the predefined constants)x
- the x-coordinate where the event occurred (pixel coordinates
relative to the upper-left vertext of the game grid window)y
- the y-coordinate where the event occurred (pixel coordinates
relative to the upper-left vertext of the game grid window)public GGTouchListener getSource()
public int getEvent()
public int getX()
public int getY()
public java.lang.String getEventType()