- Found in:
- MessageBox
stringfunctionShowArray(stringbodyText, string[]buttons, boolgetIndex=false, floatwaitInterval=0.1, floattimeoutSeconds=0.0)Global
Description
Documentation Comment
Open a messagebox and return the name of the selected button, given a string array of button names.
Useful for when you are not hard-coding the names of the buttons!
Button names
Any string array should work for button names.
string[] buttons = new string[2]
buttons[0] = "Ok"
buttons[1] = "Cancel"
Get name of selected button
string selectedButtonName = SkyMessage.Show("body text of message", buttons)
Get index of selected button
If you would prefer to get the int index of the button:
string selectedButtonIndex = SkyMessage.Show("body text of message", buttons, getIndex = true)
Advanced
You can also specify a timeout. This is the number of seconds after which the function will return with the text "TIMED_OUT":
string selectedButtonName = SkyMessage.Show("body text of message", buttons, timeoutSeconds = 69.0)
Parameters
stringbodyText
string[]buttons
boolgetIndex=false
floatwaitInterval=0.1
floattimeoutSeconds=0.0
Examples
Auto-Generated Example
string myString__bodyText
string[] myStringArray__buttons
bool myBool__getIndex
float myFloat__waitInterval
float myFloat__timeoutSeconds
string returnedValue = SkyMessage.ShowArray(myString__bodyText, myStringArray__buttons, myBool__getIndex, myFloat__waitInterval, myFloat__timeoutSeconds)