Package net.minecraft.client.gui.widget
Class ScrollableWidget
java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.widget.ClickableWidget
net.minecraft.client.gui.widget.ScrollableWidget
- All Implemented Interfaces:
Drawable,Element,Narratable,Selectable
- Direct Known Subclasses:
EditBoxWidget
@Environment(CLIENT)
public abstract class ScrollableWidget
extends ClickableWidget
implements Drawable, Element
A widget that can be focused and vertically scrolled.
- Mappings:
Namespace Name official egqintermediary net/minecraft/class_7528named net/minecraft/client/gui/widget/ScrollableWidget
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.Selectable
Selectable.SelectionType -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate static final intprivate booleanprivate doubleprivate static final intFields inherited from class net.minecraft.client.gui.widget.ClickableWidget
active, alpha, height, hovered, visible, WIDGETS_TEXTURE, width, x, yFields inherited from class net.minecraft.client.gui.DrawableHelper
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTUREFields inherited from interface net.minecraft.client.gui.Element
MAX_DOUBLE_CLICK_INTERVAL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voiddrawBox(MatrixStack matrices) Draws the box that the contents are rendered over, including its borders.private voidprotected abstract intReturns the total height of the contents.private intprotected abstract doubleprotected intprotected intprotected intprivate intprotected doubleprotected booleanisVisible(int top, int bottom) protected booleanisWithinBounds(double mouseX, double mouseY) booleanmouseClicked(double mouseX, double mouseY, int button) Callback for when a mouse button down event has been captured.booleanmouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) Callback for when a mouse button drag event has been captured.booleanmouseReleased(double mouseX, double mouseY, int button) Callback for when a mouse button release event has been captured.booleanmouseScrolled(double mouseX, double mouseY, double amount) Callback for when a mouse button scroll event has been captured.protected abstract booleanReturns whether the contents overflow and needs a scrollbar.voidrenderButton(MatrixStack matrices, int mouseX, int mouseY, float delta) protected abstract voidrenderContents(MatrixStack matrices, int mouseX, int mouseY, float delta) Renders the scrolled contents.protected voidrenderOverlay(MatrixStack matrices) Renders overlays that are not scrolled but part of the widget.protected voidsetScrollY(double scrollY) Methods inherited from class net.minecraft.client.gui.widget.ClickableWidget
appendDefaultNarrations, changeFocus, clicked, getHeight, getMessage, getNarrationMessage, getNarrationMessage, getType, getWidth, getYImage, isFocused, isHovered, isMouseOver, isNarratable, isValidClickButton, onClick, onDrag, onFocusedChanged, onRelease, playDownSound, render, renderBackground, renderTooltip, setAlpha, setFocused, setMessage, setWidthMethods inherited from class net.minecraft.client.gui.DrawableHelper
disableScissor, drawCenteredText, drawCenteredText, drawCenteredTextWithShadow, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, drawWithOutline, drawWithShadow, enableScissor, fill, fillGradient, fillGradient, fillGradient, getZOffset, setZOffsetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.Element
changeFocus, charTyped, isMouseOver, keyPressed, keyReleased, mouseMovedMethods inherited from interface net.minecraft.client.gui.Narratable
appendNarrations
-
Field Details
-
FOCUSED_BORDER_COLOR
private static final int FOCUSED_BORDER_COLOR- See Also:
- Mappings:
Namespace Name Mixin selector official aLegq;a:Iintermediary field_39493Lnet/minecraft/class_7528;field_39493:Inamed FOCUSED_BORDER_COLORLnet/minecraft/client/gui/widget/ScrollableWidget;FOCUSED_BORDER_COLOR:I
-
UNFOCUSED_BORDER_COLOR
private static final int UNFOCUSED_BORDER_COLOR- See Also:
- Mappings:
Namespace Name Mixin selector official bLegq;b:Iintermediary field_39494Lnet/minecraft/class_7528;field_39494:Inamed UNFOCUSED_BORDER_COLORLnet/minecraft/client/gui/widget/ScrollableWidget;UNFOCUSED_BORDER_COLOR:I
-
BOX_COLOR
private static final int BOX_COLOR- See Also:
- Mappings:
Namespace Name Mixin selector official cLegq;c:Iintermediary field_39495Lnet/minecraft/class_7528;field_39495:Inamed BOX_COLORLnet/minecraft/client/gui/widget/ScrollableWidget;BOX_COLOR:I
-
PADDING
private static final int PADDING- See Also:
- Mappings:
Namespace Name Mixin selector official dLegq;d:Iintermediary field_39496Lnet/minecraft/class_7528;field_39496:Inamed PADDINGLnet/minecraft/client/gui/widget/ScrollableWidget;PADDING:I
-
scrollY
private double scrollY- Mappings:
Namespace Name Mixin selector official eLegq;e:Dintermediary field_39497Lnet/minecraft/class_7528;field_39497:Dnamed scrollYLnet/minecraft/client/gui/widget/ScrollableWidget;scrollY:D
-
scrollbarDragged
private boolean scrollbarDragged- Mappings:
Namespace Name Mixin selector official fLegq;f:Zintermediary field_39498Lnet/minecraft/class_7528;field_39498:Znamed scrollbarDraggedLnet/minecraft/client/gui/widget/ScrollableWidget;scrollbarDragged:Z
-
-
Constructor Details
-
ScrollableWidget
- Mappings:
Namespace Name Mixin selector official <init>Legt;<init>(IIIILrm;)Vintermediary <init>Lnet/minecraft/class_339;<init>(IIIILnet/minecraft/class_2561;)Vnamed <init>Lnet/minecraft/client/gui/widget/ClickableWidget;<init>(IIIILnet/minecraft/text/Text;)V
-
-
Method Details
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button) Callback for when a mouse button down event has been captured. The button number is identified by the constants inGLFWclass.- Specified by:
mouseClickedin interfaceElement- Overrides:
mouseClickedin classClickableWidget- Parameters:
mouseX- the X coordinate of the mousemouseY- the Y coordinate of the mousebutton- the mouse button number- Returns:
trueto indicate that the event handling is successful/valid- See Also:
- Mappings:
Namespace Name Mixin selector official aLehx;a(DDI)Zintermediary method_25402Lnet/minecraft/class_364;method_25402(DDI)Znamed mouseClickedLnet/minecraft/client/gui/Element;mouseClicked(DDI)Z
-
mouseReleased
public boolean mouseReleased(double mouseX, double mouseY, int button) Callback for when a mouse button release event has been captured. The button number is identified by the constants inGLFWclass.- Specified by:
mouseReleasedin interfaceElement- Overrides:
mouseReleasedin classClickableWidget- Parameters:
mouseX- the X coordinate of the mousemouseY- the Y coordinate of the mousebutton- the mouse button number- Returns:
trueto indicate that the event handling is successful/valid- See Also:
- Mappings:
Namespace Name Mixin selector official bLehx;b(DDI)Zintermediary method_25406Lnet/minecraft/class_364;method_25406(DDI)Znamed mouseReleasedLnet/minecraft/client/gui/Element;mouseReleased(DDI)Z
-
mouseDragged
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) Callback for when a mouse button drag event has been captured. The button number is identified by the constants inGLFWclass.- Specified by:
mouseDraggedin interfaceElement- Overrides:
mouseDraggedin classClickableWidget- Parameters:
mouseX- the current X coordinate of the mousemouseY- the current Y coordinate of the mousebutton- the mouse button numberdeltaX- the difference of the current X with the previous X coordinatedeltaY- the difference of the current Y with the previous Y coordinate- Returns:
trueto indicate that the event handling is successful/valid- See Also:
- Mappings:
Namespace Name Mixin selector official aLehx;a(DDIDD)Zintermediary method_25403Lnet/minecraft/class_364;method_25403(DDIDD)Znamed mouseDraggedLnet/minecraft/client/gui/Element;mouseDragged(DDIDD)Z
-
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double amount) Callback for when a mouse button scroll event has been captured.- Specified by:
mouseScrolledin interfaceElement- Parameters:
mouseX- the X coordinate of the mousemouseY- the Y coordinate of the mouseamount- value is< 0if scrolled down,> 0if scrolled up- Returns:
trueto indicate that the event handling is successful/valid- See Also:
- Mappings:
Namespace Name Mixin selector official aLehx;a(DDD)Zintermediary method_25401Lnet/minecraft/class_364;method_25401(DDD)Znamed mouseScrolledLnet/minecraft/client/gui/Element;mouseScrolled(DDD)Z
-
renderButton
- Overrides:
renderButtonin classClickableWidget- Mappings:
Namespace Name Mixin selector official bLegt;b(Ldzv;IIF)Vintermediary method_25359Lnet/minecraft/class_339;method_25359(Lnet/minecraft/class_4587;IIF)Vnamed renderButtonLnet/minecraft/client/gui/widget/ClickableWidget;renderButton(Lnet/minecraft/client/util/math/MatrixStack;IIF)V
-
getScrollbarThumbHeight
private int getScrollbarThumbHeight()- Mappings:
Namespace Name Mixin selector official pLegq;p()Iintermediary method_44394Lnet/minecraft/class_7528;method_44394()Inamed getScrollbarThumbHeightLnet/minecraft/client/gui/widget/ScrollableWidget;getScrollbarThumbHeight()I
-
renderOverlay
Renders overlays that are not scrolled but part of the widget.This renders the scrollbar by default. Subclasses can override this to render other overlays, but
supercall is necessary to make sure the scrollbar renders when it should.- Mappings:
Namespace Name Mixin selector official aLegq;a(Ldzv;)Vintermediary method_44384Lnet/minecraft/class_7528;method_44384(Lnet/minecraft/class_4587;)Vnamed renderOverlayLnet/minecraft/client/gui/widget/ScrollableWidget;renderOverlay(Lnet/minecraft/client/util/math/MatrixStack;)V
-
getPadding
protected int getPadding()- Mappings:
Namespace Name Mixin selector official aLegq;a()Iintermediary method_44381Lnet/minecraft/class_7528;method_44381()Inamed getPaddingLnet/minecraft/client/gui/widget/ScrollableWidget;getPadding()I
-
getPaddingDoubled
protected int getPaddingDoubled()- Mappings:
Namespace Name Mixin selector official bLegq;b()Iintermediary method_44385Lnet/minecraft/class_7528;method_44385()Inamed getPaddingDoubledLnet/minecraft/client/gui/widget/ScrollableWidget;getPaddingDoubled()I
-
getScrollY
protected double getScrollY()- Mappings:
Namespace Name Mixin selector official cLegq;c()Dintermediary method_44387Lnet/minecraft/class_7528;method_44387()Dnamed getScrollYLnet/minecraft/client/gui/widget/ScrollableWidget;getScrollY()D
-
setScrollY
protected void setScrollY(double scrollY) - Mappings:
Namespace Name Mixin selector official aLegq;a(D)Vintermediary method_44382Lnet/minecraft/class_7528;method_44382(D)Vnamed setScrollYLnet/minecraft/client/gui/widget/ScrollableWidget;setScrollY(D)V
-
getMaxScrollY
protected int getMaxScrollY()- Mappings:
Namespace Name Mixin selector official dLegq;d()Iintermediary method_44390Lnet/minecraft/class_7528;method_44390()Inamed getMaxScrollYLnet/minecraft/client/gui/widget/ScrollableWidget;getMaxScrollY()I
-
getContentsHeightWithPadding
private int getContentsHeightWithPadding()- Mappings:
Namespace Name Mixin selector official qLegq;q()Iintermediary method_44395Lnet/minecraft/class_7528;method_44395()Inamed getContentsHeightWithPaddingLnet/minecraft/client/gui/widget/ScrollableWidget;getContentsHeightWithPadding()I
-
drawBox
Draws the box that the contents are rendered over, including its borders.- Mappings:
Namespace Name Mixin selector official bLegq;b(Ldzv;)Vintermediary method_44386Lnet/minecraft/class_7528;method_44386(Lnet/minecraft/class_4587;)Vnamed drawBoxLnet/minecraft/client/gui/widget/ScrollableWidget;drawBox(Lnet/minecraft/client/util/math/MatrixStack;)V
-
drawScrollbar
private void drawScrollbar()- Mappings:
Namespace Name Mixin selector official rLegq;r()Vintermediary method_44396Lnet/minecraft/class_7528;method_44396()Vnamed drawScrollbarLnet/minecraft/client/gui/widget/ScrollableWidget;drawScrollbar()V
-
isVisible
protected boolean isVisible(int top, int bottom) - Mappings:
Namespace Name Mixin selector official aLegq;a(II)Zintermediary method_44383Lnet/minecraft/class_7528;method_44383(II)Znamed isVisibleLnet/minecraft/client/gui/widget/ScrollableWidget;isVisible(II)Z
-
isWithinBounds
protected boolean isWithinBounds(double mouseX, double mouseY) - Mappings:
Namespace Name Mixin selector official cLegq;c(DD)Zintermediary method_44388Lnet/minecraft/class_7528;method_44388(DD)Znamed isWithinBoundsLnet/minecraft/client/gui/widget/ScrollableWidget;isWithinBounds(DD)Z
-
getContentsHeight
protected abstract int getContentsHeight()Returns the total height of the contents.- Returns:
- the total height of the contents
- Mappings:
Namespace Name Mixin selector official eLegq;e()Iintermediary method_44391Lnet/minecraft/class_7528;method_44391()Inamed getContentsHeightLnet/minecraft/client/gui/widget/ScrollableWidget;getContentsHeight()I
-
overflows
protected abstract boolean overflows()Returns whether the contents overflow and needs a scrollbar.- Returns:
- whether the contents overflow and needs a scrollbar
- Mappings:
Namespace Name Mixin selector official fLegq;f()Zintermediary method_44392Lnet/minecraft/class_7528;method_44392()Znamed overflowsLnet/minecraft/client/gui/widget/ScrollableWidget;overflows()Z
-
getDeltaYPerScroll
protected abstract double getDeltaYPerScroll()- Mappings:
Namespace Name Mixin selector official gLegq;g()Dintermediary method_44393Lnet/minecraft/class_7528;method_44393()Dnamed getDeltaYPerScrollLnet/minecraft/client/gui/widget/ScrollableWidget;getDeltaYPerScroll()D
-
renderContents
Renders the scrolled contents. Subclasses must override this. The rendered contents may overflow; the caller should trim those usingDrawableHelper.enableScissor(int, int, int, int).- Mappings:
Namespace Name Mixin selector official cLegq;c(Ldzv;IIF)Vintermediary method_44389Lnet/minecraft/class_7528;method_44389(Lnet/minecraft/class_4587;IIF)Vnamed renderContentsLnet/minecraft/client/gui/widget/ScrollableWidget;renderContents(Lnet/minecraft/client/util/math/MatrixStack;IIF)V
-