this.head=new cc.DrawNode();
this.addChild(this.head,10);
this.head.drawDot(cc.p(size.width / 2, 50), 10, cc.color(0, 0, 0));
...
addTouch:function(){
this.touchListener = cc.EventListener.create({
event: cc.EventListener.TOUCH_ONE_BY_ONE,
swallowTouches: true,
onTouchBegan: function (touch, event) {
var pos = touch.getLocation();
var target=event.getCurrentTarget();
cc.log(target.x,target..y);
return true;
}
});
cc.eventManager.addListener(this.touchListener,this.head);
}
我想给那个head圆点绑定touch事件,可是按输出的结果,target获取到的一直是(0,0)
怎么样可以实现绑定到head呢??