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
    * Text display / Speech functions

DisplayTopBar

DisplayTopBar(int y, int text_color, int back_color, string titleText, string message, ...)
Displays a message in a text window, with a caption bar on top of it.

This displays MESSAGE in a similar way to the normal Display command, but above the text window a caption bar will be displayed with TITLETEXT in it. This method was used in some early Sierra games to indicate who was talking by having their name in the caption, and can be handy if you don't want to draw a talking view for a character.

You can insert the value of variables into the message. For more information, see the string formatting section.

The Y parameter specifies the Y location on the screen where the message box will appear. The default is 25.

The TEXT_COLOR parameter specifies the text colour of the top bar, and the BACK_COLOR specifies the background colour of the top bar.

You can pass 0 for Y, TEXT_COLOR or BACK_COLOR - if you do, it will use the setting you used last time.

There are a couple of game variables available which can further customize the look of the bar. You can change these before calling DisplayTopBar.

game.top_bar_bordercolor sets the colour used for the bar's border (set to the same colour as the backcolor if you don't want a border)
game.top_bar_borderwidth sets the width of the bar's border, in pixels (default 1)
game.top_bar_font sets the font to use for the top bar. The default is -1, which means that the current Normal font is used. Set it to a specific number to use that font instead.

Example:

DisplayTopBar(25, 8, 7, "Evil wizard", "Get out of my house and never return!");
will display "Get out of my house and never return!" in the message box, with the caption bar reading "Evil wizard". The message box will have dark grey text on a light gray background.

See Also: Display, DisplayAt


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