There are no examples for Monogame for 4.0 so I am not sure if I am missing something. Both runtimes were updated, spine-xna and spine-csharp up to 4.0
On LoadContent, loading everything:
logoAnimation = content.Load<SpineAsset>("Logo");
logoAnimation.SetAnimation(0, logoAnimation.SkeletonData.Animations.Items[0].Name, true);
logoAnimation.SetBasePosition(new Vector2(70, 100));
logoAnimation.SetActualPosition(new Vector2(70, 100));
logoAnimation.Skeleton.X += 70;
logoAnimation.Skeleton.Y += 100;
logoAnimation.Skeleton.UpdateWorldTransform();
On Update, I set the current scale and update the position if needed:logoAnimation.SetAnimation(0, logoAnimation.SkeletonData.Animations.Items[0].Name, true);
logoAnimation.SetBasePosition(new Vector2(70, 100));
logoAnimation.SetActualPosition(new Vector2(70, 100));
logoAnimation.Skeleton.X += 70;
logoAnimation.Skeleton.Y += 100;
logoAnimation.Skeleton.UpdateWorldTransform();
logoAnimation.SetScale(screenScale);
logoAnimation.UpdatePosition(screenScale);
logoAnimation.UpdateRoutine(gameTime);
logoAnimation.UpdatePosition(screenScale);
logoAnimation.UpdateRoutine(gameTime);
public void UpdateRoutine(GameTime gameTime)
{
AnimationState.Update(gameTime.ElapsedGameTime.Milliseconds / 1000f);
AnimationState.Apply(Skeleton);
Skeleton.UpdateWorldTransform();
}
OnDraw, I render the skeleton:{
AnimationState.Update(gameTime.ElapsedGameTime.Milliseconds / 1000f);
AnimationState.Apply(Skeleton);
Skeleton.UpdateWorldTransform();
}
skeletonRenderer.Begin();
skeletonRenderer.Draw(logoAnimation.Skeleton);
skeletonRenderer.End();
skeletonRenderer is properly initialized. Did anything change when rendering the animations?skeletonRenderer.Draw(logoAnimation.Skeleton);
skeletonRenderer.End();