Class ElementGestureListener

java.lang.Object
arc.scene.event.ElementGestureListener
All Implemented Interfaces:
EventListener

public class ElementGestureListener extends 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, use ClickListener.
See Also:
  • Constructor Details

  • Method Details

    • handle

      public boolean handle(SceneEvent e)
      Description copied from interface: EventListener
      Try to handle the given event, if it is applicable.
      Specified by:
      handle in interface EventListener
      Returns:
      true if the event should be considered handled by scene2d.
    • touchDown

      public void touchDown(InputEvent event, float x, float y, int pointer, KeyCode button)
    • touchUp

      public void touchUp(InputEvent event, float x, float y, int pointer, KeyCode button)
    • tap

      public void tap(InputEvent event, float x, float y, int count, KeyCode button)
    • longPress

      public boolean longPress(Element 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, KeyCode 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.
    • zoom

      public void zoom(InputEvent event, float initialDistance, float distance)
    • pinch

      public void pinch(InputEvent event, Vec2 initialPointer1, Vec2 initialPointer2, Vec2 pointer1, Vec2 pointer2)
    • getGestureDetector

      public GestureDetector getGestureDetector()
    • getTouchDownTarget

      public Element getTouchDownTarget()