GM: get string

From GMpedia.org Wiki

Jump to: navigation, search

get_string
 

Type: function
Arguments: 1: display text
2: default string value
Limitations: none
The correct title of this article is get_string(). It appears incorrectly here because of technical restrictions.

The Game Maker get_string function prompts the user for a string and returns that string. If the user doesn't enter any text, an empty string is returned.

[edit] Example

userstr=get_string("Enter the string here","");

This piece of code displays a default GM dialog box with the text "Enter the string here" and no default value for the input string. When the user enters a string and clicks the OK button, then the value of that string will be put into the variable userstr.


[edit] See Also

Personal tools