[]父容器为何不响应鼠标事件
源码如下:
let son:Laya.Sprite = new Laya.Sprite()
let father:Laya.Sprite = new Laya.Sprite()
son.loadImage("res/me.png",0,0,30,30)
father.addChild(son)
Laya.stage.addChild(father)
father.x = 100;
father.y = 100;
father.on(Laya.Event.CLICK,this,this.onTestClick)
然而点击后onTestClick()根本不响应,如果改成son.on(...)倒是可以,该怎么解决呢?
let son:Laya.Sprite = new Laya.Sprite()
let father:Laya.Sprite = new Laya.Sprite()
son.loadImage("res/me.png",0,0,30,30)
father.addChild(son)
Laya.stage.addChild(father)
father.x = 100;
father.y = 100;
father.on(Laya.Event.CLICK,this,this.onTestClick)
然而点击后onTestClick()根本不响应,如果改成son.on(...)倒是可以,该怎么解决呢?
要回复问题请先登录
1 个回复
大光电KID
赞同来自: