Bricklayer.Common.World.AnimatedTile.Draw C# (CSharp) Метод

Draw() публичный Метод

public Draw ( SpriteBatch spriteBatch, Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 drawPosition, int x, int y, int z, bool flat = false ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
texture Microsoft.Xna.Framework.Graphics.Texture2D
drawPosition Vector2
x int
y int
z int
flat bool
Результат void
        public override void Draw(SpriteBatch spriteBatch, Texture2D texture, Vector2 drawPosition, int x, int y, int z, bool flat = false)
        {
            drawPosition.X = (x * Tile.Width);
            //Add the frameindex to change the Y coord on the spritesheet
            Rectangle source = Block.Source;
            source.Y += frameIndex * Tile.Height;
            drawPosition.Y = ((y * Tile.Height) - (Tile.DrawHeight - Tile.Height)) + 1;
            spriteBatch.Draw(texture, drawPosition, source, Color.White);
        }