public abstract class GuiComponentTextBox extends BaseComponent
Modifier and Type | Field and Description |
---|---|
protected int |
height |
protected net.minecraft.client.gui.widget.TextFieldWidget |
textField |
protected int |
width |
fontRenderer, keyboardEventListener, mouseEventListener, parent, toolTip, xPos, yPos
Constructor and Description |
---|
GuiComponentTextBox(GuiBase<?> parent,
int x,
int y,
int boxWidth,
int boxHeight,
java.lang.String defaultLabel)
Creates the text box
|
Modifier and Type | Method and Description |
---|---|
boolean |
charTyped(char letter,
int keyCode)
Used when a key is pressed
|
protected abstract void |
fieldUpdated(java.lang.String value)
Called when the value in the text box changes
|
int |
getHeight()
Used to find how tall this is
|
net.minecraft.client.gui.widget.TextFieldWidget |
getTextField()
Accessors/Mutators *
|
int |
getWidth()
Used to find how wide this is
|
boolean |
mouseClicked(double x,
double y,
int button)
Called when the mouse is pressed
|
void |
render(int guiLeft,
int guiTop,
int mouseX,
int mouseY)
Called to render the component
|
void |
renderOverlay(int guiLeft,
int guiTop,
int mouseX,
int mouseY)
Called after base render, is already translated to guiLeft and guiTop, just move offset
|
void |
setTextField(net.minecraft.client.gui.widget.TextFieldWidget textField) |
getArea, getDynamicToolTip, getKeyboardEventListener, getMouseEventListener, getParent, getToolTip, getXPos, getYPos, isMouseOver, keyTyped, mouseDown, mouseDrag, mouseScrolled, mouseUp, renderToolTip, setKeyboardEventListener, setMouseEventListener, setParent, setToolTip, setXPos, setYPos
addButton, children, getMinecraft, getNarrationMessage, getTitle, getTooltipFromItem, handleComponentClicked, hasAltDown, hasControlDown, hasShiftDown, init, init, insertText, isCopy, isCut, isMouseOver, isPaste, isPauseScreen, isSelectAll, isValidCharacterForName, keyPressed, onClose, removed, render, renderBackground, renderBackground, renderComponentHoverEffect, renderDirtBackground, renderTooltip, renderTooltip, renderTooltip, renderTooltip, resize, sendMessage, sendMessage, setSize, shouldCloseOnEsc, tick, wrapScreenError
getFocused, isDragging, setDragging, setFocused
blit, blit, blit, blit, blit, drawCenteredString, drawRightAlignedString, drawString, fill, fillGradient, hLine, innerBlit, vLine
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected int width
protected int height
protected net.minecraft.client.gui.widget.TextFieldWidget textField
public GuiComponentTextBox(GuiBase<?> parent, int x, int y, int boxWidth, int boxHeight, @Nullable java.lang.String defaultLabel)
parent
- The parent guix
- The x posy
- The y posboxWidth
- The text box widthboxHeight
- The text box height, usually 16defaultLabel
- The default label, will translate, can be nullprotected abstract void fieldUpdated(java.lang.String value)
value
- The current valuepublic boolean mouseClicked(double x, double y, int button)
x
- Mouse X Positiony
- Mouse Y Positionbutton
- Mouse Buttonpublic boolean charTyped(char letter, int keyCode)
letter
- The letterkeyCode
- The codepublic void render(int guiLeft, int guiTop, int mouseX, int mouseY)
render
in class BaseComponent
public void renderOverlay(int guiLeft, int guiTop, int mouseX, int mouseY)
renderOverlay
in class BaseComponent
public int getWidth()
getWidth
in class BaseComponent
public int getHeight()
getHeight
in class BaseComponent
public net.minecraft.client.gui.widget.TextFieldWidget getTextField()
public void setTextField(net.minecraft.client.gui.widget.TextFieldWidget textField)