-
Notifications
You must be signed in to change notification settings - Fork 0
Globalfunctions_Message
Display (string message, ...)
Displays a message to the screen. It will be displayed in the standard message box, and centered in the middle of the screen.
You can insert the value of variables into the message. For more information, see the string formatting section.
Example:
int my_counter;
Display ("The counter is currently set to %d.", my_counter);
will replace the '%d
' with the value of the variable "my_counter".
NOTE: Display is a blocking function - that is, control will not return to the script until the player has removed the text window (by pressing a key or clicking the mouse). While the window is displayed, all other processing, like animations and interface display, are disabled. This is usually used for responses to the player looking at things.
See Also: DisplayAt, DisplayMessage, Character.Say, DisplayTopBar, String.Format
DisplayAt(int x, int y, int width, string message, ...)
Identical to the "Display" function, only this allows you to define the position and size of the window where the text is displayed. The X and Y variables define the co-ordinates of the upper-left corner of the window.
The WIDTH variable defines the maximum width of the window. The height is then automatically calculated so that the message fits into the window.
You can insert the value of variables into the message. For more information, see the string formatting section.
Note: This is a blocking call. See the "Display" help for more information.
Example:
DisplayAt (50,50,100, "This is a message");
will display the message at coordinates 50,50 in a box 100 pixels wide.
See Also: Display, DisplayAtY
DisplayAtY (int y, string message)
Similar to the Display function, except that this will display the message box at the specified Y location on the screen. The Y defines the co-ordinate of the top of the message box. The horizontal positioning will be automatically calculated as usual.
Example:
DisplayAt (50, "This is a message");
will display the message at y coordinate 50.
DisplayMessage (int message_number)
Identical to the Display function, but this uses a message text defined in the AGS Editor rather than in the script. It will either use a message from the current room, or a global message (if message_number >= 500).
Example:
DisplayMessage(220);
will display the message 220 of the Room message editor.
See Also: Display, DisplayMessageAtY
DisplayMessageAtY (int message_number, int yposition)
Identical to the DisplayMessage function, except that the text box is positioned with its top at YPOSITION, the same way as DisplayAtY works.
This is useful if you have an important graphic in the middle of the screen that the text box would normally cover up - with this function you can place the message above or below it.
Example:
DisplayMessageAtY(527, 200);
will display global message 527, in the lower half of the screen.
See Also: DisplayAtY, DisplayMessage
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 color of the top bar, and the BACK_COLOR specifies the background color 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 color used for the bar's border
(set to the same color 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 grey background.
Getting Started in AGS
Editor Reference
- Music and sound
- Distributing your game
- Backing up your game
- The text parser
- Translations
- Global variables
- Custom Properties
- Plugins
- Lip sync
- New Game templates
- Debugging features
- Auto-number speech files
- Integration with Windows
- Source Control integration
Engine
Scripting
- Scripting tutorial part 1
- Scripting tutorial part 2
- Pointers in AGS
- Calling global functions from local scripts
- The script header
- String formatting
- Multiple Scripts
- Understanding blocking scripts
- Dynamic Arrays
- Extender functions
- Game variables
- Predefined global script functions
- repeatedly_execute (_always)
- Custom dialog options rendering
- Built-in enumerated types
- Script language keywords
- AudioChannel functions and properties
- AudioClip functions and properties
- Character functions and properties
- DateTime functions and properties
- Dialog functions and properties
- DialogOptionsRenderingInfo functions and properties
- DrawingSurface functions and properties
- DynamicSprite functions and properties
- File functions and properties
- Game / Global functions
- GUI functions and properties
- GUI control functions and properties
- GUI Button functions and properties
- GUI InvWindow functions and properties
- GUI Label functions and properties
- GUI List Box functions and properties
- GUI Slider properties
- GUI Text Box functions and properties
- Hotspot functions and properties
- Inventory item functions and properties
- Maths functions and properties
- Mouse functions and properties
- Multimedia functions
- Object functions and properties
- Overlay functions and properties
- Palette functions
- Parser functions
- Region functions and properties
- Room functions
- Screen functions
- Speech functions and properties
- String functions
- System functions and properties
- Text display / Speech functions
- ViewFrame functions and properties
Working on Legacy games
Upgrading from a previous version
- Upgrading to AGS 2.7
- Upgrading to AGS 2.71
- Upgrading to AGS 3.0
- Upgrading to AGS 3.1
- Upgrading to AGS 3.2
- Upgrading to AGS 3.3
- Upgrading to AGS 3.3.5
- Upgrading to AGS 3.4
- Upgrading to AGS 3.4.1
Legal Notice
Getting in touch