Skip to content

OryUIDialog

Kevin Cross edited this page Jun 28, 2020 · 6 revisions

Available Functions

OryUICreateDialog(parameters$)

Creates a dialog and returns a dialog ID. See Available Parameters section below for the options.

OryUIDeleteDialog(dialogID)

Deletes a dialog.

OryUIGetDialogButtonCount(dialogID)

Returns the number of buttons in the dialog.

OryUIGetDialogButtonHeight(dialogID, buttonID)

Returns the height of a specific button in the dialog.

OryUIGetDialogButtonReleasedByIndex(dialogID, buttonID)

Returns whether or not a specific button in the dialog was released.

OryUIGetDialogButtonReleasedByName(dialogID, buttonName$)

Returns whether or not a specific button in the dialog was released.

OryUIGetDialogButtonReleasedIndex(dialogID)

Returns the button number (buttonID) that was released.

OryUIGetDialogButtonReleasedName(dialogID)

Returns the button name (buttonID) that was released.

OryUIGetDialogButtonWidth(dialogID)

Returns the width of a specific button in the dialog.

OryUIGetDialogChecked(dialogID)

Returns whether or not the checkbox on the dialog is checked.

OryUIGetDialogHeight(dialogID)

Returns the height of the dialog.

OryUIGetDialogVisible(dialogID)

Returns whether or not the dialog is visible.

OryUIGetDialogWidth(dialogID)

Returns the width of the dialog.

OryUIHideDialog(dialogID)

Hides the dialog.

OryUIInsertDialogButton(dialogID, index, parameters$)

Inserts a button into the dialog at the chosen location. At the moment -1 is the only accepted index, which will put a new button at the end of the list.

OryUIInsertDialogListener(dialogID)

Required to register dialog activity.

OryUISetDialogButtonCount(dialogID)

Sets the number of buttons in the dialog. Will remove or add buttons to the required amount.

OryUIShowDialog(dialogID)

Shows the dialog.

OryUIUpdateDialog(dialogID, parameters$)

Updates a dialog. See Available Parameters section below for the options.

OryUIUpdateDialogButton(dialogID, buttonID, parameters$)

Updates a specific button in a dialog. See Available Parameters section below for the options.

Available Parameters (all optional)

Parameter Description
autoHeight If true the dialog will resize to fit the contents. Accepts the values true, false, 0, and 1.
checkboxAlignment The alignment of the checkbox and text. Accepts left, center, and right. Also accepts the numeric values 0, 1, and 2.
checkboxColor The colour of the checkbox on the dialog. Accepts RGB values, and RGBA values (comma delimited) Also accepts MakeColor() value/id, and hex color codes.
checkboxText The text shown besides the checkbox.
checkboxTextBold If the checkbox text is bold. Accepts the values true, false, 0, and 1.
checkboxTextColor The colour of the checkbox text. Accepts RGB values, and RGBA values (comma delimited) Also accepts MakeColor() value/id, and hex color codes.
checkboxTextSize The size of the checkbox text. Accepts decimals.
checkedImageID The checked image ID. Requires a LoadImage() value/id.
color The colour of the dialog. Accepts RGB values, and RGBA values (comma delimited) Also accepts MakeColor() value/id, and hex color codes.
decisionRequired If true the dialog won't disappear until a button is pressed. Accepts the values true, false, 0, and 1.
depth The depth of the dialog.
flexButtons Will resize the buttons so that their widths are all equal on each row.
height The height of the dialog. Accepts decimals.
imageID Apply an image to the whole dialog background. Requires a LoadImage() value/id.
name The name/id to give to a button in the dialog.
showCheckbox Whether or not to show a checkbox on the dialog. Accepts the values true, false, 0, and 1.
size The width and height of the dialog, comma delimited. Also accepts -1 in either one to create a square button. Accepts decimals.
stackButtons Will stack buttons vertically, with one button on each row.
supportingText The supporting text shown.
supportingTextAlignment The alignment of the supporting text. Accepts left, center, and right. Also accepts the numeric values 0, 1, and 2.
supportingTextBold If the supporting text is bold. Accepts the values true, false, 0, and 1.
supportingTextColor The colour of the supporting text. Accepts RGB values, and RGBA values (comma delimited) Also accepts MakeColor() value/id, and hex color codes.
supportingTextSize The size of the supporting text. Accepts decimals.
text The text shown on the button.
textColor The colour of the text shown on the button. Accepts RGB values, and RGBA values (comma delimited) Also accepts MakeColor() value/id, and hex color codes.
textSize The size of the text shown on the button. Accepts decimals.
titleText The title text shown.
titleTextAlignment The alignment of the title text. Accepts left, center, and right. Also accepts the numeric values 0, 1, and 2.
titleTextBold If the title text is bold. Accepts the values true, false, 0, and 1.
titleTextColor The colour of the title text. Accepts RGB values, and RGBA values (comma delimited) Also accepts MakeColor() value/id, and hex color codes.
titleTextSize The size of the title text. Accepts decimals.
uncheckedImageID The unchecked image ID. Requires a LoadImage() value/id.
width The width of the dialog. Accepts decimals.

