UI.SimpleTextInput

From Nomad DB
UISimpleTextInput.png

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, maxCharacters])
  • title: string (Title Text)
  • callback: function (success: boolean, text: string)
  • infoText: string (optional) Text below the Input field
  • maxCharacters: number (optional) Maximum allowed characters (default: 99)

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