Class 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, use ClickListener.
    See Also:
    GestureDetector
    • Method Detail

      • handle

        public boolean handle​(Event 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,
                              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)
      • getTouchDownTarget

        @Null
        public Actor getTouchDownTarget()