放到微信调试没任何反应,这是为什么
cc.Class({
extends: cc.Component,
properties: {
userIcon: {
default: null,
type: cc.Sprite.Type.SIMPLE,
}
},
onLoad: function () {
var that=this.userIcon;
var remoteUrl = "http://seo.xxx.cn/AuthCode.aspx";
cc.loader.load({url: remoteUrl, type: 'png'}, function (err, texture) {
that.spriteFrame.setTexture(texture);
console.log("done");
});
cc.eventManager.addListener(ToEvaOnClickListener.clone(), that);
},
update: function (dt) {
},
});
var ToEvaOnClickListener = cc.EventListener.create({
event: cc.EventListener.TOUCH_ONE_BY_ONE,
swallowTouches: true,
onTouchBegan: function (touch, event) {
cc.log(“began”);
},
onTouchMoved: function (touch, event) { //实现onTouchMoved事件处理回调函数, 触摸移动时触发
cc.log("");
},
onTouchEnded: function (touch, event) { // 实现onTouchEnded事件处理回调函数
cc.log("sprite onTouchesEnded… ");
}
});