get_integer

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

Syntax:

GML Code Example

get_integer(str, def);


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


Returns: Real


Description

This creates a pop-up window showing a custom message, with a button labeled "Ok", and prompts the user to input an integer value. The function will return the typed in integer, 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_integer_async.


Example:

GML Code Example

global.level = get_integer("Level to test?", 1);

The above code will display a message prompting the user to select a level for testing. The return value will be stored in the global variable "global.level".


Back: Debugging
Next: get_string



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