Class AbstractTextAreaWidget
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractScrollArea
net.minecraft.client.gui.components.AbstractTextAreaWidget
- All Implemented Interfaces:
GuiEventListener,Renderable,TabOrderedElement,LayoutElement,NarratableEntry,NarrationSupplier,IAbstractWidgetExtension
- Direct Known Subclasses:
FittingMultiLineTextWidget,MultiLineEditBox,TelemetryEventWidget
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final WidgetSpritesstatic final intprivate static final intprivate booleanprivate booleanFields 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
ConstructorsConstructorDescriptionAbstractTextAreaWidget(int x, int y, int width, int height, Component message) AbstractTextAreaWidget(int x, int y, int width, int height, Component message, boolean showBackground, boolean showDecorations) -
Method Summary
Modifier and TypeMethodDescriptionprotected intprotected abstract intprotected intprotected intprotected intbooleanisMouseOver(double mouseX, double mouseY) Checks if the given mouse coordinates are over the GUI element.booleankeyPressed(int keyCode, int scanCode, int modifiers) Called when a keyboard key is pressed within the GUI element.booleanmouseClicked(double mouseX, double mouseY, int button) Called when a mouse button is clicked within the GUI element.voidplayDownSound(SoundManager handler) protected voidrenderBackground(GuiGraphics guiGraphics) protected voidrenderBorder(GuiGraphics guiGraphics, int x, int y, int width, int height) protected abstract voidrenderContents(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) protected voidrenderDecorations(GuiGraphics guiGraphics) voidrenderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) protected intprotected intprotected booleanwithinContentAreaTopBottom(int top, int bottom) Methods inherited from class net.minecraft.client.gui.components.AbstractScrollArea
maxScrollAmount, mouseDragged, mouseScrolled, onRelease, refreshScrollAmount, renderScrollbar, scrollAmount, scrollbarVisible, scrollBarY, scrollerHeight, scrollRate, 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, onClick, onDrag, playButtonClickSound, render, renderScrollingString, renderScrollingString, renderScrollingString, setAlpha, setFGColor, setFocused, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, updateWidgetNarration, 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
charTyped, 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
-
BACKGROUND_SPRITES
-
INNER_PADDING
private static final int INNER_PADDING- See Also:
-
DEFAULT_TOTAL_PADDING
public static final int DEFAULT_TOTAL_PADDING- See Also:
-
showBackground
private boolean showBackground -
showDecorations
private boolean showDecorations
-
-
Constructor Details
-
AbstractTextAreaWidget
-
AbstractTextAreaWidget
public AbstractTextAreaWidget(int x, int y, int width, int height, Component message, boolean showBackground, boolean showDecorations)
-
-
Method Details
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button) Description copied from class:AbstractWidgetCalled when a mouse button is clicked within the GUI element.- Specified by:
mouseClickedin interfaceGuiEventListener- Overrides:
mouseClickedin classAbstractWidget- Parameters:
mouseX- the X coordinate of the mouse.mouseY- the Y coordinate of the mouse.button- the button that was clicked.- Returns:
trueif the event is consumed,falseotherwise.
-
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers) Called when a keyboard key is pressed within the GUI element.- 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.
-
renderWidget
- Specified by:
renderWidgetin classAbstractWidget
-
renderDecorations
-
innerPadding
protected int innerPadding() -
totalInnerPadding
protected int totalInnerPadding() -
isMouseOver
public boolean isMouseOver(double mouseX, double mouseY) Description copied from class:AbstractWidgetChecks if the given mouse coordinates are over the GUI element.- Specified by:
isMouseOverin interfaceGuiEventListener- Overrides:
isMouseOverin classAbstractWidget- Parameters:
mouseX- the X coordinate of the mouse.mouseY- the Y coordinate of the mouse.- Returns:
trueif the mouse is over the GUI element,falseotherwise.
-
scrollBarX
protected int scrollBarX()- Overrides:
scrollBarXin classAbstractScrollArea
-
contentHeight
protected int contentHeight()- Specified by:
contentHeightin classAbstractScrollArea
-
renderBackground
-
renderBorder
-
withinContentAreaTopBottom
protected boolean withinContentAreaTopBottom(int top, int bottom) -
getInnerHeight
protected abstract int getInnerHeight() -
renderContents
protected abstract void renderContents(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) -
getInnerLeft
protected int getInnerLeft() -
getInnerTop
protected int getInnerTop() -
playDownSound
- Overrides:
playDownSoundin classAbstractWidget
-