Js binding方式下touch event的使用

关于js binding的文档还是太少,唯一的参考是引擎自带的sample code

最近用cocos2d-html5写了一个对对碰游戏做测试,做js binding的时候,发现在浏览器能正常工作的touch event在jsb方式下不生效,因为在jsb方式下,只有设置了touch mode为TOUCH_ONE_BY_ONE才会触发onTouchBegan函数, 否则会去调用onTouchsBegan, 请注意多了一个“s”

onEnter:function () {
      this._super();
      this.setTouchMode(cc.TOUCH_ONE_BY_ONE);
      this.setTouchEnabled(true);
    },

分享出来, 希望对大家有帮助。 {:soso_e113:}