I want to detect double taps in libgdx using the tap method of the GestureDetector. GestureListener class. I searched the Web for the last two days but I couldn't find an example of how to do it. I know that the method has a "count" variable but I don't know how to use it. Thanks in advance.
I believe that the accepted answer doesn't provide enough details, so here is a small code snippet with implementation:
public class DoubleTapDetector extends GestureDetector.GestureAdapter {
@Override
public boolean tap(float x, float y, int count, int button) {
if (count == 2) {
System.out.println("Double tap!");
return true;
}
return false;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With