gui - Telltale-Modding-Group/Telltale-Script-Editor GitHub Wiki

The Telltale Tool contains many GUI methods & classes. Here are a few essentials you should keep in your toolkit!

Dialog Boxes

The humble Dialog Box - a simple, yet crucial, part of almost every user interface. The Telltale Tool has three known types of dialog boxes, and thankfully, they're very easy to implement!

It is highly recommended that you call WidgetInputHandler_EnableInput(false) before creating dialog or input boxes. This will prevent unintentional interactions with other GUI elements. Be sure to re-enable it after!

Optionally, you can include a header on a Dialog Box by passing a second string! This doesn't apply to Text Entry boxes.

Dialog Box - Okay

Displays some text along with a button to acknowledge it. That's literally it - nothing fancy here.

Example

DialogBox_Okay("This is a Dialog Box!")

The above code produces the following result:

Dialog Box - Okay

Dialog Box - Yes / No

A dialog box that includes two buttons. The button the user clicks is returned as a boolean.

Example

local dialogResult = DialogBox_YesNo("Are you sure you want to do that?")
if dialogResult then
  --If the user clicks yes, dialogResult will return true.
  DialogBox_Okay("You clicked yes!")
end

The above code produces the following result:

Dialog Box - Yes / No


Text Input Box

Need to get input from the user? Text input boxes are your best friend!

Please note that Text Entry Boxes only work on PC as they require keyboard input!

Example

local enteredText, cancel = Menu_OpenTextEntryBox("Default Text", Menu_Text("Dialog Description"))
  
if cancel then
  --Cancel returns true if the user clicks the 'cancel' button.
  DialogBox_Okay("You cancelled the input box!")
  return
end

--enteredText is now a string containing the user input!
DialogBox_Okay("You entered: " .. enteredText)

The above code produces the following result:

Input Dialog


Miscellaneous

These methods interact with the GUI in various different ways depending on how & when they're used.

WidgetInputHandler_EnableInput(bool)

Set whether or not UI widgets should process user input. Takes a boolean.

⚠️ **GitHub.com Fallback** ⚠️