spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

 

spacer graphic
Menu
spacer graphic Home
About
News
Features
Download AGS
spacer graphic Games 
Games main page
Award Winners
Picks of the month
Short games
Medium length games
Full length games
In Production
Hints & Tips
Community
Forums
AGSers World Map
Member websites
Chat
Resources
Tutorials
FAQ
Knowledge Base
Downloads
Links
AGS-related links
* AGS Manual
  * Scripting
    * Game / Global functions

GetTextHeight

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


User comments and notes
There are currently no user comments on this page.
The user comment facility is currently disabled.