Microsoft.Xna.Framework.Graphics.SpriteFont.MeasureString C# (CSharp) Method

MeasureString() public method

public MeasureString ( string text ) : System.Vector2
text string
return System.Vector2
        public Vector2 MeasureString(string text)
        {
            return default(Vector2);
        }
    }

Usage Example

Exemplo n.º 1
1
        /// <summary>
        /// This function loads the content for the lose screen.
        /// </summary>
        /// <param name="texture">texture for the lose screen</param>
        /// <param name="font">font to use for string</param>
        /// <param name="score">exit score</param>
        public void LoadContent(Texture2D texture, SpriteFont font, int score)
        {
            this.texture = texture; //set texture
            rectangle = new Rectangle(0, 0, texture.Width, texture.Height); //set texture bounds

            this.font = font; //set font
            this.scoreString = "SCORE: " + score.ToString(); //set score string to display
            center = new Vector2(800 - font.MeasureString(scoreString).X, 480 - font.MeasureString(scoreString).Y); //set position of score string
        }
All Usage Examples Of Microsoft.Xna.Framework.Graphics.SpriteFont::MeasureString
SpriteFont