public static interface GestureDetector.GestureListener
GestureDetector
to receive gestures such as taps, long presses, flings,
panning or pinch zooming. Each method returns a boolean indicating if the event should be handed to the next listener (false
to hand it to the next listener, true otherwise).Modifier and Type | Method and Description |
---|---|
boolean |
fling(float velocityX,
float velocityY,
int button)
Called when the user dragged a finger over the screen and lifted it.
|
boolean |
longPress(float x,
float y) |
boolean |
pan(float x,
float y,
float deltaX,
float deltaY)
Called when the user drags a finger over the screen.
|
boolean |
panStop(float x,
float y,
int pointer,
int button)
Called when no longer panning.
|
boolean |
pinch(Vector2 initialPointer1,
Vector2 initialPointer2,
Vector2 pointer1,
Vector2 pointer2)
Called when a user performs a pinch zoom gesture.
|
boolean |
tap(float x,
float y,
int count,
int button)
Called when a tap occured.
|
boolean |
touchDown(float x,
float y,
int pointer,
int button) |
boolean |
zoom(float initialDistance,
float distance)
Called when the user performs a pinch zoom gesture.
|
boolean touchDown(float x, float y, int pointer, int button)
boolean tap(float x, float y, int count, int button)
GestureDetector
.count
- the number of taps.boolean longPress(float x, float y)
boolean fling(float velocityX, float velocityY, int button)
velocityX
- velocity on x in secondsvelocityY
- velocity on y in secondsboolean pan(float x, float y, float deltaX, float deltaY)
deltaX
- the difference in pixels to the last drag event on x.deltaY
- the difference in pixels to the last drag event on y.boolean panStop(float x, float y, int pointer, int button)
boolean zoom(float initialDistance, float distance)
initialDistance
- distance between fingers when the gesture started.distance
- current distance between fingers.boolean pinch(Vector2 initialPointer1, Vector2 initialPointer2, Vector2 pointer1, Vector2 pointer2)
initialPointer1
- initialPointer2
- pointer1
- pointer2
- Copyright © 2015. All rights reserved.