MrGravity.AnimatedSprite.Draw C# (CSharp) Method

Draw() public method

Draw function - self explanatory
public Draw ( SpriteBatch spriteBatch, Vector2 position ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch the spritebatch to draw
position Microsoft.Xna.Framework.Vector2 where you want the texture to be drawn
return void
        public void Draw(SpriteBatch spriteBatch, Vector2 position)
        {
            var width = _mTexture.Width / LastFrame;
            var sourcerect = new Rectangle(width * Frame, 0, width, _mTexture.Height);
            spriteBatch.Draw(_mTexture, position, sourcerect, Color.White);
        }