get_integer

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

Syntax:

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:

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
© Copyright YoYo Games Ltd. 2018 All Rights Reserved