Class TextField


  • public class TextField
    extends GameObject
    Class that represents a textfield in the 2d or 3d world
    Author:
    Darius Dinger
    • Constructor Detail

      • TextField

        public TextField​(GUIPane parent,
                         String font)
        Parameters:
        parent - Parent pane of the text field
        font - Initial font of the text field
    • Method Detail

      • onUpdate

        public void onUpdate()
        Description copied from class: GameObject
        This method gets called every frame before the render method. Here is place for the GameObject logic updates, e.g. input handling, physics, actions, ...
        Overrides:
        onUpdate in class GameObject
      • setText

        public void setText​(String text)
        Parameters:
        text - New text of the text field
      • getActiveColor

        public Color getActiveColor()
        Returns:
        Read/Writeablecolor of this textfield when its active
      • getBackgroundColor

        public Color getBackgroundColor()
        Returns:
        Read/Writeable color of this textfield when its not active
      • getText

        public String getText()
        Returns:
        Current text of the textfield
      • setCursor

        public void setCursor​(String cursor)
        Parameters:
        cursor - New cursor of the textfield
      • getPane

        public GUIPane getPane()
        Returns:
        GUIPane of the text field
      • onRender

        public void onRender()
        Description copied from class: GameObject
        In this method the GameObject gets rendered onto the screen (if it has an graphical representation). Its primary used for MasterRenderer calls.
        Overrides:
        onRender in class GameObject
      • setListener

        public void setListener​(TextFieldListener listener)
        Parameters:
        listener - New listener of the textfield or null to remove listener
      • setFilter

        public void setFilter​(Set<String> filter)
        Parameters:
        filter - Setting filter for the textfield or null to remove filter