ShowTextInputMenu
Revision as of 20:12, 7 November 2015 by imported>Jazzisparis (Created page with "{{Function |origin = JIP |summary = Opens a text input message box, enabling to type in text (using the keyboard, obviously). The function takes three parameters: the <i>wid...")
< [[::Category:Functions|Category:Functions]]
A function added by the JIP NVSE Plugin.
Description
Opens a text input message box, enabling to type in text (using the keyboard, obviously). The function takes three parameters: the width and height (in pixels) of the message box, and a formatted string that will be used as the title and displayed at the top.
Once the message box is closed (clicking the OK button), the text may be retrieved:
GetTextInputReady will return true if there is a pending text ready to be retrieved.
GetTextInputString will return a string_var containing the text.
Syntax
ShowTextInputMenu msgBoxWidth:float msgBoxHeight:float msgBoxTitle:formattedString formatVars(up to 20)
Example
ShowTextInputMenu 700 500 "Please type in text below:" (...) if GetTextInputReady let sInputText := GetTextInputString endif
Notes
- The text is kept internally in a buffer until GetTextInputString is called, when it is cleared. The same text cannot be retrieved twice. The buffer will also be cleared every time this function is called.
- The maximum length of the text is automatically adjusted to fit in the space bounded by the message box (and is therefore determined by the width/height parameters).
- messageText supports string formatting, and up to 20 variables may be used.