GetTextHeight(string text, FontType font, int width)
Calculates the height on the screen that drawing TEXT in FONT within an area of WIDTH
would take up.
This allows you to work out how tall a message displayed with a command like
DrawMessageWrapped will be. WIDTH is
the width of the area in which the text will be displayed.
The height is returned in normal 320-resolution pixels, so it can be used with the
screen display commands.
Example:
int height = GetTextHeight("The message on the GUI!", Game.NormalFont, 100);
gBottomLine.SetPosition(0, 200 - height);
will move the BOTTOMLINE GUI so that it can display the text within the screen.
See Also: GetTextWidth, DrawingSurface.DrawString
|