UI.SimpleTextInput

From Nomad DB
Revision as of 21:59, 2 August 2020 by Jan (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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)

Related Pages