Bricklayer.Client.World.Map.Draw C# (CSharp) Метод

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

Draws the map blocks an entities
public Draw ( SpriteBatch spriteBatch, GameTime gameTime ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
gameTime Microsoft.Xna.Framework.GameTime
Результат void
        public void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {
            //Draw the background texture, wrapping it around the screen size
            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointWrap, null, null, null, MainCamera.GetViewMatrix(Vector2.One));
            spriteBatch.Draw(borderTexture, (MainCamera.Position * new Vector2(cameraParallax, cameraParallax)) + new Vector2(-13, -3), new Rectangle((int)MainCamera.Left, (int)MainCamera.Top, (int)MainCamera.Right - (int)(MainCamera.Left * cameraParallax) + 16, (int)MainCamera.Bottom - (int)(MainCamera.Top * cameraParallax) + 3), Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0);
            spriteBatch.End();

            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null, null, MainCamera.GetViewMatrix(Vector2.One));
            //Draw border background
            Rectangle bgSource = new Rectangle(0, 0, Width * Tile.Width, Height * Tile.Height);
            spriteBatch.Draw(backgroundTexture, bgSource, Color.White);
            //Draw tiles
            DrawTiles(spriteBatch);
            //Draw Players
            foreach (Player player in Players)
                player.Draw(spriteBatch, gameTime);
            spriteBatch.End();

            spriteBatch.Begin();
            Minimap.Draw(spriteBatch, gameTime);
            spriteBatch.End();
        }