Class MultiLineEditBox
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractScrollWidget
net.minecraft.client.gui.components.MultiLineEditBox
- All Implemented Interfaces:
GuiEventListener,Renderable,TabOrderedElement,LayoutElement,NarratableEntry,NarrationSupplier,IAbstractWidgetExtension
-
Nested Class Summary
Nested 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 longprivate final Fontprivate final Componentprivate static final intprivate static final intprivate final MultilineTextFieldFields 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 pFont, int pX, int pY, int pWidth, int pHeight, Component pPlaceholder, Component pMessage) -
Method Summary
Modifier and TypeMethodDescriptionbooleancharTyped(char pCodePoint, int pModifiers) Called when a character is typed within the GUI element.private doubleintgetValue()booleankeyPressed(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is pressed within the GUI element.booleanmouseClicked(double pMouseX, double pMouseY, int pButton) Called when a mouse button is clicked within the GUI element.booleanmouseDragged(double pMouseX, double pMouseY, int pButton, double pDragX, double pDragY) Called when the mouse is dragged within the GUI element.protected voidrenderContents(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) protected voidrenderDecorations(GuiGraphics pGuiGraphics) private voidrenderHighlight(GuiGraphics pGuiGraphics, int pMinX, int pMinY, int pMaxX, int pMaxY) protected booleanprotected doubleprivate voidprivate voidseekCursorScreen(double pMouseX, double pMouseY) voidsetCharacterLimit(int pCharacterLimit) voidsetFocused(boolean pFocused) Sets the focus state of the GUI element.voidvoidsetValueListener(Consumer<String> pValueListener) voidupdateWidgetNarration(NarrationElementOutput pNarrationElementOutput) Methods inherited from class net.minecraft.client.gui.components.AbstractScrollWidget
getMaxScrollAmount, innerPadding, mouseReleased, mouseScrolled, renderBackground, renderBorder, renderWidget, scrollAmount, scrollbarWidth, setScrollAmount, totalInnerPadding, withinContentAreaPoint, withinContentAreaTopBottomMethods inherited from class net.minecraft.client.gui.components.AbstractWidget
clearFGColor, clicked, createNarrationMessage, defaultButtonNarrationText, getBottom, getFGColor, getHeight, getMessage, getRectangle, getRight, getTabOrderGroup, getTooltip, getWidth, getX, getY, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, narrationPriority, nextFocusPath, onClick, onDrag, onRelease, playDownSound, 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
getCurrentFocusPath, getRectangle, isFocused, isMouseOver, keyReleased, mouseMoved, nextFocusPathMethods 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.components.Renderable
renderMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
CURSOR_INSERT_WIDTH
private static final int CURSOR_INSERT_WIDTH- See Also:
-
CURSOR_INSERT_COLOR
private static final int CURSOR_INSERT_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
-
focusedTime
private long focusedTime
-
-
Constructor Details
-
MultiLineEditBox
-
-
Method Details
-
setCharacterLimit
public void setCharacterLimit(int pCharacterLimit) -
setValueListener
-
setValue
-
getValue
-
updateWidgetNarration
- Specified by:
updateWidgetNarrationin classAbstractWidget
-
mouseClicked
public boolean mouseClicked(double pMouseX, double pMouseY, int pButton) Description copied from class:AbstractWidgetCalled when a mouse button is clicked within the GUI element.- Specified by:
mouseClickedin interfaceGuiEventListener- Overrides:
mouseClickedin classAbstractScrollWidget- Parameters:
pMouseX- the X coordinate of the mouse.pMouseY- the Y coordinate of the mouse.pButton- the button that was clicked.- Returns:
trueif the event is consumed,falseotherwise.
-
mouseDragged
public boolean mouseDragged(double pMouseX, double pMouseY, int pButton, double pDragX, double pDragY) Description copied from class:AbstractWidgetCalled when the mouse is dragged within the GUI element.- Specified by:
mouseDraggedin interfaceGuiEventListener- Overrides:
mouseDraggedin classAbstractScrollWidget- Parameters:
pMouseX- the X coordinate of the mouse.pMouseY- the Y coordinate of the mouse.pButton- the button that is being dragged.pDragX- the X distance of the drag.pDragY- the Y distance of the drag.- Returns:
trueif the event is consumed,falseotherwise.
-
keyPressed
public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is pressed within the GUI element.- Specified by:
keyPressedin interfaceGuiEventListener- Overrides:
keyPressedin classAbstractScrollWidget- Parameters:
pKeyCode- the key code of the pressed key.pScanCode- the scan code of the pressed key.pModifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
charTyped
public boolean charTyped(char pCodePoint, int pModifiers) Called when a character is typed within the GUI element.- Parameters:
pCodePoint- the code point of the typed character.pModifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
renderContents
protected void renderContents(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) - Specified by:
renderContentsin classAbstractScrollWidget
-
renderDecorations
- Overrides:
renderDecorationsin classAbstractScrollWidget
-
getInnerHeight
public int getInnerHeight()- Specified by:
getInnerHeightin classAbstractScrollWidget
-
scrollbarVisible
protected boolean scrollbarVisible()- Overrides:
scrollbarVisiblein classAbstractScrollWidget
-
scrollRate
protected double scrollRate()- Specified by:
scrollRatein classAbstractScrollWidget
-
renderHighlight
-
scrollToCursor
private void scrollToCursor() -
getDisplayableLineCount
private double getDisplayableLineCount() -
seekCursorScreen
private void seekCursorScreen(double pMouseX, double pMouseY) -
setFocused
public void setFocused(boolean pFocused) Sets the focus state of the GUI element.- Specified by:
setFocusedin interfaceGuiEventListener- Overrides:
setFocusedin classAbstractWidget- Parameters:
pFocused-trueto apply focus,falseto remove focus
-