Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在PlayN应用程序中检测刷卡_Playn_Tripleplay - Fatal编程技术网

如何在PlayN应用程序中检测刷卡

如何在PlayN应用程序中检测刷卡,playn,tripleplay,Playn,Tripleplay,我正在尝试在一个用PlayN和Tripleplay库开发的游戏中检测到一个滑动手势。 我使用tripleplay.手势软件包做了一些实验,但我不知道如何使用它。 有什么例子吗? 非常感谢。 乔瓦尼我找到了一个行之有效的解决方案。我希望它能对某些人有用(尽管我认为不幸的是,我们中很少有人还在使用PlayN) 还有比PlayN更好的选择吗? if (touch().hasTouch()) { platform().setPropagateEvents(true); final Sw

我正在尝试在一个用PlayN和Tripleplay库开发的游戏中检测到一个滑动手势。 我使用tripleplay.手势软件包做了一些实验,但我不知道如何使用它。 有什么例子吗? 非常感谢。
乔瓦尼

我找到了一个行之有效的解决方案。我希望它能对某些人有用(尽管我认为不幸的是,我们中很少有人还在使用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);
}