Example Code

Example 1

dialog = OryUICreateDialog("titleText:Reset device?;supportingText:This will reset your device to its default factory settings;autoHeight:true")
OryUIInsertDialogButton(dialog, -1, "text:CANCEL")
OryUIInsertDialogButton(dialog, -1, "text:ACCEPT")
OryUIShowDialog(dialog)
 
do
    OryUIStartTrackingTouch()

    OryUIInsertDialogListener(dialog)

    OryUIEndTrackingTouch()

    Sync()
loop

Example 2

dialog = OryUICreateDialog("color:255,234,167,255;titleText:Use Lorem Ipsum?;titleTextColor:232,67,147,255;supportingText:Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas viverra tellus in mi mollis egestas. Suspendisse blandit, est ut varius tincidunt, justo lectus placerat leo, eu laoreet odio felis dignissim quam. Aliquam ultrices varius eros, ultricies accumsan massa mollis quis. Proin sit amet egestas lacus, ac aliquet orci. Pellentesque venenatis justo ullamcorper arcu rutrum, nec vestibulum eros egestas. Proin viverra eu felis sit amet consectetur. Nunc eu enim eu mauris congue ultricies nec eget lacus.;supportingTextColor:225,112,85,255;autoHeight:true")
OryUIInsertDialogButton(dialog, -1, "textColor:214,48,49;color:253,203,110,255;text:No")
OryUIInsertDialogButton(dialog, -1, "textColor:214,48,49;color:253,203,110,255;text:Not Sure")
OryUIInsertDialogButton(dialog, -1, "textColor:214,48,49;color:253,203,110,255;text:Yes")
OryUIShowDialog(dialog)

do
    OryUIStartTrackingTouch()

    OryUIInsertDialogListener(dialog)

    OryUIEndTrackingTouch()

    Sync()
loop

Example 3

imgBackground = LoadImage("paper-texture.jpg")
dialog = OryUICreateDialog("titleText:Buy coins?;image:" + str(imgBackground) + ";supportingText:Coins help you get further than your friends and buys us coffees...;stackButtons:true;autoHeight:true")
OryUIInsertDialogButton(dialog, -1, "color:255,255,255,128;text:Buy 500 coins £1.99")
OryUIInsertDialogButton(dialog, -1, "color:255,255,255,128;text:Buy 5,000 coins £4.99")
OryUIInsertDialogButton(dialog, -1, "color:255,255,255,128;text:Buy 10,000 coins £7.99")
OryUIInsertDialogButton(dialog, -1, "color:255,255,255,128;text:Buy 100,000 coins £19.99")
OryUIInsertDialogButton(dialog, -1, "color:255,255,255,128;text:No thanks")
OryUIShowDialog(dialog)
 
do
    OryUIStartTrackingTouch()

    OryUIInsertDialogListener(dialog)

    OryUIEndTrackingTouch()

    Sync()
loop

Clone this wiki locally