From b8d9203ef666e2dc1c08f50e606ea655f70f4595 Mon Sep 17 00:00:00 2001 From: Wolfgang Schreurs Date: Sun, 2 Mar 2025 09:58:21 +0700 Subject: [PATCH] Set initial frame when animation is changed (#976) Co-authored-by: Wolf --- source/MonoGame.Extended/Graphics/AnimatedSprite.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/MonoGame.Extended/Graphics/AnimatedSprite.cs b/source/MonoGame.Extended/Graphics/AnimatedSprite.cs index a23e0d80..895ef43b 100644 --- a/source/MonoGame.Extended/Graphics/AnimatedSprite.cs +++ b/source/MonoGame.Extended/Graphics/AnimatedSprite.cs @@ -65,6 +65,8 @@ public class AnimatedSprite : Sprite { _animation = _spriteSheet.GetAnimation(name); Controller = new AnimationController(_animation); + TextureRegion = _spriteSheet.TextureAtlas[Controller.CurrentFrame]; + return Controller; }