cocos2d-JS 点击事件侦听

 
  
var _touchListener = cc.EventListener.create({
    event: cc.EventListener.TOUCH_ONE_BY_ONE,
    swallowTouches: true,     //吞没机制
    onTouchBegan: function(touch,event){
        return true;
    },
 onTouchMove: function(touch,event){
        return true;
    },

    onTouchEnded:function(touch,event){
       return true;
    }
});
cc.eventManager.addListener(_touchListener, this);


你可能感兴趣的:(js)