【发布时间】:2016-06-02 05:31:57
【问题描述】:
我正在使用 LibGDX 开发游戏,但无法从 pan 中确定 fling。
我的GestureListener:
@Override
public boolean fling(float velocityX, float velocityY, int button) {
//if (velocityX > 1000f) {
// I can use this to exclude slow pans from the executing a fling
System.out.println("Flinged - velocityX: " + velocityX + ", button: " + button);
//}
return false;
}
@Override
public boolean pan(float x, float y, float deltaX, float deltaY) {
// but there doesn't seem to be a way to have this not fire on a fling
System.out.println("Panned - deltaX: " + deltaX);
return false;
}
@Override
public boolean panStop(float x, float y, int pointer, int button) {
System.out.println("Pan Stop - pointer: " + pointer + ", button: " + button);
return false;
}
问题是如果pan 和fling 都着火了。我知道fling 基本上是一个快速的pan,但我需要能够确定这两个手势之间的关系,以便我可以分别处理每个手势。
一种简洁的提问方式是,我如何为fling 和pan 提供独特的操作?
【问题讨论】:
标签: libgdx gestures pan onfling