[]获取Sprite位置问题

class Plant extends Laya.Sprite
{
public body :Laya.Animation;
constructor(){
super();
this.body = new Laya.Animation();
Laya.Animation.createFrames(["res/war/hero_fly1.png","res/war/hero_fly2.png"],"fly");
this.addChild(this.body);
this.body.play(0,true,"fly");
//获取动画大小区域
var bound:Laya.Rectangle = this.body.getBounds(); 
//this.pos(100,0);
console.log(-bound.width/2 + " --- "+ -bound.height/2);

onPlayComplete():void{ 
}
}
请问为啥bound.width bound.heigh这是0?
已邀请:

Laya_XSN

赞同来自: 流星win

你要在animation对象的Event的loaded事件后在getbounds获取,宽高信息即可!

要回复问题请先

商务合作
商务合作