var scrollLayer = new ccui.ScrollView();
scrollLayer.setDirection(ccui.ScrollView.DIR_BOTH);
scrollLayer.setTouchEnabled(true);
scrollLayer.setContentSize(cc.size(1366, 768));
scrollLayer.setInnerContainerSize(cc.size(3840, 2160-16));
scrollLayer.x = 0;
scrollLayer.y = 0;
this.m_oObjBuildingLayer = homeMapLayer.create(this,scrollLayer);
scrollLayer.addChild(this.m_oObjBuildingLayer);
//
this.Widget.addChild(scrollLayer,-1);var tLayer = new cc.Layer();
tLayer.setPosition(cc.p(0,0));
tLayer.setContentSize(cc.size(1366,768));
//tLayer.setTouchEnabled(true);
cc.eventManager.addListener({
event: cc.EventListener.TOUCH_ALL_AT_ONCE,
swallowTouches: false,
onTouchesBegan: function(t,e){
cc.log(“oooooooooo”);
return true;
},
onTouchesMoved: function(t,e){
cc.log(“move move”);
}}, tLayer);
this.Widget.addChild(tLayer,1000);添加在同一个用cocostudio 做的UI界面上,但就是无法响应多点触摸事件。。。。求解答
TOUCH_ALL_AT_ONCE 就是 如果有多个手指同时触摸, 只触发一次点击事件,处理事件的时候,通过一个touch数组来表示每个点的触摸位置
TOUCH_ONE_BY_ONE 就是 如果有多个手指同时触摸, 触发多次点击事件,每次处理一个触摸位置。
你用的是第一个