ShowTextInputMenu

From GECK
Jump to: navigation, search


A function added by the JIP NVSE Plugin.

Description

Opens a text input message box, enabling typing in text (using the keyboard, obviously).

The function takes four arguments:

  • callbackScript - A UDF Script that shall be invoked once the OK button is pressed and the message box is closed. The script is passed with a single argument - a string_var containing the typed in text (see example script, below).
  • msgBoxWidth - The pixel width of the message box.
  • msgBoxHeight - The pixel height of the message box.
  • msgBoxTitle - A formatted string that shall be used as the title text of the message box, displayed at its top.

Syntax

[help]
(success:0/1) ShowTextInputMenu callbackScript:ref msgBoxWidth:float msgBoxHeight:float msgBoxTitle:formattedString formatVars(up to 20)

Example

ShowTextInputMenu TextInputUDF 700 500 "Please type in text below:" 

Callback Script

A skeleton script for a callback:

scn	TextInputUDF

string_var	sTextInput

begin Function {sTextInput}

	(code)

	sv_Destruct sTextInput

end

Notes

  • By default, the color of the input text is white, but it can be changed by using the following code after calling the menu:
SetUIFloatAlt "TextEditMenu/NOGLOW_BRANCH/TEM_TextInputBox/TEM_InputText/red" iRed
SetUIFloatAlt "TextEditMenu/NOGLOW_BRANCH/TEM_TextInputBox/TEM_InputText/green" iGreen
SetUIFloatAlt "TextEditMenu/NOGLOW_BRANCH/TEM_TextInputBox/TEM_InputText/blue" iBlue

See Also