coco2d-js 触摸移动的同时处理点击事件

        cc.eventManager.addListener({
            event: cc.EventListener.TOUCH_ALL_AT_ONCE,
            onTouchesMoved:function (touches, event) {
                for (var i = 0; i < touches.length; i++) {
                    jslog("touches:", i, touches[i].getLocation().x, touches[i].getLocation().y);
                }
            },
            onTouchBegan:function (touches, event) {
                jslog("click", touches[0].getLocation().x, touches[0].getLocation().y);
            }
        }, this);
 
     如果把onTouchesMovied和onTouchesEnded放到不同的类中监听,则可以实现移动和点击不互相影响。
原文地址:https://www.cnblogs.com/kenkofox/p/3919977.html