Contents Up Previous Next

DialogOptionsRenderingInfo functions and properties

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.

ActiveOptionID property
DialogToRender property
Height property (DialogOptionsRenderingInfo)
ParserTextBoxWidth property
ParserTextBoxX property
ParserTextBoxY property
Surface property (DialogOptionsRenderingInfo)
Width property (DialogOptionsRenderingInfo)
X property (DialogOptionsRenderingInfo)
Y property (DialogOptionsRenderingInfo)


ActiveOptionID property

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: Dialog.GetOptionState


DialogToRender property

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


Height property (DialogOptionsRenderingInfo)

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


ParserTextBoxWidth property

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


ParserTextBoxX property

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


ParserTextBoxY property

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


Surface property (DialogOptionsRenderingInfo)

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


Width property (DialogOptionsRenderingInfo)

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


X property (DialogOptionsRenderingInfo)

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


Y property (DialogOptionsRenderingInfo)

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