Displays a pop-up message for the user to input a string.


GML Code Example

get_string(str, def);

Argument Description
str The string to show in the pop-up message.
def The default string in the text box.

Returns: String


This creates a pop-up window showing a standard message, with a button labeled "Ok", that prompts the user to input a string. The function will return the input string, or the default value if nothing has been entered.

NOTE: THIS FUNCTION IS FOR DEBUG USE ONLY. Should you require this functionality in your final game, please use get_string_async.


GML Code Example

global.test_name = get_string("Test highscore name:", "Anonymous");

The above code will prompt the user to give a name which will then be stored in the global variable "test_name". If nothing is entered and the user just presses "Ok" then the default value,"Anonymous", will be returned.

Back: Debugging
Next: show_error

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here