Package arc.scene.event
Class ElementGestureListener
java.lang.Object
arc.scene.event.ElementGestureListener
- All Implemented Interfaces:
EventListener
Detects tap, long press, fling, pan, zoom, and pinch gestures on an actor. If there is only a need to detect tap, use
ClickListener
.- See Also:
-
Constructor Summary
ConstructorDescriptionElementGestureListener
(float halfTapSquareSize, float tapCountInterval, float longPressDuration, float maxFlingDelay) -
Method Summary
Modifier and TypeMethodDescriptionvoid
fling
(InputEvent event, float velocityX, float velocityY, KeyCode button) boolean
handle
(SceneEvent e) Try to handle the given event, if it is applicable.boolean
If true is returned, additional gestures will not be triggered.void
pan
(InputEvent event, float x, float y, float deltaX, float deltaY) The delta is the difference in stage coordinates since the last pan.void
void
tap
(InputEvent event, float x, float y, int count, KeyCode button) void
touchDown
(InputEvent event, float x, float y, int pointer, KeyCode button) void
touchUp
(InputEvent event, float x, float y, int pointer, KeyCode button) void
zoom
(InputEvent event, float initialDistance, float distance)
-
Constructor Details
-
ElementGestureListener
public ElementGestureListener() -
ElementGestureListener
public ElementGestureListener(float halfTapSquareSize, float tapCountInterval, float longPressDuration, float maxFlingDelay)
-
-
Method Details
-
handle
Description copied from interface:EventListener
Try to handle the given event, if it is applicable.- Specified by:
handle
in interfaceEventListener
- Returns:
- true if the event should be considered
handled
by scene2d.
-
touchDown
-
touchUp
-
tap
-
longPress
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
-
pan
The delta is the difference in stage coordinates since the last pan. -
zoom
-
pinch
public void pinch(InputEvent event, Vec2 initialPointer1, Vec2 initialPointer2, Vec2 pointer1, Vec2 pointer2) -
getGestureDetector
-
getTouchDownTarget
-