com.badlogic.gdx.input
Class GestureDetector
java.lang.Object
com.badlogic.gdx.InputAdapter
com.badlogic.gdx.input.GestureDetector
- All Implemented Interfaces:
- InputProcessor
public class GestureDetector
- extends InputAdapter
Method Summary |
boolean |
isLongPressed()
|
boolean |
isLongPressed(float duration)
|
boolean |
isPanning()
|
void |
reset()
|
boolean |
touchDown(int x,
int y,
int pointer,
int button)
Called when the screen was touched or a mouse button was pressed. |
boolean |
touchDragged(int x,
int y,
int pointer)
Called when a finger or the mouse was dragged. |
boolean |
touchUp(int x,
int y,
int pointer,
int button)
Called when a finger was lifted or a mouse button was released. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GestureDetector
public GestureDetector(GestureDetector.GestureListener listener)
GestureDetector
public GestureDetector(int halfTapSquareSize,
float tapCountInterval,
float longPressDuration,
float maxFlingDelay,
GestureDetector.GestureListener listener)
touchDown
public boolean touchDown(int x,
int y,
int pointer,
int button)
- Description copied from interface:
InputProcessor
- Called when the screen was touched or a mouse button was pressed. The button parameter will be
Input.Buttons.LEFT
on
Android.
- Specified by:
touchDown
in interface InputProcessor
- Overrides:
touchDown
in class InputAdapter
- Parameters:
x
- The x coordinate, origin is in the upper left cornery
- The y coordinate, origin is in the upper left cornerpointer
- the pointer for the event.button
- the button
- Returns:
- whether the input was processed
touchDragged
public boolean touchDragged(int x,
int y,
int pointer)
- Description copied from interface:
InputProcessor
- Called when a finger or the mouse was dragged.
- Specified by:
touchDragged
in interface InputProcessor
- Overrides:
touchDragged
in class InputAdapter
- Parameters:
x
- The x coordinatey
- The y coordinatepointer
- the pointer for the event.
- Returns:
- whether the input was processed
touchUp
public boolean touchUp(int x,
int y,
int pointer,
int button)
- Description copied from interface:
InputProcessor
- Called when a finger was lifted or a mouse button was released. The button parameter will be
Input.Buttons.LEFT
on
Android.
- Specified by:
touchUp
in interface InputProcessor
- Overrides:
touchUp
in class InputAdapter
- Parameters:
x
- The x coordinatey
- The y coordinatepointer
- the pointer for the event.button
- the button
- Returns:
- whether the input was processed
isLongPressed
public boolean isLongPressed()
- Returns:
- whether the user touched the screen long enough to trigger a long press event.
isLongPressed
public boolean isLongPressed(float duration)
- Parameters:
duration
-
- Returns:
- whether the user touched the screen for as much or more than the given duration.
isPanning
public boolean isPanning()
reset
public void reset()
Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)