-
Notifications
You must be signed in to change notification settings - Fork 0
DialogOptionsRenderingInfo
The DialogOptionsRenderingInfo instance is used by the custom dialog options system. You can never create one yourself, it will be passed in to the dialog option functions as described in the linked page.
bool DialogOptionsRenderingInfo.RunActiveOption();
Runs the currently selected dialog option, the one set in ActiveOptionID, and returns true on success.
As of AGS 3.4.0 you must call this function for conversation to
continue, most common places for such call are
dialog_options_mouse_click
and dialog_options_key_press
functions.
Example:
function dialog_options_key_press(DialogOptionsRenderingInfo *info, eKeyCode key)
{
if (keycode == eKeyReturn)
info.RunActiveOption();
}
runs selected dialog option when player presses Enter/Return key.
Compatibility: Supported by AGS 3.4.0 and later versions.
See Also: DialogOptionsRenderingInfo.ActiveOptionID
void DialogOptionsRenderingInfo.Update();
Forces dialog options to redraw, eventually leading to be
dialog_options_render
function run.
Like other elements of interface, dialog options GUI does not redraw itself every game loop; in attempt to optimize performance it aims to do so only when there are changes to its look. But sometimes you may want to change GUI looks based on your own decision, and not automatic behavior. For example, you want to script animated text, or other element belonging to dialog options. This is when you call DialogOptionsRenderingInfo.Update().
IMPORTANT: Keep in mind that calling Update does not immediately
run dialog_options_render
, render function will be run at least after
current script ends.
Compatibility: Supported by AGS 3.4.0 and later versions.
int DialogOptionsRenderingInfo.ActiveOptionID;
Gets/sets the currently active option on the dialog options screen. You
set this in the dialog_options_get_active
function to tell AGS which
option the mouse is hovering over. This ensures that the correct option
is activated when the player clicks the mouse button.
You can read this property in the dialog_options_render
function in
order to highlight the selected option in a different manner to the
others.
This property can be set to 0 which indicates that no option is selected; otherwise it will be the option number from 1 to the number of options in the dialog.
Example:
function dialog_options_get_active(DialogOptionsRenderingInfo *info)
{
info.ActiveOptionID = 1;
}
always selects the first option
Compatibility: Supported by AGS 3.1.0 and later versions.
See Also: DialogOptionsRenderingInfo.RunActiveOption, Dialog.GetOptionState
Dialog* DialogOptionsRenderingInfo.DialogToRender;
Gets the dialog that needs to be rendered. You can loop through all the options in the dialog in order to decide what to display on the screen.
Example: For an example please see the custom dialog options page.
Compatibility: Supported by AGS 3.1.0 and later versions.
See Also: Dialog.GetOptionState, DialogOptionsRenderingInfo.Surface
int DialogOptionsRenderingInfo.HasAlphaChannel;
Gets/sets whether the dialog options's drawing surface will have alpha channel.
This can only be set within the dialog_options_get_dimensions
function, but can be read in other functions in order to render the
options.
Example:
function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
{
info.Width = 300;
info.Height = 150;
info.HasAlphaChannel = true;
}
creates a 300x150 size area with alpha channel to draw the dialog options in.
Compatibility: Supported by AGS 3.3.0 and later versions.
See Also: DialogOptionsRenderingInfo.Height, DialogOptionsRenderingInfo.Width
int DialogOptionsRenderingInfo.Height;
Gets/sets the height of the area needed to draw the dialog options.
This can only be set within the dialog_options_get_dimensions
function, but can be read in other functions in order to render the
options.
Example:
function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
{
info.Width = 300;
info.Height = 150;
}
creates a 300x150 size area to draw the dialog options in
Compatibility: Supported by AGS 3.1.0 and later versions.
See Also: DialogOptionsRenderingInfo.Width
int DialogOptionsRenderingInfo.ParserTextBoxWidth;
Gets/sets the width of the text parser textbox on the dialog options. If the text parser is not enabled for this dialog, this setting will be ignored.
This can only be set within the dialog_options_get_dimensions
function.
Example:
function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
{
info.Width = 300;
info.Height = 150;
// Put the text parser at the bottom (if enabled)
info.ParserTextBoxX = 10;
info.ParserTextBoxY = 130;
info.ParserTextBoxWidth = 180;
}
positions the parser text box at (10,130) inside the 300x150 dialog options area
Compatibility: Supported by AGS 3.1.0 and later versions.
See Also: DialogOptionsRenderingInfo.Width, DialogOptionsRenderingInfo.ParserTextBoxX, DialogOptionsRenderingInfo.ParserTextBoxY
int DialogOptionsRenderingInfo.ParserTextBoxX;
Gets/sets the X-position of the text parser textbox on the dialog options. If the text parser is not enabled for this dialog, this setting will be ignored.
This X-position is relative to the dialog options surface. That is, an X of 10 will position it 10 pixels within the dialog options area, not 10 pixels from the edge of the screen.
This can only be set within the dialog_options_get_dimensions
function.
Example:
function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
{
info.Width = 300;
info.Height = 150;
// Put the text parser at the bottom (if enabled)
info.ParserTextBoxX = 10;
info.ParserTextBoxY = 130;
info.ParserTextBoxWidth = 180;
}
positions the parser text box at (10,130) inside the 300x150 dialog options area
Compatibility: Supported by AGS 3.1.0 and later versions.
See Also: DialogOptionsRenderingInfo.ParserTextBoxWidth, DialogOptionsRenderingInfo.ParserTextBoxY
int DialogOptionsRenderingInfo.ParserTextBoxY;
Gets/sets the Y-position of the text parser textbox on the dialog options. If the text parser is not enabled for this dialog, this setting will be ignored.
This Y-position is relative to the dialog options surface. That is, a Y of 10 will position it 10 pixels within the dialog options area, not 10 pixels from the edge of the screen.
This can only be set within the dialog_options_get_dimensions
function.
Example:
function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
{
info.Width = 300;
info.Height = 150;
// Put the text parser at the bottom (if enabled)
info.ParserTextBoxX = 10;
info.ParserTextBoxY = 130;
info.ParserTextBoxWidth = 180;
}
positions the parser text box at (10,130) inside the 300x150 dialog options area
Compatibility: Supported by AGS 3.1.0 and later versions.
See Also: DialogOptionsRenderingInfo.ParserTextBoxX
DrawingSurface* DialogOptionsRenderingInfo.Surface;
Gets the drawing surface that can be used to draw the dialog options.
This can only be used within the dialog_options_render
function; in
all other functions it will return null.
Unlike most other uses of the DrawingSurface, you do NOT have to
release this one. AGS will automatically do that for you after the
dialog_options_render
function has completed.
The size of the surface should correspond to the Width and Height
requested in the dialog_options_get_dimensions
function.
Example:
function dialog_options_render(DialogOptionsRenderingInfo *info)
{
info.Surface.Clear(14);
}
clears the dialog options area to yellow.
Compatibility: Supported by AGS 3.1.0 and later versions.
See Also: DrawingSurface functions
int DialogOptionsRenderingInfo.Width;
Gets/sets the width of the area needed to draw the dialog options.
This can only be set within the dialog_options_get_dimensions
function, but can be read in other functions in order to render the
options.
Example:
function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
{
info.Width = 300;
info.Height = 150;
}
creates a 300x150 size area to draw the dialog options in
Compatibility: Supported by AGS 3.1.0 and later versions.
See Also: DialogOptionsRenderingInfo.Height
int DialogOptionsRenderingInfo.X;
Gets/sets the horizontal co-ordinate of the top-left corner of the dialog options area.
This can only be set within the dialog_options_get_dimensions
function, but can be read in other functions in order to render the
options.
Example:
function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
{
info.X = 50;
info.Y = 20;
info.Width = 200;
info.Height = 150;
}
creates a 200x150 size area at (50, 20) to draw the dialog options in
Compatibility: Supported by AGS 3.1.0 and later versions.
See Also: DialogOptionsRenderingInfo.Y
int DialogOptionsRenderingInfo.Y;
Gets/sets the vertical co-ordinate of the top-left corner of the dialog options area.
This can only be set within the dialog_options_get_dimensions
function, but can be read in other functions in order to render the
options.
Example:
function dialog_options_get_dimensions(DialogOptionsRenderingInfo *info)
{
info.X = 50;
info.Y = 20;
info.Width = 200;
info.Height = 150;
}
creates a 200x150 size area at (50, 20) to draw the dialog options in
Compatibility: Supported by AGS 3.1.0 and later versions.
See Also: DialogOptionsRenderingInfo.X
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