DataInputScreen
This page talks about DataInputScreen class
DataInputScreen
The DataInputScreen class extends the Screen class and represents a screen that allows the user to enter a String value.
Fields
consumer: The consumer that accepts the entered data.textField: The text field widget for entering data.x,y: The position of the text field widget.parentScreen: The parent screen of this screen.DataInputOption: The data input option associated with this screen.
Constructors
DataInputScreen(Consumer<String> consumer, int x, int y, Screen parentScreen, ContextMenu.DataInputOption dataInputOption): Constructs a DataInputScreen object with the given consumer, position, parent screen and data input option.
Methods
init(): Initializes this screen by creating a text field widget for entering data.keyPressed(int keyCode, int scanCode, int modifiers): Handles key presses on this screen. Closes the screen and passes the entered data to the consumer when the Enter key is pressed.shouldPause(): Returns whether this screen should pause the game.