如何在PlayN应用程序中检测刷卡
我正在尝试在一个用PlayN和Tripleplay库开发的游戏中检测到一个滑动手势。 我使用tripleplay.手势软件包做了一些实验,但我不知道如何使用它。 有什么例子吗? 非常感谢。如何在PlayN应用程序中检测刷卡,playn,tripleplay,Playn,Tripleplay,我正在尝试在一个用PlayN和Tripleplay库开发的游戏中检测到一个滑动手势。 我使用tripleplay.手势软件包做了一些实验,但我不知道如何使用它。 有什么例子吗? 非常感谢。 乔瓦尼我找到了一个行之有效的解决方案。我希望它能对某些人有用(尽管我认为不幸的是,我们中很少有人还在使用PlayN) 还有比PlayN更好的选择吗? if (touch().hasTouch()) { platform().setPropagateEvents(true); final Sw
乔瓦尼我找到了一个行之有效的解决方案。我希望它能对某些人有用(尽管我认为不幸的是,我们中很少有人还在使用PlayN)
还有比PlayN更好的选择吗?
if (touch().hasTouch()) {
platform().setPropagateEvents(true);
final Swipe swipe = new Swipe(Gesture.Direction.LEFT);
swipe.completed().connect(new UnitSlot() {
@Override
public void onEmit() {
PlayN.log().info("Swipe");
UIController.getInstance().toggleScreen();
}
});
Touch.LayerListener tll = new GestureDirector(
new Rectangle(
0,
0,
layerWidth,
layerHeigth
), UIController.getTimer()).add(swipe);
layer.addListener(tll);
}