Package net.minecraft.client.gui.widget
Class TextFieldWidget
java.lang.Object
net.minecraft.client.gui.AbstractGui
net.minecraft.client.gui.widget.Widget
net.minecraft.client.gui.widget.TextFieldWidget
- All Implemented Interfaces:
IGuiEventListener
,IRenderable
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private boolean
private int
private int
private final FontRenderer
private BiFunction<String,
Integer, IReorderingProcessor> private int
private int
private boolean
private int
private boolean
private String
private int
private int
private String
Fields inherited from class net.minecraft.client.gui.widget.Widget
active, alpha, height, isHovered, nextNarration, packedFGColor, UNSET_FG_COLOR, visible, WIDGETS_LOCATION, width, x, y
Fields inherited from class net.minecraft.client.gui.AbstractGui
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATION
-
Constructor Summary
ConstructorDescriptionTextFieldWidget
(FontRenderer p_i232259_1_, int p_i232259_2_, int p_i232259_3_, int p_i232259_4_, int p_i232259_5_, TextFieldWidget p_i232259_6_, ITextComponent p_i232259_7_) TextFieldWidget
(FontRenderer p_i232260_1_, int p_i232260_2_, int p_i232260_3_, int p_i232260_4_, int p_i232260_5_, ITextComponent p_i232260_6_) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
changeFocus
(boolean p_231049_1_) boolean
charTyped
(char p_231042_1_, int p_231042_2_) protected IFormattableTextComponent
void
deleteChars
(int p_146175_1_) private void
deleteText
(int p_212950_1_) void
deleteWords
(int p_146177_1_) private int
getCursorPos
(int p_238516_1_) int
int
private int
int
getScreenX
(int p_195611_1_) getValue()
int
getWordPosition
(int p_146187_1_) private int
getWordPosition
(int p_146183_1_, int p_146183_2_) private int
getWordPosition
(int p_146197_1_, int p_146197_2_, boolean p_146197_3_) void
insertText
(String p_146191_1_) private boolean
private boolean
boolean
isMouseOver
(double p_231047_1_, double p_231047_3_) boolean
boolean
keyPressed
(int p_231046_1_, int p_231046_2_, int p_231046_3_) boolean
mouseClicked
(double p_231044_1_, double p_231044_3_, int p_231044_5_) void
moveCursor
(int p_146182_1_) void
moveCursorTo
(int p_146190_1_) void
void
protected void
onFocusedChanged
(boolean p_230995_1_) private void
onValueChange
(String p_212951_1_) void
renderButton
(MatrixStack p_230431_1_, int p_230431_2_, int p_230431_3_, float p_230431_4_) private void
renderHighlight
(int p_146188_1_, int p_146188_2_, int p_146188_3_, int p_146188_4_) void
setBordered
(boolean p_146185_1_) void
setCanLoseFocus
(boolean p_146205_1_) void
setCursorPosition
(int p_212422_1_) void
setEditable
(boolean p_146184_1_) void
void
setFocus
(boolean p_146195_1_) void
setFormatter
(BiFunction<String, Integer, IReorderingProcessor> p_195607_1_) void
setHighlightPos
(int p_146199_1_) void
setMaxLength
(int p_146203_1_) void
setResponder
(Consumer<String> p_212954_1_) void
setSuggestion
(String p_195612_1_) void
setTextColor
(int p_146193_1_) void
setTextColorUneditable
(int p_146204_1_) void
void
setVisible
(boolean p_146189_1_) void
setX
(int p_212952_1_) void
tick()
Methods inherited from class net.minecraft.client.gui.widget.Widget
clearFGColor, clicked, getFGColor, getHeight, getMessage, getWidth, getYImage, isFocused, isHovered, isValidClickButton, mouseDragged, mouseReleased, narrate, onClick, onDrag, onRelease, playDownSound, queueNarration, render, renderBg, renderToolTip, setAlpha, setFGColor, setFocused, setHeight, setMessage, setWidth
Methods inherited from class net.minecraft.client.gui.AbstractGui
blit, blit, blit, blit, blit, blitOutlineBlack, drawCenteredString, drawCenteredString, drawString, drawString, fill, fillGradient, fillGradient, getBlitOffset, hLine, setBlitOffset, vLine
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.client.gui.IGuiEventListener
keyReleased, mouseDragged, mouseMoved, mouseReleased, mouseScrolled
Methods inherited from interface net.minecraft.client.gui.IRenderable
render
-
Field Details
-
font
-
value
-
maxLength
private int maxLength -
frame
private int frame -
bordered
private boolean bordered -
canLoseFocus
private boolean canLoseFocus -
isEditable
private boolean isEditable -
shiftPressed
private boolean shiftPressed -
displayPos
private int displayPos -
cursorPos
private int cursorPos -
highlightPos
private int highlightPos -
textColor
private int textColor -
textColorUneditable
private int textColorUneditable -
suggestion
-
responder
-
filter
-
formatter
-
-
Constructor Details
-
TextFieldWidget
public TextFieldWidget(FontRenderer p_i232260_1_, int p_i232260_2_, int p_i232260_3_, int p_i232260_4_, int p_i232260_5_, ITextComponent p_i232260_6_) -
TextFieldWidget
public TextFieldWidget(FontRenderer p_i232259_1_, int p_i232259_2_, int p_i232259_3_, int p_i232259_4_, int p_i232259_5_, @Nullable TextFieldWidget p_i232259_6_, ITextComponent p_i232259_7_)
-
-
Method Details
-
setResponder
-
setFormatter
-
tick
public void tick() -
createNarrationMessage
- Overrides:
createNarrationMessage
in classWidget
-
setValue
-
getValue
-
getHighlighted
-
setFilter
-
insertText
-
onValueChange
-
deleteText
private void deleteText(int p_212950_1_) -
deleteWords
public void deleteWords(int p_146177_1_) -
deleteChars
public void deleteChars(int p_146175_1_) -
getWordPosition
public int getWordPosition(int p_146187_1_) -
getWordPosition
private int getWordPosition(int p_146183_1_, int p_146183_2_) -
getWordPosition
private int getWordPosition(int p_146197_1_, int p_146197_2_, boolean p_146197_3_) -
moveCursor
public void moveCursor(int p_146182_1_) -
getCursorPos
private int getCursorPos(int p_238516_1_) -
moveCursorTo
public void moveCursorTo(int p_146190_1_) -
setCursorPosition
public void setCursorPosition(int p_212422_1_) -
moveCursorToStart
public void moveCursorToStart() -
moveCursorToEnd
public void moveCursorToEnd() -
keyPressed
public boolean keyPressed(int p_231046_1_, int p_231046_2_, int p_231046_3_) - Specified by:
keyPressed
in interfaceIGuiEventListener
-
canConsumeInput
public boolean canConsumeInput() -
charTyped
public boolean charTyped(char p_231042_1_, int p_231042_2_) - Specified by:
charTyped
in interfaceIGuiEventListener
-
mouseClicked
public boolean mouseClicked(double p_231044_1_, double p_231044_3_, int p_231044_5_) - Specified by:
mouseClicked
in interfaceIGuiEventListener
- Overrides:
mouseClicked
in classWidget
-
setFocus
public void setFocus(boolean p_146195_1_) -
renderButton
public void renderButton(MatrixStack p_230431_1_, int p_230431_2_, int p_230431_3_, float p_230431_4_) - Overrides:
renderButton
in classWidget
-
renderHighlight
private void renderHighlight(int p_146188_1_, int p_146188_2_, int p_146188_3_, int p_146188_4_) -
setMaxLength
public void setMaxLength(int p_146203_1_) -
getMaxLength
private int getMaxLength() -
getCursorPosition
public int getCursorPosition() -
isBordered
private boolean isBordered() -
setBordered
public void setBordered(boolean p_146185_1_) -
setTextColor
public void setTextColor(int p_146193_1_) -
setTextColorUneditable
public void setTextColorUneditable(int p_146204_1_) -
changeFocus
public boolean changeFocus(boolean p_231049_1_) - Specified by:
changeFocus
in interfaceIGuiEventListener
- Overrides:
changeFocus
in classWidget
-
isMouseOver
public boolean isMouseOver(double p_231047_1_, double p_231047_3_) - Specified by:
isMouseOver
in interfaceIGuiEventListener
- Overrides:
isMouseOver
in classWidget
-
onFocusedChanged
protected void onFocusedChanged(boolean p_230995_1_) - Overrides:
onFocusedChanged
in classWidget
-
isEditable
private boolean isEditable() -
setEditable
public void setEditable(boolean p_146184_1_) -
getInnerWidth
public int getInnerWidth() -
setHighlightPos
public void setHighlightPos(int p_146199_1_) -
setCanLoseFocus
public void setCanLoseFocus(boolean p_146205_1_) -
isVisible
public boolean isVisible() -
setVisible
public void setVisible(boolean p_146189_1_) -
setSuggestion
-
getScreenX
public int getScreenX(int p_195611_1_) -
setX
public void setX(int p_212952_1_)
-