The game interface is split up into GUIs. Each GUI is a
rectangular region on the screen which is drawn on top of the background
scene. Each can be set to either:
- be always displayed (for example the Sierra status-line)
- pop-up when the mouse moves to a certain position (eg. Sierra icon-bar)
- pop-up on script command only
The default interface is made up of two GUIs - the status line, and the
icon bar.
Go to the "GUIs" node in the main tree. Under this all the GUIs in the game
are listed -- double-click one to edit it. To create a new one, right-click
on the main "GUIs" node and choose "New GUI".
Once you've opened up a GUI, you'll notice the GUI itself in the main window,
and its settings can be edited in the Properties grid. This allows you to change the
background colour of the GUI, set a background picture, and set the
location and width/height amongst other things.
The "Visibility" property allows you to set when the GUI is displayed. The
default is "Normal", which means that the GUI will initially be visible,
though you can turn it off with a GUI.Visible=false command in game_start if you need to.
The "Popup modal" option means that the GUI will be initially
off and must be turned on by a script command. With this option,
the game will be paused while the GUI is displayed, during which time the
on_mouse_click and on_key_press functions will not get run.
The "Mouse YPos" option means that the GUI only appears when the mouse vertical
position moves above the y-coordinate set with the "Popup-YP" option.
"Persistent" is like "Normal", except that this GUI will not be removed
during a cutscene when the setting "GUIs turn off when disabled" is set in
the general settings. Useful if you want most of your GUIs to turn off, except
a status line or whatever.
The "Z-Order" setting allows you to set which order the GUIs are drawn in - ie. when
there are two GUIs that overlap, which is drawn in front. The Z-order setting is an
arbitrary number between 0 and 1000. AGS draws the GUIs in order, from the lowest numbered
at the back to the highest numbered at the front.
The "Clickable" setting allows you to set whether the GUI and buttons on it
respond to mouse clicks. This is on by default, but if you turn it off and
the player clicks on the GUI, the game will actually process the click as if
they clicked behind the GUI onto the actual screen. Useful for transparent GUIs
which are only used to display information.
You'll notice that the GUIs have names. These can be used in the script in the
same way as character names. For example, if a GUI is called "gIconBar", you can use
scripts such as:
gIconBar.Visible = true;
In this section:
GUI buttons
Interface text
Customized Text Windows
Custom inventory
Sliders
Text Boxes
List Boxes
|