Class GuiTextField

java.lang.Object
net.minecraft.src.Gui
net.minecraft.src.GuiTextField

public class GuiTextField extends Gui
  • Constructor Details

    • GuiTextField

      public GuiTextField(FontRenderer par1FontRenderer, int par2, int par3, int par4, int par5)
  • Method Details

    • updateCursorCounter

      public void updateCursorCounter()
      Increments the cursor counter
    • setText

      public void setText(String par1Str)
      Sets the text of the textbox.
    • getText

      public String getText()
      Returns the text beign edited on the textbox.
    • getSelectedtext

      public String getSelectedtext()
      Returns:
      returns the text between the cursor and selectionEnd
    • writeText

      public void writeText(String par1Str)
      replaces selected text, or inserts text at the position on the cursor
    • deleteWords

      public void deleteWords(int par1)
      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 par1)
      delete the selected text, otherwsie deletes characters from either side of the cursor. params: delete num
    • getNthWordFromCursor

      public int getNthWordFromCursor(int par1)
      see @getNthNextWordFromPos() params: N, position
    • getNthWordFromPos

      public int getNthWordFromPos(int par1, int par2)
      gets the position of the nth word. N may be negative, then it looks backwards. params: N, position
    • func_73798_a

      public int func_73798_a(int par1, int par2, boolean par3)
    • moveCursorBy

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

      public void setCursorPosition(int par1)
      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 par1, int par2)
      Call this method from you GuiScreen to process the keys into textbox.
    • mouseClicked

      public void mouseClicked(int par1, int par2, int par3)
      Args: x, y, buttonClicked
    • drawTextBox

      public void drawTextBox()
      Draws the textbox
    • setMaxStringLength

      public void setMaxStringLength(int par1)
    • 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 par1)
      enable drawing background and outline
    • setTextColor

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

      public void setDisabledTextColour(int par1)
    • setFocused

      public void setFocused(boolean par1)
      setter for the focused field
    • isFocused

      public boolean isFocused()
      getter for the focused field
    • setEnabled

      public void setEnabled(boolean par1)
    • getSelectionEnd

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

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

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

      public void setCanLoseFocus(boolean par1)
      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 par1)
      Sets whether or not this textbox is visible
    • getIsEnabled

      public boolean getIsEnabled()