简单的添加了一下touch事件,其他代码都没写,怎么都找不出原因,谁能指导一下吗
下面是完整代码,和响应的截图
cc.Class({
extends: cc.Component,
properties: {
label: {
default: null,
type: cc.Label
},
// defaults, set visually when attaching this script to the Canvas
text: 'Hello, World!'
},
// use this for initialization
onLoad: function () {
this.label.string = this.text;
this.label.node.on(cc.Node.EventType.TOUCH_START, function ( event ) {
cc.log(event);
}, this.label);
this.label.node.on(cc.Node.EventType.TOUCH_END, function ( event ) {
cc.log(event);
}, this.label);
},
// called every frame
update: function (dt) {
},
});
