Category5.Animation.Draw C# (CSharp) Method

Draw() public method

Draw a frame of the animation to the screen at the given location. dest specifies the rectangle to be filled by the frame Direction value orients the frame, and is given in radians
public Draw ( SpriteBatch sBatch, Rectangle dest, double direction ) : void
sBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
dest Microsoft.Xna.Framework.Rectangle
direction double
return void
        public void Draw(SpriteBatch sBatch, Rectangle dest, double direction)
        {
            sBatch.Draw(texture, dest,
                new Rectangle(currentFrame * frameWidth, 0, frameWidth, frameHeight), color,
                (float)direction, new Vector2(dest.Width / 2f, dest.Height / 2f), SpriteEffects.None, 0);
        }

Same methods

Animation::Draw ( SpriteBatch sBatch, Rectangle2D dest, double direction ) : void
Animation::Draw ( SpriteBatch sBatch, Vector2 location, double direction ) : void