Package net.minecraft.client.gui.widget
Class ScrollableWidget
java.lang.Object
net.minecraft.client.gui.widget.ClickableWidget
net.minecraft.client.gui.widget.ScrollableWidget
- All Implemented Interfaces:
Drawable
,Element
,Narratable
,Navigable
,Selectable
,Widget
- Direct Known Subclasses:
EditBoxWidget
,ScrollableTextWidget
,TelemetryEventWidget
A widget that can be focused and vertically scrolled.
- Mappings:
Namespace Name named net/minecraft/client/gui/widget/ScrollableWidget
intermediary net/minecraft/class_7528
official fny
-
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 boolean
private static final Identifier
private static final int
private double
private static final ButtonTextures
Fields inherited from class net.minecraft.client.gui.widget.ClickableWidget
active, alpha, height, hovered, visible, width
Fields inherited from interface net.minecraft.client.gui.Element
MAX_DOUBLE_CLICK_INTERVAL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
drawBox
(DrawContext context) Draws the box that the contents are rendered over, including its borders.protected void
drawBox
(DrawContext context, int x, int y, int width, int height) private void
drawScrollbar
(DrawContext context) protected abstract int
Returns the total height of the contents.private int
protected abstract double
protected int
protected int
protected int
private int
int
protected double
protected boolean
isVisible
(int top, int bottom) protected boolean
isWithinBounds
(double mouseX, double mouseY) boolean
keyPressed
(int keyCode, int scanCode, int modifiers) Callback for when a key down event has been captured.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 horizontalAmount, double verticalAmount) Callback for when a mouse button scroll event has been captured.protected boolean
Returns whether the contents overflow and needs a scrollbar.protected abstract void
renderContents
(DrawContext context, int mouseX, int mouseY, float delta) Renders the scrolled contents.protected void
renderOverlay
(DrawContext context) Renders overlays that are not scrolled but part of the widget.void
renderWidget
(DrawContext context, int mouseX, int mouseY, float delta) protected void
setScrollY
(double scrollY) Methods inherited from class net.minecraft.client.gui.widget.ClickableWidget
appendClickableNarrations, appendDefaultNarrations, appendNarrations, clicked, drawScrollableText, drawScrollableText, drawScrollableText, forEachChild, getBottom, getHeight, getMessage, getNarrationMessage, getNarrationMessage, getNavigationFocus, getNavigationOrder, getNavigationPath, getRight, getTooltip, getType, getWidth, getX, getY, isFocused, isHovered, isMouseOver, isNarratable, isSelected, isValidClickButton, onClick, onDrag, onRelease, playClickSound, playDownSound, render, setAlpha, setDimensions, setDimensionsAndPosition, setFocused, setHeight, setMessage, setNavigationOrder, setTooltip, setTooltipDelay, setWidth, setX, setY
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
charTyped, getFocusedPath, keyReleased, mouseMoved
Methods inherited from interface net.minecraft.client.gui.widget.Widget
setPosition
-
Field Details
-
TEXT_FIELD_TEXTURES
- Mappings:
Namespace Name Mixin selector named TEXT_FIELD_TEXTURES
Lnet/minecraft/client/gui/widget/ScrollableWidget;TEXT_FIELD_TEXTURES:Lnet/minecraft/client/gui/screen/ButtonTextures;
intermediary field_45905
Lnet/minecraft/class_7528;field_45905:Lnet/minecraft/class_8666;
official a
Lfny;a:Lfps;
-
SCROLLER_TEXTURE
- Mappings:
Namespace Name Mixin selector named SCROLLER_TEXTURE
Lnet/minecraft/client/gui/widget/ScrollableWidget;SCROLLER_TEXTURE:Lnet/minecraft/util/Identifier;
intermediary field_45906
Lnet/minecraft/class_7528;field_45906:Lnet/minecraft/class_2960;
official b
Lfny;b:Lalz;
-
PADDING
private static final int PADDING- See Also:
- Mappings:
Namespace Name Mixin selector named PADDING
Lnet/minecraft/client/gui/widget/ScrollableWidget;PADDING:I
intermediary field_39496
Lnet/minecraft/class_7528;field_39496:I
official c
Lfny;c:I
-
SCROLLER_WIDTH
private static final int SCROLLER_WIDTH- See Also:
- Mappings:
Namespace Name Mixin selector named SCROLLER_WIDTH
Lnet/minecraft/client/gui/widget/ScrollableWidget;SCROLLER_WIDTH:I
intermediary field_45907
Lnet/minecraft/class_7528;field_45907:I
official d
Lfny;d:I
-
scrollY
private double scrollY- Mappings:
Namespace Name Mixin selector named scrollY
Lnet/minecraft/client/gui/widget/ScrollableWidget;scrollY:D
intermediary field_39497
Lnet/minecraft/class_7528;field_39497:D
official e
Lfny;e:D
-
scrollbarDragged
private boolean scrollbarDragged- Mappings:
Namespace Name Mixin selector named scrollbarDragged
Lnet/minecraft/client/gui/widget/ScrollableWidget;scrollbarDragged:Z
intermediary field_39498
Lnet/minecraft/class_7528;field_39498:Z
official f
Lfny;f:Z
-
-
Constructor Details
-
ScrollableWidget
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/client/gui/widget/ClickableWidget;<init>(IIIILnet/minecraft/text/Text;)V
intermediary <init>
Lnet/minecraft/class_339;<init>(IIIILnet/minecraft/class_2561;)V
official <init>
Lfoc;<init>(IIIILxv;)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 named mouseClicked
Lnet/minecraft/client/gui/Element;mouseClicked(DDI)Z
intermediary method_25402
Lnet/minecraft/class_364;method_25402(DDI)Z
official a
Lfqc;a(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 named mouseReleased
Lnet/minecraft/client/gui/Element;mouseReleased(DDI)Z
intermediary method_25406
Lnet/minecraft/class_364;method_25406(DDI)Z
official b
Lfqc;b(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 named mouseDragged
Lnet/minecraft/client/gui/Element;mouseDragged(DDIDD)Z
intermediary method_25403
Lnet/minecraft/class_364;method_25403(DDIDD)Z
official a
Lfqc;a(DDIDD)Z
-
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) Callback for when a mouse button scroll event has been captured.- Parameters:
mouseX
- the X coordinate of the mousemouseY
- the Y coordinate of the mousehorizontalAmount
- the horizontal scroll amountverticalAmount
- the vertical scroll amount- Returns:
true
to indicate that the event handling is successful/valid- See Also:
- Mappings:
Namespace Name Mixin selector named mouseScrolled
Lnet/minecraft/client/gui/Element;mouseScrolled(DDDD)Z
intermediary method_25401
Lnet/minecraft/class_364;method_25401(DDDD)Z
official a
Lfqc;a(DDDD)Z
-
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers) Callback for when a key down event has been captured. The key code is identified by the constants inGLFW
class.- Parameters:
keyCode
- the named key code of the event as described in theGLFW
classscanCode
- the unique/platform-specific scan code of the keyboard inputmodifiers
- a GLFW bitfield describing the modifier keys that are held down (see GLFW Modifier key flags)- Returns:
true
to indicate that the event handling is successful/valid- See Also:
- Mappings:
Namespace Name Mixin selector named keyPressed
Lnet/minecraft/client/gui/Element;keyPressed(III)Z
intermediary method_25404
Lnet/minecraft/class_364;method_25404(III)Z
official a
Lfqc;a(III)Z
-
renderWidget
- Specified by:
renderWidget
in classClickableWidget
- Mappings:
Namespace Name Mixin selector named renderWidget
Lnet/minecraft/client/gui/widget/ClickableWidget;renderWidget(Lnet/minecraft/client/gui/DrawContext;IIF)V
intermediary method_48579
Lnet/minecraft/class_339;method_48579(Lnet/minecraft/class_332;IIF)V
official b
Lfoc;b(Lfnr;IIF)V
-
getScrollbarThumbHeight
private int getScrollbarThumbHeight()- Mappings:
Namespace Name Mixin selector named getScrollbarThumbHeight
Lnet/minecraft/client/gui/widget/ScrollableWidget;getScrollbarThumbHeight()I
intermediary method_44394
Lnet/minecraft/class_7528;method_44394()I
official j
Lfny;j()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 named renderOverlay
Lnet/minecraft/client/gui/widget/ScrollableWidget;renderOverlay(Lnet/minecraft/client/gui/DrawContext;)V
intermediary method_44384
Lnet/minecraft/class_7528;method_44384(Lnet/minecraft/class_332;)V
official a
Lfny;a(Lfnr;)V
-
getPadding
protected int getPadding()- Mappings:
Namespace Name Mixin selector named getPadding
Lnet/minecraft/client/gui/widget/ScrollableWidget;getPadding()I
intermediary method_44381
Lnet/minecraft/class_7528;method_44381()I
official a
Lfny;a()I
-
getPaddingDoubled
protected int getPaddingDoubled()- Mappings:
Namespace Name Mixin selector named getPaddingDoubled
Lnet/minecraft/client/gui/widget/ScrollableWidget;getPaddingDoubled()I
intermediary method_44385
Lnet/minecraft/class_7528;method_44385()I
official b
Lfny;b()I
-
getScrollY
protected double getScrollY()- Mappings:
Namespace Name Mixin selector named getScrollY
Lnet/minecraft/client/gui/widget/ScrollableWidget;getScrollY()D
intermediary method_44387
Lnet/minecraft/class_7528;method_44387()D
official c
Lfny;c()D
-
setScrollY
protected void setScrollY(double scrollY) - Mappings:
Namespace Name Mixin selector named setScrollY
Lnet/minecraft/client/gui/widget/ScrollableWidget;setScrollY(D)V
intermediary method_44382
Lnet/minecraft/class_7528;method_44382(D)V
official a
Lfny;a(D)V
-
getMaxScrollY
protected int getMaxScrollY()- Mappings:
Namespace Name Mixin selector named getMaxScrollY
Lnet/minecraft/client/gui/widget/ScrollableWidget;getMaxScrollY()I
intermediary method_44390
Lnet/minecraft/class_7528;method_44390()I
official d
Lfny;d()I
-
getContentsHeightWithPadding
private int getContentsHeightWithPadding()- Mappings:
Namespace Name Mixin selector named getContentsHeightWithPadding
Lnet/minecraft/client/gui/widget/ScrollableWidget;getContentsHeightWithPadding()I
intermediary method_44395
Lnet/minecraft/class_7528;method_44395()I
official k
Lfny;k()I
-
drawBox
Draws the box that the contents are rendered over, including its borders.- Mappings:
Namespace Name Mixin selector named drawBox
Lnet/minecraft/client/gui/widget/ScrollableWidget;drawBox(Lnet/minecraft/client/gui/DrawContext;)V
intermediary method_44386
Lnet/minecraft/class_7528;method_44386(Lnet/minecraft/class_332;)V
official b
Lfny;b(Lfnr;)V
-
drawBox
- Mappings:
Namespace Name Mixin selector named drawBox
Lnet/minecraft/client/gui/widget/ScrollableWidget;drawBox(Lnet/minecraft/client/gui/DrawContext;IIII)V
intermediary method_52233
Lnet/minecraft/class_7528;method_52233(Lnet/minecraft/class_332;IIII)V
official a
Lfny;a(Lfnr;IIII)V
-
drawScrollbar
- Mappings:
Namespace Name Mixin selector named drawScrollbar
Lnet/minecraft/client/gui/widget/ScrollableWidget;drawScrollbar(Lnet/minecraft/client/gui/DrawContext;)V
intermediary method_44396
Lnet/minecraft/class_7528;method_44396(Lnet/minecraft/class_332;)V
official c
Lfny;c(Lfnr;)V
-
isVisible
protected boolean isVisible(int top, int bottom) - Mappings:
Namespace Name Mixin selector named isVisible
Lnet/minecraft/client/gui/widget/ScrollableWidget;isVisible(II)Z
intermediary method_44383
Lnet/minecraft/class_7528;method_44383(II)Z
official a
Lfny;a(II)Z
-
isWithinBounds
protected boolean isWithinBounds(double mouseX, double mouseY) - Mappings:
Namespace Name Mixin selector named isWithinBounds
Lnet/minecraft/client/gui/widget/ScrollableWidget;isWithinBounds(DD)Z
intermediary method_44388
Lnet/minecraft/class_7528;method_44388(DD)Z
official b
Lfny;b(DD)Z
-
overflows
protected 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 named overflows
Lnet/minecraft/client/gui/widget/ScrollableWidget;overflows()Z
intermediary method_44392
Lnet/minecraft/class_7528;method_44392()Z
official e
Lfny;e()Z
-
getScrollerWidth
public int getScrollerWidth()- Mappings:
Namespace Name Mixin selector named getScrollerWidth
Lnet/minecraft/client/gui/widget/ScrollableWidget;getScrollerWidth()I
intermediary method_53532
Lnet/minecraft/class_7528;method_53532()I
official g
Lfny;g()I
-
getContentsHeight
protected abstract int getContentsHeight()Returns the total height of the contents.- Returns:
- the total height of the contents
- Mappings:
Namespace Name Mixin selector named getContentsHeight
Lnet/minecraft/client/gui/widget/ScrollableWidget;getContentsHeight()I
intermediary method_44391
Lnet/minecraft/class_7528;method_44391()I
official h
Lfny;h()I
-
getDeltaYPerScroll
protected abstract double getDeltaYPerScroll()- Mappings:
Namespace Name Mixin selector named getDeltaYPerScroll
Lnet/minecraft/client/gui/widget/ScrollableWidget;getDeltaYPerScroll()D
intermediary method_44393
Lnet/minecraft/class_7528;method_44393()D
official i
Lfny;i()D
-
renderContents
Renders the scrolled contents. Subclasses must override this. The rendered contents may overflow; the caller should trim those usingDrawContext.enableScissor(int, int, int, int)
.- Mappings:
Namespace Name Mixin selector named renderContents
Lnet/minecraft/client/gui/widget/ScrollableWidget;renderContents(Lnet/minecraft/client/gui/DrawContext;IIF)V
intermediary method_44389
Lnet/minecraft/class_7528;method_44389(Lnet/minecraft/class_332;IIF)V
official c
Lfny;c(Lfnr;IIF)V
-