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

@Environment(CLIENT) public abstract class ScrollableWidget extends ClickableWidget implements Drawable, Element
A widget that can be focused and vertically scrolled.
Mappings:
Namespace Name
official esk
intermediary net/minecraft/class_7528
named net/minecraft/client/gui/widget/ScrollableWidget
  • Field Details

    • TEXT_FIELD_TEXTURES

      private static final ButtonTextures TEXT_FIELD_TEXTURES
      Mappings:
      Namespace Name Mixin selector
      official a Lesk;a:Leuc;
      intermediary field_45905 Lnet/minecraft/class_7528;field_45905:Lnet/minecraft/class_8666;
      named TEXT_FIELD_TEXTURES Lnet/minecraft/client/gui/widget/ScrollableWidget;TEXT_FIELD_TEXTURES:Lnet/minecraft/client/gui/screen/ButtonTextures;
    • SCROLLER_TEXTURE

      private static final Identifier SCROLLER_TEXTURE
      Mappings:
      Namespace Name Mixin selector
      official b Lesk;b:Laew;
      intermediary field_45906 Lnet/minecraft/class_7528;field_45906:Lnet/minecraft/class_2960;
      named SCROLLER_TEXTURE Lnet/minecraft/client/gui/widget/ScrollableWidget;SCROLLER_TEXTURE:Lnet/minecraft/util/Identifier;
    • PADDING

      private static final int PADDING
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official c Lesk;c:I
      intermediary field_39496 Lnet/minecraft/class_7528;field_39496:I
      named PADDING Lnet/minecraft/client/gui/widget/ScrollableWidget;PADDING:I
    • SCROLLER_WIDTH

      private static final int SCROLLER_WIDTH
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official d Lesk;d:I
      intermediary field_45907 Lnet/minecraft/class_7528;field_45907:I
      named SCROLLER_WIDTH Lnet/minecraft/client/gui/widget/ScrollableWidget;SCROLLER_WIDTH:I
    • scrollY

      private double scrollY
      Mappings:
      Namespace Name Mixin selector
      official e Lesk;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 l Lesk;l:Z
      intermediary field_39498 Lnet/minecraft/class_7528;field_39498:Z
      named scrollbarDragged Lnet/minecraft/client/gui/widget/ScrollableWidget;scrollbarDragged:Z
  • Constructor Details

    • ScrollableWidget

      public ScrollableWidget(int x, int y, int width, int height, Text message)
      Mappings:
      Namespace Name Mixin selector
      official <init> Leso;<init>(IIIILtl;)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 in GLFW class.
      Specified by:
      mouseClicked in interface Element
      Overrides:
      mouseClicked in class ClickableWidget
      Parameters:
      mouseX - the X coordinate of the mouse
      mouseY - the Y coordinate of the mouse
      button - the mouse button number
      Returns:
      true to indicate that the event handling is successful/valid
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Leuk;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 in GLFW class.
      Specified by:
      mouseReleased in interface Element
      Overrides:
      mouseReleased in class ClickableWidget
      Parameters:
      mouseX - the X coordinate of the mouse
      mouseY - the Y coordinate of the mouse
      button - the mouse button number
      Returns:
      true to indicate that the event handling is successful/valid
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Leuk;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 in GLFW class.
      Specified by:
      mouseDragged in interface Element
      Overrides:
      mouseDragged in class ClickableWidget
      Parameters:
      mouseX - the current X coordinate of the mouse
      mouseY - the current Y coordinate of the mouse
      button - the mouse button number
      deltaX - the difference of the current X with the previous X coordinate
      deltaY - 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 Leuk;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 horizontalAmount, double verticalAmount)
      Callback for when a mouse button scroll event has been captured.
      Specified by:
      mouseScrolled in interface Element
      Parameters:
      mouseX - the X coordinate of the mouse
      mouseY - the Y coordinate of the mouse
      horizontalAmount - the horizontal scroll amount
      verticalAmount - the vertical scroll amount
      Returns:
      true to indicate that the event handling is successful/valid
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Leuk;a(DDDD)Z
      intermediary method_25401 Lnet/minecraft/class_364;method_25401(DDDD)Z
      named mouseScrolled Lnet/minecraft/client/gui/Element;mouseScrolled(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 in GLFW class.
      Specified by:
      keyPressed in interface Element
      Parameters:
      keyCode - the named key code of the event as described in the GLFW class
      scanCode - the unique/platform-specific scan code of the keyboard input
      modifiers - 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
      official a Leuk;a(III)Z
      intermediary method_25404 Lnet/minecraft/class_364;method_25404(III)Z
      named keyPressed Lnet/minecraft/client/gui/Element;keyPressed(III)Z
    • renderButton

      public void renderButton(DrawContext context, int mouseX, int mouseY, float delta)
      Specified by:
      renderButton in class ClickableWidget
      Mappings:
      Namespace Name Mixin selector
      official b Leso;b(Lesf;IIF)V
      intermediary method_48579 Lnet/minecraft/class_339;method_48579(Lnet/minecraft/class_332;IIF)V
      named renderButton Lnet/minecraft/client/gui/widget/ClickableWidget;renderButton(Lnet/minecraft/client/gui/DrawContext;IIF)V
    • getScrollbarThumbHeight

      private int getScrollbarThumbHeight()
      Mappings:
      Namespace Name Mixin selector
      official w Lesk;w()I
      intermediary method_44394 Lnet/minecraft/class_7528;method_44394()I
      named getScrollbarThumbHeight Lnet/minecraft/client/gui/widget/ScrollableWidget;getScrollbarThumbHeight()I
    • renderOverlay

      protected void renderOverlay(DrawContext context)
      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 Lesk;a(Lesf;)V
      intermediary method_44384 Lnet/minecraft/class_7528;method_44384(Lnet/minecraft/class_332;)V
      named renderOverlay Lnet/minecraft/client/gui/widget/ScrollableWidget;renderOverlay(Lnet/minecraft/client/gui/DrawContext;)V
    • getPadding

      protected int getPadding()
      Mappings:
      Namespace Name Mixin selector
      official a Lesk;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 Lesk;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 Lesk;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 Lesk;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 Lesk;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 x Lesk;x()I
      intermediary method_44395 Lnet/minecraft/class_7528;method_44395()I
      named getContentsHeightWithPadding Lnet/minecraft/client/gui/widget/ScrollableWidget;getContentsHeightWithPadding()I
    • drawBox

      protected void drawBox(DrawContext context)
      Draws the box that the contents are rendered over, including its borders.
      Mappings:
      Namespace Name Mixin selector
      official b Lesk;b(Lesf;)V
      intermediary method_44386 Lnet/minecraft/class_7528;method_44386(Lnet/minecraft/class_332;)V
      named drawBox Lnet/minecraft/client/gui/widget/ScrollableWidget;drawBox(Lnet/minecraft/client/gui/DrawContext;)V
    • drawBox

      protected void drawBox(DrawContext context, int x, int y, int width, int height)
      Mappings:
      Namespace Name Mixin selector
      official a Lesk;a(Lesf;IIII)V
      intermediary method_52233 Lnet/minecraft/class_7528;method_52233(Lnet/minecraft/class_332;IIII)V
      named drawBox Lnet/minecraft/client/gui/widget/ScrollableWidget;drawBox(Lnet/minecraft/client/gui/DrawContext;IIII)V
    • drawScrollbar

      private void drawScrollbar(DrawContext context)
      Mappings:
      Namespace Name Mixin selector
      official c Lesk;c(Lesf;)V
      intermediary method_44396 Lnet/minecraft/class_7528;method_44396(Lnet/minecraft/class_332;)V
      named drawScrollbar Lnet/minecraft/client/gui/widget/ScrollableWidget;drawScrollbar(Lnet/minecraft/client/gui/DrawContext;)V
    • isVisible

      protected boolean isVisible(int top, int bottom)
      Mappings:
      Namespace Name Mixin selector
      official a Lesk;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 Lesk;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
    • 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
      official e Lesk;e()Z
      intermediary method_44392 Lnet/minecraft/class_7528;method_44392()Z
      named overflows Lnet/minecraft/client/gui/widget/ScrollableWidget;overflows()Z
    • getScrollerWidth

      public int getScrollerWidth()
      Mappings:
      Namespace Name Mixin selector
      official f Lesk;f()I
      intermediary method_53532 Lnet/minecraft/class_7528;method_53532()I
      named getScrollerWidth Lnet/minecraft/client/gui/widget/ScrollableWidget;getScrollerWidth()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
      official g Lesk;g()I
      intermediary method_44391 Lnet/minecraft/class_7528;method_44391()I
      named getContentsHeight Lnet/minecraft/client/gui/widget/ScrollableWidget;getContentsHeight()I
    • getDeltaYPerScroll

      protected abstract double getDeltaYPerScroll()
      Mappings:
      Namespace Name Mixin selector
      official h Lesk;h()D
      intermediary method_44393 Lnet/minecraft/class_7528;method_44393()D
      named getDeltaYPerScroll Lnet/minecraft/client/gui/widget/ScrollableWidget;getDeltaYPerScroll()D
    • renderContents

      protected abstract void renderContents(DrawContext context, int mouseX, int mouseY, float delta)
      Renders the scrolled contents. Subclasses must override this. The rendered contents may overflow; the caller should trim those using DrawContext.enableScissor(int, int, int, int).
      Mappings:
      Namespace Name Mixin selector
      official c Lesk;c(Lesf;IIF)V
      intermediary method_44389 Lnet/minecraft/class_7528;method_44389(Lnet/minecraft/class_332;IIF)V
      named renderContents Lnet/minecraft/client/gui/widget/ScrollableWidget;renderContents(Lnet/minecraft/client/gui/DrawContext;IIF)V