Project_Starfighter.AnimatedSprite.Draw C# (CSharp) Méthode

Draw() public méthode

public Draw ( SpriteBatch spriteBatch, int XOffset, int YOffset, bool NeedBeginEnd ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
XOffset int
YOffset int
NeedBeginEnd bool
Résultat void
        public void Draw(SpriteBatch spriteBatch,
                            int XOffset,
                            int YOffset,
                            bool NeedBeginEnd)
        {
            if (NeedBeginEnd)
                spriteBatch.Begin();

            spriteBatch.Draw(
                t2dTexture,
                new Rectangle(
                  xPosition + XOffset,
                  yPosition + YOffset,
                  widthOfFrame,
                  heightOfFrame),
                GetSourceRect(),
                Color.White);

            if (NeedBeginEnd)
                spriteBatch.End();
        }