Hello!
I am currently replacing UIs static elements with animated elements. For exemple I am replacing Scene2D.Image with a custom Scene2D.Widget using skeleton and animated State.
But I can't figure out how to get skeletal width/height like I did with image. I though I could do that with SkeletalBounds, but the result are strange, or at least I do not understand it.
In the constructor of my custom widget id do the following;
mAnimationState = new AnimationState(new AnimationStateData(Assets.ninjaHeadsSkeletonData));
mSkeleton = new Skeleton(Assets.ninjaHeadsSkeletonData);
mSkeleton.setToSetupPose();
mAnimationState.setAnimation(0, ANIMATION_IDLE, false);
mAnimationState.apply(mSkeleton);
mSkeleton.updateWorldTransform();
mSkeletonBounds = new SkeletonBounds();
mSkeletonBounds.update(mSkeleton, true); //I tried with false as well
Then I try to retrieve width and height with the following code:
public float getWidth() {
return mSkeletonBounds.getWidth();
}
public float getHeight() {
return mSkeletonBounds.getHeight();
}
Can someone point out what I am doing wrong?