[]sprite 添加点击事件没反应,对sprite设置了size也没用


6MLJ6H2@WO_2_ELSEYA}@Q.png

 
已邀请:

jiehao

赞同来自:

this.btn.graphics.drawTexture(window.music.btn_on) ;
this.btn.pivot(75/2 , 75/2) ;
this.btn.x = window.client_width - 25 ;
this.btn.y = 25 ;
this.btn.scaleX = 25 / 75 ; this.btn.scaleY = 25 / 75 ;
Laya.stage.addChild(this.btn) ;
this.btn.size(25,25) ;
this.btn.on(Laya.Event.CLICK, this, music.music_voice_toggle);
代码是这样的 , 图片上传不了,代码直接贴上来

cuixueying

赞同来自:

最好上传个能重现问题的Demo,只看代码不好重现问题,谢谢!

jiehao

赞同来自:

你太客气了 ,麻烦你了

cuixueying

赞同来自:

555.png

按照上面的格式改下即可!

要回复问题请先

商务合作
商务合作