Hi all,
I've integrated a Spine animation in Android using the monogame runtime.
For scaling, I've tried setting the scale factor in LoadContent() on the SkeletonJson object.
This works fine and does scale the animation, however this way the only chance I to scale the animation is when the content gets loaded.
I need a way to change the scale factor later in the lifecycle, I guess that would be in the Draw method from the Game() class that I'm overriding.
protected override void Draw(GameTime gameTime) {
graphics.GraphicsDevice.Clear(Color.White);
//if (ViewportHeight != 0 && ViewportWidth != 0) {
// float scaleFactor = ScaleFactor();
// state.Data.SkeletonData.Height *= scaleFactor;
// state.Data.SkeletonData.Width *= scaleFactor;
// skeleton.Data.Height *= scaleFactor;
// skeleton.Data.Width *= scaleFactor;
//}
state.Update(gameTime.ElapsedGameTime.Milliseconds / 1000f);
state.Apply(skeleton);
skeleton.UpdateWorldTransform();
skeletonRenderer.Begin();
skeletonRenderer.Draw(skeleton);
skeletonRenderer.End();
bounds.Update(skeleton, true);
base.Draw(gameTime);
}
In the comments you can see what I've tried to scale the animation, however with no effect.
Any help would be appreciated!
Thank you,
Christoph