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 ehk
intermediary net/minecraft/class_7528
named net/minecraft/client/gui/widget/ScrollableWidget
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.Selectable
Selectable.SelectionType
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
private static final int
private static final int
private boolean
private double
private static final int
Fields inherited from class net.minecraft.client.gui.widget.ClickableWidget
active, alpha, height, hovered, visible, WIDGETS_TEXTURE, width, x, y
Fields inherited from class net.minecraft.client.gui.DrawableHelper
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE
Fields inherited from interface net.minecraft.client.gui.Element
MAX_DOUBLE_CLICK_INTERVAL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
drawBox
(MatrixStack matrices) Draws the box that the contents are rendered over, including its borders.private void
protected abstract int
Returns the total height of the contents.private int
protected abstract double
protected int
protected int
protected int
private int
protected double
protected boolean
isVisible
(int top, int bottom) protected boolean
isWithinBounds
(double mouseX, double mouseY) boolean
mouseClicked
(double mouseX, double mouseY, int button) Callback for when a mouse button down event has been captured.boolean
mouseDragged
(double mouseX, double mouseY, int button, double deltaX, double deltaY) Callback for when a mouse button drag event has been captured.boolean
mouseReleased
(double mouseX, double mouseY, int button) Callback for when a mouse button release event has been captured.boolean
mouseScrolled
(double mouseX, double mouseY, double amount) Callback for when a mouse button scroll event has been captured.protected abstract boolean
Returns whether the contents overflow and needs a scrollbar.void
renderButton
(MatrixStack matrices, int mouseX, int mouseY, float delta) protected abstract void
renderContents
(MatrixStack matrices, int mouseX, int mouseY, float delta) Renders the scrolled contents.protected void
renderOverlay
(MatrixStack matrices) Renders overlays that are not scrolled but part of the widget.protected void
setScrollY
(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, setWidth
Methods 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, setZOffset
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.Element
changeFocus, charTyped, isMouseOver, keyPressed, keyReleased, mouseMoved
Methods 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 a
Lehk;a:I
intermediary field_39493
Lnet/minecraft/class_7528;field_39493:I
named FOCUSED_BORDER_COLOR
Lnet/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 b
Lehk;b:I
intermediary field_39494
Lnet/minecraft/class_7528;field_39494:I
named UNFOCUSED_BORDER_COLOR
Lnet/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 c
Lehk;c:I
intermediary field_39495
Lnet/minecraft/class_7528;field_39495:I
named BOX_COLOR
Lnet/minecraft/client/gui/widget/ScrollableWidget;BOX_COLOR:I
-
PADDING
private static final int PADDING- See Also:
- Mappings:
Namespace Name Mixin selector official d
Lehk;d:I
intermediary field_39496
Lnet/minecraft/class_7528;field_39496:I
named PADDING
Lnet/minecraft/client/gui/widget/ScrollableWidget;PADDING:I
-
scrollY
private double scrollY- Mappings:
Namespace Name Mixin selector official e
Lehk;e:D
intermediary field_39497
Lnet/minecraft/class_7528;field_39497:D
named scrollY
Lnet/minecraft/client/gui/widget/ScrollableWidget;scrollY:D
-
scrollbarDragged
private boolean scrollbarDragged- Mappings:
Namespace Name Mixin selector official f
Lehk;f:Z
intermediary field_39498
Lnet/minecraft/class_7528;field_39498:Z
named scrollbarDragged
Lnet/minecraft/client/gui/widget/ScrollableWidget;scrollbarDragged:Z
-
-
Constructor Details
-
ScrollableWidget
- Mappings:
Namespace Name Mixin selector official <init>
Lehn;<init>(IIIILrq;)V
intermediary <init>
Lnet/minecraft/class_339;<init>(IIIILnet/minecraft/class_2561;)V
named <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 inGLFW
class.- Specified by:
mouseClicked
in interfaceElement
- Overrides:
mouseClicked
in classClickableWidget
- Parameters:
mouseX
- the X coordinate of the mousemouseY
- the Y coordinate of the mousebutton
- the mouse button number- Returns:
true
to indicate that the event handling is successful/valid- See Also:
- Mappings:
Namespace Name Mixin selector official a
Leir;a(DDI)Z
intermediary method_25402
Lnet/minecraft/class_364;method_25402(DDI)Z
named mouseClicked
Lnet/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 inGLFW
class.- Specified by:
mouseReleased
in interfaceElement
- Overrides:
mouseReleased
in classClickableWidget
- Parameters:
mouseX
- the X coordinate of the mousemouseY
- the Y coordinate of the mousebutton
- the mouse button number- Returns:
true
to indicate that the event handling is successful/valid- See Also:
- Mappings:
Namespace Name Mixin selector official b
Leir;b(DDI)Z
intermediary method_25406
Lnet/minecraft/class_364;method_25406(DDI)Z
named mouseReleased
Lnet/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 inGLFW
class.- Specified by:
mouseDragged
in interfaceElement
- Overrides:
mouseDragged
in 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:
true
to indicate that the event handling is successful/valid- See Also:
- Mappings:
Namespace Name Mixin selector official a
Leir;a(DDIDD)Z
intermediary method_25403
Lnet/minecraft/class_364;method_25403(DDIDD)Z
named mouseDragged
Lnet/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:
mouseScrolled
in interfaceElement
- Parameters:
mouseX
- the X coordinate of the mousemouseY
- the Y coordinate of the mouseamount
- value is< 0
if scrolled down,> 0
if scrolled up- Returns:
true
to indicate that the event handling is successful/valid- See Also:
- Mappings:
Namespace Name Mixin selector official a
Leir;a(DDD)Z
intermediary method_25401
Lnet/minecraft/class_364;method_25401(DDD)Z
named mouseScrolled
Lnet/minecraft/client/gui/Element;mouseScrolled(DDD)Z
-
renderButton
- Overrides:
renderButton
in classClickableWidget
- Mappings:
Namespace Name Mixin selector official b
Lehn;b(Leaq;IIF)V
intermediary method_25359
Lnet/minecraft/class_339;method_25359(Lnet/minecraft/class_4587;IIF)V
named renderButton
Lnet/minecraft/client/gui/widget/ClickableWidget;renderButton(Lnet/minecraft/client/util/math/MatrixStack;IIF)V
-
getScrollbarThumbHeight
private int getScrollbarThumbHeight()- Mappings:
Namespace Name Mixin selector official p
Lehk;p()I
intermediary method_44394
Lnet/minecraft/class_7528;method_44394()I
named getScrollbarThumbHeight
Lnet/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
super
call is necessary to make sure the scrollbar renders when it should.- Mappings:
Namespace Name Mixin selector official a
Lehk;a(Leaq;)V
intermediary method_44384
Lnet/minecraft/class_7528;method_44384(Lnet/minecraft/class_4587;)V
named renderOverlay
Lnet/minecraft/client/gui/widget/ScrollableWidget;renderOverlay(Lnet/minecraft/client/util/math/MatrixStack;)V
-
getPadding
protected int getPadding()- Mappings:
Namespace Name Mixin selector official a
Lehk;a()I
intermediary method_44381
Lnet/minecraft/class_7528;method_44381()I
named getPadding
Lnet/minecraft/client/gui/widget/ScrollableWidget;getPadding()I
-
getPaddingDoubled
protected int getPaddingDoubled()- Mappings:
Namespace Name Mixin selector official b
Lehk;b()I
intermediary method_44385
Lnet/minecraft/class_7528;method_44385()I
named getPaddingDoubled
Lnet/minecraft/client/gui/widget/ScrollableWidget;getPaddingDoubled()I
-
getScrollY
protected double getScrollY()- Mappings:
Namespace Name Mixin selector official c
Lehk;c()D
intermediary method_44387
Lnet/minecraft/class_7528;method_44387()D
named getScrollY
Lnet/minecraft/client/gui/widget/ScrollableWidget;getScrollY()D
-
setScrollY
protected void setScrollY(double scrollY) - Mappings:
Namespace Name Mixin selector official a
Lehk;a(D)V
intermediary method_44382
Lnet/minecraft/class_7528;method_44382(D)V
named setScrollY
Lnet/minecraft/client/gui/widget/ScrollableWidget;setScrollY(D)V
-
getMaxScrollY
protected int getMaxScrollY()- Mappings:
Namespace Name Mixin selector official d
Lehk;d()I
intermediary method_44390
Lnet/minecraft/class_7528;method_44390()I
named getMaxScrollY
Lnet/minecraft/client/gui/widget/ScrollableWidget;getMaxScrollY()I
-
getContentsHeightWithPadding
private int getContentsHeightWithPadding()- Mappings:
Namespace Name Mixin selector official q
Lehk;q()I
intermediary method_44395
Lnet/minecraft/class_7528;method_44395()I
named getContentsHeightWithPadding
Lnet/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 b
Lehk;b(Leaq;)V
intermediary method_44386
Lnet/minecraft/class_7528;method_44386(Lnet/minecraft/class_4587;)V
named drawBox
Lnet/minecraft/client/gui/widget/ScrollableWidget;drawBox(Lnet/minecraft/client/util/math/MatrixStack;)V
-
drawScrollbar
private void drawScrollbar()- Mappings:
Namespace Name Mixin selector official r
Lehk;r()V
intermediary method_44396
Lnet/minecraft/class_7528;method_44396()V
named drawScrollbar
Lnet/minecraft/client/gui/widget/ScrollableWidget;drawScrollbar()V
-
isVisible
protected boolean isVisible(int top, int bottom) - Mappings:
Namespace Name Mixin selector official a
Lehk;a(II)Z
intermediary method_44383
Lnet/minecraft/class_7528;method_44383(II)Z
named isVisible
Lnet/minecraft/client/gui/widget/ScrollableWidget;isVisible(II)Z
-
isWithinBounds
protected boolean isWithinBounds(double mouseX, double mouseY) - Mappings:
Namespace Name Mixin selector official c
Lehk;c(DD)Z
intermediary method_44388
Lnet/minecraft/class_7528;method_44388(DD)Z
named isWithinBounds
Lnet/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 e
Lehk;e()I
intermediary method_44391
Lnet/minecraft/class_7528;method_44391()I
named getContentsHeight
Lnet/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 f
Lehk;f()Z
intermediary method_44392
Lnet/minecraft/class_7528;method_44392()Z
named overflows
Lnet/minecraft/client/gui/widget/ScrollableWidget;overflows()Z
-
getDeltaYPerScroll
protected abstract double getDeltaYPerScroll()- Mappings:
Namespace Name Mixin selector official g
Lehk;g()D
intermediary method_44393
Lnet/minecraft/class_7528;method_44393()D
named getDeltaYPerScroll
Lnet/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 c
Lehk;c(Leaq;IIF)V
intermediary method_44389
Lnet/minecraft/class_7528;method_44389(Lnet/minecraft/class_4587;IIF)V
named renderContents
Lnet/minecraft/client/gui/widget/ScrollableWidget;renderContents(Lnet/minecraft/client/util/math/MatrixStack;IIF)V
-