worldToScreen() public method

Returns the screen position matching the given world position
public worldToScreen ( Vector2 pos ) : Vector2
pos Vector2 world position
return Vector2
コード例 #1
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);
        }
コード例 #2
0
ファイル: Sprite.cs プロジェクト: degrand1/Manly-Mini-Games
        //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);
        }