Package com.misc

Class StringInputListener

  • All Implemented Interfaces:
    com.badlogic.gdx.Input.TextInputListener

    public class StringInputListener
    extends java.lang.Object
    implements com.badlogic.gdx.Input.TextInputListener
    A class to produce a popup allowing the player to enter a string for the save name.
    Since:
    24/04/2020
    • Constructor Summary

      Constructors 
      Constructor Description
      StringInputListener​(SaveControls saveControls, com.badlogic.gdx.scenes.scene2d.ui.TextButton button, int saveNumber)
      The contructor of the input listener, gathers information that it can be called when the player has finished entering a string
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void canceled()
      Called if the player cancel's editing
      void input​(java.lang.String text)
      Called when the player finishes editing
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StringInputListener

        public StringInputListener​(SaveControls saveControls,
                                   com.badlogic.gdx.scenes.scene2d.ui.TextButton button,
                                   int saveNumber)
        The contructor of the input listener, gathers information that it can be called when the player has finished entering a string
        Parameters:
        saveControls - The save controls needed to change the save file name
        button - The button's text with the player's input
        saveNumber - The save number that is being modified
    • Method Detail

      • input

        public void input​(java.lang.String text)
        Called when the player finishes editing
        Specified by:
        input in interface com.badlogic.gdx.Input.TextInputListener
        Parameters:
        text - The string the player wrote
      • canceled

        public void canceled()
        Called if the player cancel's editing
        Specified by:
        canceled in interface com.badlogic.gdx.Input.TextInputListener