libgdx API

com.badlogic.gdx.input
Class GestureDetector.GestureAdapter

java.lang.Object
  extended by com.badlogic.gdx.input.GestureDetector.GestureAdapter
All Implemented Interfaces:
GestureDetector.GestureListener
Enclosing class:
GestureDetector

public static class GestureDetector.GestureAdapter
extends java.lang.Object
implements GestureDetector.GestureListener

Derrive from this if you only want to implement a subset of GestureDetector.GestureListener.

Author:
mzechner

Constructor Summary
GestureDetector.GestureAdapter()
           
 
Method Summary
 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 pinch(Vector2 initialPointer1, Vector2 initialPointer2, Vector2 pointer1, Vector2 pointer2)
          Called when a user performs a pinch zoom gesture.
 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)
          Called when a finger went down on the screen or a mouse button was pressed.
 boolean zoom(float initialDistance, float distance)
          Called when the user performs a pinch zoom gesture.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GestureDetector.GestureAdapter

public GestureDetector.GestureAdapter()
Method Detail

touchDown

public boolean touchDown(float x,
                         float y,
                         int pointer,
                         int button)
Description copied from interface: GestureDetector.GestureListener
Called when a finger went down on the screen or a mouse button was pressed.

Specified by:
touchDown in interface GestureDetector.GestureListener

tap

public boolean tap(float x,
                   float y,
                   int count,
                   int button)
Description copied from interface: GestureDetector.GestureListener
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.

Specified by:
tap in interface GestureDetector.GestureListener
count - the number of taps.

longPress

public boolean longPress(float x,
                         float y)
Specified by:
longPress in interface GestureDetector.GestureListener

fling

public boolean fling(float velocityX,
                     float velocityY,
                     int button)
Description copied from interface: GestureDetector.GestureListener
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.

Specified by:
fling in interface GestureDetector.GestureListener
Parameters:
velocityX - velocity on x in seconds
velocityY - velocity on y in seconds

pan

public boolean pan(float x,
                   float y,
                   float deltaX,
                   float deltaY)
Description copied from interface: GestureDetector.GestureListener
Called when the user drags a finger over the screen.

Specified by:
pan in interface GestureDetector.GestureListener
deltaX - the difference in pixels to the last drag event on x.
deltaY - the difference in pixels to the last drag event on y.

zoom

public boolean zoom(float initialDistance,
                    float distance)
Description copied from interface: GestureDetector.GestureListener
Called when the user performs a pinch zoom gesture. The original distance is the distance in pixels when the gesture started.

Specified by:
zoom in interface GestureDetector.GestureListener
Parameters:
initialDistance - distance between fingers when the gesture started.
distance - current distance between fingers.

pinch

public boolean pinch(Vector2 initialPointer1,
                     Vector2 initialPointer2,
                     Vector2 pointer1,
                     Vector2 pointer2)
Description copied from interface: GestureDetector.GestureListener
Called when a user performs a pinch zoom gesture. Reports the initial positions of the two involved fingers and their current positions.

Specified by:
pinch in interface GestureDetector.GestureListener

libgdx API

Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)