worldToScreen() public method

Returns the screen position matching the given world position
public worldToScreen ( Vector2 pos ) : Vector2
pos Vector2 world position
return Vector2
        //Draws the sprite to the screen
        public virtual void Draw(SpriteBatch theSpriteBatch, Map map)
        {
            //Find the screen position for the texture
            Vector2 scrpos = map.worldToScreen(mPosition);

            //map.drawOnMap(theSpriteBatch, mSpriteTexture, mPosition, source);
            theSpriteBatch.Draw(mSpriteTexture, scrpos, source, Color.White);
        }
Example #2
0
        //Draws the sprite to the screen
        public virtual void Draw(SpriteBatch theSpriteBatch, Map map)
        {
            //Find the screen position for the texture
            Vector2 scrpos = map.worldToScreen(mPosition);

            //map.drawOnMap(theSpriteBatch, mSpriteTexture, mPosition, source);
            theSpriteBatch.Draw(mSpriteTexture, scrpos, source, Color.White);
        }