manlyMiniGames.Map.drawOnMap C# (CSharp) Method

drawOnMap() public method

Renders a texture onto the map using the given spritebatch and map position
public drawOnMap ( SpriteBatch batch, Microsoft.Xna.Framework.Graphics.Texture2D tex, Vector2 pos ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch Spritebatch to render the texture
tex Microsoft.Xna.Framework.Graphics.Texture2D Texture we want to render
pos Vector2
return void
        public void drawOnMap(SpriteBatch batch, Texture2D tex, Vector2 pos)
        {
            //If the tile is empty
            if (tex == null)
                return;

            //Find the screen position for the texture
            Vector2 scrpos = worldToScreen(pos);

            batch.Draw(tex, scrpos, null, Color.White, 0f, Vector2.Zero,
                scale, SpriteEffects.None, 0f);
        }