Skip to content

Commit

Permalink
Set initial frame when animation is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolf committed Mar 1, 2025
1 parent b688d56 commit ef9340f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/MonoGame.Extended/Graphics/AnimatedSprite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public IAnimationController SetAnimation(string name)
{
_animation = _spriteSheet.GetAnimation(name);
Controller = new AnimationController(_animation);
TextureRegion = _spriteSheet.TextureAtlas[Controller.CurrentFrame];

return Controller;
}

Expand Down

0 comments on commit ef9340f

Please sign in to comment.