TextStyle class

The text style class is used as a way to define a sprite font, color, and (optionally) a shadow for text all at once. It is used by several of the other classes in the UI Library.

Constructors

public TextStyle(SpriteFont spriteFont, Color color)
Creates a basic text style without a shadow.

public TextStyle(SpriteFont spriteFont, Color color, Color shadowColor, int shadowDepth, Direction shadowDirection)
Creates a basic text style with the specified type of shadow.

Methods

public void DrawString(SpriteBatch spriteBatch, string text, Vector2 position)
Draws a string with the specified text style.

public Vector2 MeasureString(string text)
Measures a string with the specified text style. (Takes shadow depth into account.)

Last edited Oct 24, 2009 at 8:11 PM by dylanwolf, version 1

Comments

No comments yet.