if('touches' in cc.sys.capabilities)
{
var self = this;
cc.log("创建多点触控事件");
var listener = cc.EventListener.create({
event : cc.EventListener.TOUCH_ALL_AT_ONCE,
onTouchesBegan : self.onTouchBegan.bind(self),
onTouchesMoved : self.onTouchMoved.bind(self),
onTouchesEnded : self.onTouchEnded.bind(self)
});
cc.log("成功创建多点触控事件并且添加给当前页");
cc.eventManager.addListener(listener,self);
cc.log("成功添加给当前页");
}
else
{
cc.log("当前设备不支持多点触控")
}
},
onTouchBegan:function(touches,event)
{
cc.log("多点事件添加完成");
return true;
},
onTouchMoved:function(touches,event)
{
cc.log("多点触摸成功触发");
},
onTouchEnded:function(touches,event)
{
cc.log("多点触摸已结束");
},
事件可以成功的创建但是Began事件死活都触发不了