[libgdx] Pose the skeleton for FboTest.

This commit is contained in:
Nathan Sweet 2025-05-31 12:42:38 -04:00
parent a2547097c2
commit 4db43da678

View File

@ -42,6 +42,8 @@ import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.graphics.glutils.FrameBuffer;
import com.badlogic.gdx.utils.ScreenUtils;
import com.esotericsoftware.spine.Animation.MixBlend;
import com.esotericsoftware.spine.Animation.MixDirection;
import com.esotericsoftware.spine.utils.TwoColorPolygonBatch;
/** Demonstrates rendering an animation to a frame buffer (FBO) and then rendering the FBO to the screen. */
@ -75,6 +77,12 @@ public class FboTest extends ApplicationAdapter {
// Create a skeleton instance, set the position of its root bone, and update its world transform.
skeleton = new Skeleton(skeletonData);
skeleton.setPosition(250, 20);
// Apply the pose for the first frame of the run animation.
Animation animation = skeleton.getData().findAnimation("run");
animation.apply(skeleton, -1, 0, true, null, 1, MixBlend.first, MixDirection.in, false);
// Compute the world transform for the pose.
skeleton.updateWorldTransform(Physics.update);
// Create an FBO and a texture region with Y flipped.