Difference between revisions of "UI.SimpleTextInput"
From Nomad DB
(Created page with "Shows a UI dialog which allows the user to enter text. The input can be confirmed by pressing Enter, the dialog can be closed with ESC key. == Syntax == <syntaxhighlight lang...") |
(No difference)
|
Revision as of 21:59, 2 August 2020
Shows a UI dialog which allows the user to enter text. The input can be confirmed by pressing Enter, the dialog can be closed with ESC key.
Syntax
UI.SimpleTextInput(title, callback[, infoText])
- title: string (Title Text)
- callback: function (success: boolean, text: string)
- infoText: string (optional) Text below the Input field
If the dialog was canceled by the user, success is false and text is 'nil'. The dialog is automatically cancelled if the user opens the Console or any other UI menus.
Example
UI.SimpleTextInput("Enter your name", function(success, text)
if success then
print("Your name is: ", text)
else
print("Dialog was canceled")
end
end)