spine动画getBoundingBox获取size不准

来源:互联网 发布:ヒビカセ动作数据 编辑:程序博客网 时间:2024/05/01 20:15
local person = sp.SkeletonAnimation:create(pathJson, pathAtlas, 1)
monster:setAnimation(0, “antionName”, true)

print("monster:getBoundingBox().width")

这样你会得到这样一个数:1.1754943508223e-038

解决方法:

在获取boundingBox之前调用update函数

 monster:update(0)

 print("monster:getBoundingBox().width")

OK~

0 0