Class ActorGestureListener
- java.lang.Object
-
- com.badlogic.gdx.scenes.scene2d.utils.ActorGestureListener
-
- All Implemented Interfaces:
EventListener
public class ActorGestureListener extends java.lang.Object implements EventListener
Detects tap, long press, fling, pan, zoom, and pinch gestures on an actor. If there is only a need to detect tap, useClickListener.- See Also:
GestureDetector
-
-
Constructor Summary
Constructors Constructor Description ActorGestureListener()ActorGestureListener(float halfTapSquareSize, float tapCountInterval, float longPressDuration, float maxFlingDelay)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfling(InputEvent event, float velocityX, float velocityY, int button)GestureDetectorgetGestureDetector()ActorgetTouchDownTarget()booleanhandle(Event e)Try to handle the given event, if it is applicable.booleanlongPress(Actor actor, float x, float y)If true is returned, additional gestures will not be triggered.voidpan(InputEvent event, float x, float y, float deltaX, float deltaY)The delta is the difference in stage coordinates since the last pan.voidpanStop(InputEvent event, float x, float y, int pointer, int button)voidpinch(InputEvent event, Vector2 initialPointer1, Vector2 initialPointer2, Vector2 pointer1, Vector2 pointer2)voidtap(InputEvent event, float x, float y, int count, int button)voidtouchDown(InputEvent event, float x, float y, int pointer, int button)voidtouchUp(InputEvent event, float x, float y, int pointer, int button)voidzoom(InputEvent event, float initialDistance, float distance)
-
-
-
Method Detail
-
handle
public boolean handle(Event e)
Description copied from interface:EventListenerTry to handle the given event, if it is applicable.- Specified by:
handlein interfaceEventListener- Returns:
- true if the event should be considered
handledby scene2d.
-
touchDown
public void touchDown(InputEvent event, float x, float y, int pointer, int button)
-
touchUp
public void touchUp(InputEvent event, float x, float y, int pointer, int button)
-
tap
public void tap(InputEvent event, float x, float y, int count, int button)
-
longPress
public boolean longPress(Actor actor, float x, float y)
If true is returned, additional gestures will not be triggered. No event is provided because this event is triggered by time passing, not by an InputEvent.
-
fling
public void fling(InputEvent event, float velocityX, float velocityY, int button)
-
pan
public void pan(InputEvent event, float x, float y, float deltaX, float deltaY)
The delta is the difference in stage coordinates since the last pan.
-
panStop
public void panStop(InputEvent event, float x, float y, int pointer, int button)
-
zoom
public void zoom(InputEvent event, float initialDistance, float distance)
-
pinch
public void pinch(InputEvent event, Vector2 initialPointer1, Vector2 initialPointer2, Vector2 pointer1, Vector2 pointer2)
-
getGestureDetector
public GestureDetector getGestureDetector()
-
-