Class GuiTextField

  • Direct Known Subclasses:
    GuiPasswordTextField

    public class GuiTextField
    extends Gui
    + This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. NOT FOR COMMERCIAL OR MALICIOUS USE (please read the 'LICENSE' file this repo's root directory for more info)
    • Field Detail

      • xPosition

        public int xPosition
      • yPosition

        public int yPosition
      • text

        protected java.lang.String text
        + Has the current text being edited on the textbox.
    • Constructor Detail

      • GuiTextField

        public GuiTextField​(int componentId,
                            FontRenderer fontrendererObj,
                            int x,
                            int y,
                            int par5Width,
                            int par6Height)
    • Method Detail

      • updateCursorCounter

        public void updateCursorCounter()
        + Increments the cursor counter
      • setText

        public void setText​(java.lang.String parString1)
        + Sets the text of the textbox
      • updateText

        public void updateText​(java.lang.String parString1)
      • getText

        public java.lang.String getText()
        + Returns the contents of the textbox
      • getSelectedText

        public java.lang.String getSelectedText()
        + returns the text between the cursor and selectionEnd
      • func_175205_a

        public void func_175205_a​(Predicate<java.lang.String> parPredicate)
      • writeText

        public void writeText​(java.lang.String parString1)
        + replaces selected text, or inserts text at the position on the cursor
      • deleteWords

        public void deleteWords​(int parInt1)
        + Deletes the specified number of words starting at the cursor position. Negative numbers will delete words left of the cursor.
      • deleteFromCursor

        public void deleteFromCursor​(int parInt1)
        + delete the selected text, otherwsie deletes characters from either side of the cursor. params: delete num
      • getId

        public int getId()
      • getNthWordFromCursor

        public int getNthWordFromCursor​(int parInt1)
        + see @getNthNextWordFromPos() params: N, position
      • getNthWordFromPos

        public int getNthWordFromPos​(int parInt1,
                                     int parInt2)
        + gets the position of the nth word. N may be negative, then it looks backwards. params: N, position
      • func_146197_a

        public int func_146197_a​(int parInt1,
                                 int parInt2,
                                 boolean parFlag)
      • moveCursorBy

        public void moveCursorBy​(int parInt1)
        + Moves the text cursor by a specified number of characters and clears the selection
      • setCursorPosition

        public void setCursorPosition​(int parInt1)
        + sets the position of the cursor to the provided index
      • setCursorPositionZero

        public void setCursorPositionZero()
        + sets the cursors position to the beginning
      • setCursorPositionEnd

        public void setCursorPositionEnd()
        + sets the cursors position to after the text
      • textboxKeyTyped

        public boolean textboxKeyTyped​(char parChar1,
                                       int parInt1)
        + Call this method from your GuiScreen to process the keys into the textbox
      • mouseClicked

        public void mouseClicked​(int parInt1,
                                 int parInt2,
                                 int parInt3)
        + Args: x, y, buttonClicked
      • drawTextBox

        public void drawTextBox()
        + Draws the textbox
      • setMaxStringLength

        public void setMaxStringLength​(int parInt1)
      • getMaxStringLength

        public int getMaxStringLength()
        + returns the maximum number of character that can be contained in this textbox
      • getCursorPosition

        public int getCursorPosition()
        + returns the current position of the cursor
      • getEnableBackgroundDrawing

        public boolean getEnableBackgroundDrawing()
        + get enable drawing background and outline
      • setEnableBackgroundDrawing

        public void setEnableBackgroundDrawing​(boolean parFlag)
        + enable drawing background and outline
      • setTextColor

        public void setTextColor​(int parInt1)
        + Sets the text colour for this textbox (disabled text will not use this colour)
      • setDisabledTextColour

        public void setDisabledTextColour​(int parInt1)
      • setFocused

        public void setFocused​(boolean parFlag)
        + Sets focus to this gui element
      • isFocused

        public boolean isFocused()
        + Getter for the focused field
      • setEnabled

        public void setEnabled​(boolean parFlag)
      • getSelectionEnd

        public int getSelectionEnd()
        + the side of the selection that is not the cursor, may be the same as the cursor
      • getWidth

        public int getWidth()
        + returns the width of the textbox depending on if background drawing is enabled
      • setSelectionPos

        public void setSelectionPos​(int parInt1)
        + Sets the position of the selection anchor (i.e. position the selection was started at)
      • setCanLoseFocus

        public void setCanLoseFocus​(boolean parFlag)
        + if true the textbox can lose focus by clicking elsewhere on the screen
      • getVisible

        public boolean getVisible()
        + returns true if this textbox is visible
      • setVisible

        public void setVisible​(boolean parFlag)
        + Sets whether or not this textbox is visible