cocos creator怎么获取触摸点坐标 50
setInputControl:function(){//addkeyboardinputlistenertojump,turnLeftandturnRightcc.ev...
setInputControl: function () {
//add keyboard input listener to jump, turnLeft and turnRight
cc.eventManager.addListener({
event: cc.EventListener.TOUCH_ONE_BY_ONE,
onTouchBegan: function (touches, event) {
console.log('Touch Began: ' + event + getLocationX);
return true;
},
onTouchMoved: function (touches, event) {
console.log('Touch Moved: ' + event);
},
onTouchEnded: function (touches, event) {
console.log('Touch Ended: ' + event);
}
}, this.node);
},
这样可以在触摸的时候在控制台上打印出字,那怎么在打印那里输入触点坐标呢 展开
//add keyboard input listener to jump, turnLeft and turnRight
cc.eventManager.addListener({
event: cc.EventListener.TOUCH_ONE_BY_ONE,
onTouchBegan: function (touches, event) {
console.log('Touch Began: ' + event + getLocationX);
return true;
},
onTouchMoved: function (touches, event) {
console.log('Touch Moved: ' + event);
},
onTouchEnded: function (touches, event) {
console.log('Touch Ended: ' + event);
}
}, this.node);
},
这样可以在触摸的时候在控制台上打印出字,那怎么在打印那里输入触点坐标呢 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询