[]代码创建精灵监听不到事件?
var boxstr = "ui/buildsmall.png";
var box = new Laya.Sprite();
var texture = Laya.loader.getRes(boxstr);
box.graphics.drawTexture(texture);
var arr = {data: StorageRoom.map_storageData[0][0],tag:0};
box.on(Laya.Event.MOUSE_UP,this,this.onclick,[arr]);
var _proto = StorageUILayer.prototype;
_proto.onclick = function(params){
console.log("--------------------------------hhhhhhhhhhh- ");
}
----------------------------------------------------------
麻烦看下,这个为何监听不到点击的事件呢?会是什么原因可能导致监听不到的?很奇怪。。如果在ui里加载好的就可以。。
没有找到相关结果
已邀请:
要回复问题请先登录
3 个回复
ymsdandan
赞同来自:
wudi199553
赞同来自:
abczhaooooo
赞同来自: