无名氏 随便举个栗子this.bgImage = new Laya.Image("../laya/assets/comp/bg.jpg")然后怎么获取那张图片的大小?试了很多方法,也一顿搜索,但是没有答案
何小威 Laya.loader.load('[size=14]../laya/assets/comp/bg.jpg[/size]',Laya.Handler.create(this,()=>{ this.bgImage = Laya.loader.getRes('[size=14]../laya/assets/comp/bg.jpg[/size]'); console.log([this.bgImage.width,this.bgImage.height]); }));