怎样获取鼠标点击的位置,player的移动不对,萌新请帮忙

onLoad: function () {
var canvas = cc.find(‘Canvas’);
canvas.on(cc.Node.EventType.TOUCH_START, this.onTouchBegan, this);

},

onTouchBegan: function (event) {
//var scene = cc.director.getScene();
var touchLoc = event.touch.getLocation();
var moveDown = cc.moveTo(1, touchLoc.x, touchLoc.y).easing(cc.easeCubicActionOut());

    this.Player.runAction(moveDown);
},

可以看官方的 example-case 范例

var moveDown = cc.moveTo(1, touchLoc.x, touchLoc.y).easing(cc.easeCubicActionOut());

touchLoc.x, touchLoc.y这个比点击位置多了(480,320),我看了例子collider,不知道哪有问题

你可以看看 OnTouchInput 范例

不能通过moveto移动么

可以啊,你只要看他们的 X 跟 Y 的转换就行了,然后用 moveTo