Interface GestureDetector.GestureListener

    • Method Summary

      All Methods Instance Methods Abstract 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

      • tap

        boolean tap​(float x,
                    float y,
                    int count,
                    int button)
        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 the GestureDetector.
        Parameters:
        count - the number of taps.
      • longPress

        boolean longPress​(float x,
                          float y)
      • fling

        boolean fling​(float velocityX,
                      float velocityY,
                      int button)
        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.
        Parameters:
        velocityX - velocity on x in seconds
        velocityY - velocity on y in seconds
      • pan

        boolean pan​(float x,
                    float y,
                    float deltaX,
                    float deltaY)
        Called when the user drags a finger over the screen.
        Parameters:
        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

        boolean panStop​(float x,
                        float y,
                        int pointer,
                        int button)
        Called when no longer panning.
      • zoom

        boolean zoom​(float initialDistance,
                     float distance)
        Called when the user performs a pinch zoom gesture. The original distance is the distance in pixels when the gesture started.
        Parameters:
        initialDistance - distance between fingers when the gesture started.
        distance - current distance between fingers.
      • pinch

        boolean pinch​(Vector2 initialPointer1,
                      Vector2 initialPointer2,
                      Vector2 pointer1,
                      Vector2 pointer2)
        Called when a user performs a pinch zoom gesture. Reports the initial positions of the two involved fingers and their current positions.
        Parameters:
        initialPointer1 -
        initialPointer2 -
        pointer1 -
        pointer2 -
      • pinchStop

        void pinchStop()
        Called when no longer pinching.