Class MultiLineEditBox
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractScrollArea
net.minecraft.client.gui.components.AbstractTextAreaWidget
net.minecraft.client.gui.components.MultiLineEditBox
- All Implemented Interfaces:
GuiEventListener,Renderable,TabOrderedElement,LayoutElement,NarratableEntry,NarrationSupplier,IAbstractWidgetExtension
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final intprivate static final intprivate static final intprivate final intprivate longprivate final Fontprivate final Componentprivate static final intprivate static final intprivate final intprivate final MultilineTextFieldprivate final booleanFields inherited from class net.minecraft.client.gui.components.AbstractTextAreaWidget
DEFAULT_TOTAL_PADDINGFields inherited from class net.minecraft.client.gui.components.AbstractScrollArea
SCROLLBAR_WIDTHFields inherited from class net.minecraft.client.gui.components.AbstractWidget
active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, widthFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
ConstructorsConstructorDescriptionMultiLineEditBox(Font font, int x, int y, int width, int height, Component placeholder, Component message, int textColor, boolean textShadow, int cursorColor, boolean showBackground, boolean showDecorations) -
Method Summary
Modifier and TypeMethodDescriptionstatic MultiLineEditBox.Builderbuilder()booleancharTyped(char codePoint, int modifiers) Called when a character is typed within the GUI element.intgetValue()booleankeyPressed(int keyCode, int scanCode, int modifiers) Called when a keyboard key is pressed within the GUI element.voidonClick(double mouseX, double mouseY) protected voidonDrag(double mouseX, double mouseY, double dragX, double dragY) protected voidrenderContents(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) protected voidrenderDecorations(GuiGraphics guiGraphics) protected doubleprivate voidprivate voidseekCursorScreen(double mouseX, double mouseY) voidsetCharacterLimit(int characterLimit) voidsetFocused(boolean focused) Sets the focus state of the GUI element.voidsetLineLimit(int lineLimit) voidvoidvoidsetValueListener(Consumer<String> valueListener) voidupdateWidgetNarration(NarrationElementOutput narrationElementOutput) Methods inherited from class net.minecraft.client.gui.components.AbstractTextAreaWidget
contentHeight, getInnerLeft, getInnerTop, innerPadding, isMouseOver, mouseClicked, playDownSound, renderBackground, renderBorder, renderWidget, scrollBarX, totalInnerPadding, withinContentAreaTopBottomMethods inherited from class net.minecraft.client.gui.components.AbstractScrollArea
maxScrollAmount, mouseDragged, mouseScrolled, onRelease, refreshScrollAmount, renderScrollbar, scrollAmount, scrollbarVisible, scrollBarY, scrollerHeight, setScrollAmount, updateScrollingMethods inherited from class net.minecraft.client.gui.components.AbstractWidget
clearFGColor, createNarrationMessage, defaultButtonNarrationText, getBottom, getFGColor, getHeight, getMessage, getRectangle, getRight, getTabOrderGroup, getWidth, getX, getY, isActive, isFocused, isHovered, isHoveredOrFocused, isValidClickButton, mouseReleased, narrationPriority, nextFocusPath, playButtonClickSound, render, renderScrollingString, renderScrollingString, renderScrollingString, setAlpha, setFGColor, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getBorderForArrowNavigation, getCurrentFocusPath, keyReleased, mouseMovedMethods inherited from interface net.neoforged.neoforge.client.extensions.IAbstractWidgetExtension
onClickMethods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPositionMethods inherited from interface net.minecraft.client.gui.narration.NarratableEntry
getNarratables
-
Field Details
-
CURSOR_INSERT_WIDTH
private static final int CURSOR_INSERT_WIDTH- See Also:
-
CURSOR_COLOR
private static final int CURSOR_COLOR- See Also:
-
CURSOR_APPEND_CHARACTER
- See Also:
-
TEXT_COLOR
private static final int TEXT_COLOR- See Also:
-
PLACEHOLDER_TEXT_COLOR
private static final int PLACEHOLDER_TEXT_COLOR- See Also:
-
CURSOR_BLINK_INTERVAL_MS
private static final int CURSOR_BLINK_INTERVAL_MS- See Also:
-
font
-
placeholder
-
textField
-
textColor
private final int textColor -
textShadow
private final boolean textShadow -
cursorColor
private final int cursorColor -
focusedTime
private long focusedTime
-
-
Constructor Details
-
MultiLineEditBox
-
-
Method Details
-
setCharacterLimit
public void setCharacterLimit(int characterLimit) -
setLineLimit
public void setLineLimit(int lineLimit) -
setValueListener
-
setValue
-
setValue
-
getValue
-
updateWidgetNarration
- Specified by:
updateWidgetNarrationin classAbstractWidget
-
onClick
public void onClick(double mouseX, double mouseY) - Overrides:
onClickin classAbstractWidget
-
onDrag
protected void onDrag(double mouseX, double mouseY, double dragX, double dragY) - Overrides:
onDragin classAbstractWidget
-
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers) Called when a keyboard key is pressed within the GUI element.- Specified by:
keyPressedin interfaceGuiEventListener- Overrides:
keyPressedin classAbstractTextAreaWidget- Parameters:
keyCode- the key code of the pressed key.scanCode- the scan code of the pressed key.modifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
charTyped
public boolean charTyped(char codePoint, int modifiers) Called when a character is typed within the GUI element.- Parameters:
codePoint- the code point of the typed character.modifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
renderContents
- Specified by:
renderContentsin classAbstractTextAreaWidget
-
renderDecorations
- Overrides:
renderDecorationsin classAbstractTextAreaWidget
-
getInnerHeight
public int getInnerHeight()- Specified by:
getInnerHeightin classAbstractTextAreaWidget
-
scrollRate
protected double scrollRate()- Specified by:
scrollRatein classAbstractScrollArea
-
scrollToCursor
private void scrollToCursor() -
seekCursorScreen
private void seekCursorScreen(double mouseX, double mouseY) -
setFocused
public void setFocused(boolean focused) Sets the focus state of the GUI element.- Specified by:
setFocusedin interfaceGuiEventListener- Overrides:
setFocusedin classAbstractWidget- Parameters:
focused-trueto apply focus,falseto remove focus
-
builder
-