public void Draw(SpriteBatch spriteBatch, string regionName, Vector2 position, Color color)
var clip = new AnimationClip RegionNames = regionNames, FrameDuration = 1.0f / framesPerSecond, Loop = loop ; _clips[name] = clip;
var region = GetRegion(regionName); if (region != Rectangle.Empty) spriteBatch.Draw(_texture, position, region, color, rotation, origin, scale, SpriteEffects.None, 0f);
Cache your Rectangle regions. The code above does this via Dictionary<string, Rectangle> .
Add 1-2px transparent padding between sprites to prevent texture bleeding (adjacent pixels bleeding into your sprite due to texture filtering). 5. Complete Example: Player Character public class Player