Package net.minecraft.src
Class GuiTextField
java.lang.Object
net.minecraft.src.Gui
net.minecraft.src.GuiTextField
-
Field Summary
Fields inherited from class net.minecraft.src.Gui
icons, optionsBackground, statIcons, zLevel -
Constructor Summary
ConstructorsConstructorDescriptionGuiTextField(FontRenderer par1FontRenderer, int par2, int par3, int par4, int par5) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteFromCursor(int par1) delete the selected text, otherwsie deletes characters from either side of the cursor. params: delete numvoiddeleteWords(int par1) Deletes the specified number of words starting at the cursor position.voidDraws the textboxintfunc_73798_a(int par1, int par2, boolean par3) intreturns the current position of the cursorbooleanget enable drawing background and outlinebooleanintreturns the maximum number of character that can be contained in this textboxintgetNthWordFromCursor(int par1) see @getNthNextWordFromPos() params: N, positionintgetNthWordFromPos(int par1, int par2) gets the position of the nth word.intthe side of the selection that is not the cursor, maye be the same as the cursorgetText()Returns the text beign edited on the textbox.booleanintgetWidth()returns the width of the textbox depending on if the the box is enabledbooleangetter for the focused fieldvoidmouseClicked(int par1, int par2, int par3) Args: x, y, buttonClickedvoidmoveCursorBy(int par1) Moves the text cursor by a specified number of characters and clears the selectionvoidsetCanLoseFocus(boolean par1) if true the textbox can lose focus by clicking elsewhere on the screenvoidsetCursorPosition(int par1) sets the position of the cursor to the provided indexvoidsets the cursors position to after the textvoidsets the cursors position to the beginningvoidsetDisabledTextColour(int par1) voidsetEnableBackgroundDrawing(boolean par1) enable drawing background and outlinevoidsetEnabled(boolean par1) voidsetFocused(boolean par1) setter for the focused fieldvoidsetMaxStringLength(int par1) voidsetSelectionPos(int par1) Sets the position of the selection anchor (i.e. position the selection was started at)voidSets the text of the textbox.voidsetTextColor(int par1) Sets the text colour for this textbox (disabled text will not use this colour)voidsetVisible(boolean par1) Sets whether or not this textbox is visiblebooleantextboxKeyTyped(char par1, int par2) Call this method from you GuiScreen to process the keys into textbox.voidIncrements the cursor countervoidreplaces selected text, or inserts text at the position on the cursorMethods inherited from class net.minecraft.src.Gui
drawCenteredString, drawGradientRect, drawHorizontalLine, drawRect, drawString, drawTexturedModalRect, drawTexturedModelRectFromIcon, drawVerticalLine
-
Constructor Details
-
GuiTextField
-
-
Method Details
-
updateCursorCounter
public void updateCursorCounter()Increments the cursor counter -
setText
Sets the text of the textbox. -
getText
Returns the text beign edited on the textbox. -
getSelectedtext
- Returns:
- returns the text between the cursor and selectionEnd
-
writeText
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:
trueif this textbox is visible
-
setVisible
public void setVisible(boolean par1) Sets whether or not this textbox is visible -
getIsEnabled
public boolean getIsEnabled()
-