説明
The TextInput Lua function opens a text input pop-up and returns the typed input as a string. It is part of the user interface functions.
引数
- string (オプション):
This string is the title for the pop-up. The title bar has a default "Edit" text at the beginning of the title that cannot be removed.
- string (オプション):
This string is the text already in the input field - can be used to provide user guidance.
- integer (オプション):
This integer defines a position on the x-axis where the pop-up should appear (on all screens). "0" is on the left side of the screen. Nil or undefined is centered.
- integer (オプション):
This integer defines a position on the y-axis where the pop-up should appear (on all screens). "0" is at the top of the screen. Nil or undefined is centered.
戻り値
- string:
The returned user input.
例
To open a text input and print the entered value in the Command Line History, create a plugin with this code:
|
return function() local input = TextInput("This is the title","Please provide your input here") Printf("You entered this message: %s",tostring(input)) end |