Package com.badlogic.gdx.input
Class GestureDetector.GestureAdapter
- java.lang.Object
-
- com.badlogic.gdx.input.GestureDetector.GestureAdapter
-
- All Implemented Interfaces:
GestureDetector.GestureListener
- Direct Known Subclasses:
CameraInputController.CameraGestureListener
- Enclosing class:
- GestureDetector
public static class GestureDetector.GestureAdapter extends java.lang.Object implements GestureDetector.GestureListener
Derrive from this if you only want to implement a subset ofGestureDetector.GestureListener
.
-
-
Constructor Summary
Constructors Constructor Description GestureAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.void
pinchStop()
Called when no longer pinching.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.
-
-
-
Method Detail
-
touchDown
public boolean touchDown(float x, float y, int pointer, int button)
- Specified by:
touchDown
in interfaceGestureDetector.GestureListener
- See Also:
InputProcessor.touchDown(int, int, int, int)
-
tap
public boolean tap(float x, float y, int count, int button)
Description copied from interface:GestureDetector.GestureListener
Called when a tap occured. A tap happens if a touch went down on the screen and was lifted again without moving outside of the tap square. The tap square is a rectangular area around the initial touch position as specified on construction time of theGestureDetector
.- Specified by:
tap
in interfaceGestureDetector.GestureListener
count
- the number of taps.
-
longPress
public boolean longPress(float x, float y)
- Specified by:
longPress
in interfaceGestureDetector.GestureListener
-
fling
public boolean fling(float velocityX, float velocityY, int button)
Description copied from interface:GestureDetector.GestureListener
Called when the user dragged a finger over the screen and lifted it. Reports the last known velocity of the finger in pixels per second.- Specified by:
fling
in interfaceGestureDetector.GestureListener
- Parameters:
velocityX
- velocity on x in secondsvelocityY
- velocity on y in seconds
-
pan
public boolean pan(float x, float y, float deltaX, float deltaY)
Description copied from interface:GestureDetector.GestureListener
Called when the user drags a finger over the screen.- Specified by:
pan
in interfaceGestureDetector.GestureListener
deltaX
- the difference in pixels to the last drag event on x.deltaY
- the difference in pixels to the last drag event on y.
-
panStop
public boolean panStop(float x, float y, int pointer, int button)
Description copied from interface:GestureDetector.GestureListener
Called when no longer panning.- Specified by:
panStop
in interfaceGestureDetector.GestureListener
-
zoom
public boolean zoom(float initialDistance, float distance)
Description copied from interface:GestureDetector.GestureListener
Called when the user performs a pinch zoom gesture. The original distance is the distance in pixels when the gesture started.- Specified by:
zoom
in interfaceGestureDetector.GestureListener
- Parameters:
initialDistance
- distance between fingers when the gesture started.distance
- current distance between fingers.
-
pinch
public boolean pinch(Vector2 initialPointer1, Vector2 initialPointer2, Vector2 pointer1, Vector2 pointer2)
Description copied from interface:GestureDetector.GestureListener
Called when a user performs a pinch zoom gesture. Reports the initial positions of the two involved fingers and their current positions.- Specified by:
pinch
in interfaceGestureDetector.GestureListener
-
pinchStop
public void pinchStop()
Description copied from interface:GestureDetector.GestureListener
Called when no longer pinching.- Specified by:
pinchStop
in interfaceGestureDetector.GestureListener
-
-