Class AbstractScrollWidget

java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractScrollWidget
All Implemented Interfaces:
GuiEventListener, Renderable, TabOrderedElement, LayoutElement, NarratableEntry, NarrationSupplier, IAbstractWidgetExtension
Direct Known Subclasses:
FittingMultiLineTextWidget, MultiLineEditBox, TelemetryEventWidget

public abstract class AbstractScrollWidget extends AbstractWidget implements Renderable, GuiEventListener
  • Field Details

    • BACKGROUND_SPRITES

      private static final WidgetSprites BACKGROUND_SPRITES
    • SCROLLER_SPRITE

      private static final ResourceLocation SCROLLER_SPRITE
    • INNER_PADDING

      private static final int INNER_PADDING
      See Also:
    • SCROLL_BAR_WIDTH

      private static final int SCROLL_BAR_WIDTH
      See Also:
    • scrollAmount

      private double scrollAmount
    • scrolling

      private boolean scrolling
  • Constructor Details

    • AbstractScrollWidget

      public AbstractScrollWidget(int pX, int pY, int pWidth, int pHeight, Component pMessage)
  • Method Details

    • mouseClicked

      public boolean mouseClicked(double pMouseX, double pMouseY, int pButton)
      Description copied from class: AbstractWidget
      Called when a mouse button is clicked within the GUI element.

      Specified by:
      mouseClicked in interface GuiEventListener
      Overrides:
      mouseClicked in class AbstractWidget
      Parameters:
      pMouseX - the X coordinate of the mouse.
      pMouseY - the Y coordinate of the mouse.
      pButton - the button that was clicked.
      Returns:
      true if the event is consumed, false otherwise.
    • mouseReleased

      public boolean mouseReleased(double pMouseX, double pMouseY, int pButton)
      Description copied from class: AbstractWidget
      Called when a mouse button is released within the GUI element.

      Specified by:
      mouseReleased in interface GuiEventListener
      Overrides:
      mouseReleased in class AbstractWidget
      Parameters:
      pMouseX - the X coordinate of the mouse.
      pMouseY - the Y coordinate of the mouse.
      pButton - the button that was released.
      Returns:
      true if the event is consumed, false otherwise.
    • mouseDragged

      public boolean mouseDragged(double pMouseX, double pMouseY, int pButton, double pDragX, double pDragY)
      Description copied from class: AbstractWidget
      Called when the mouse is dragged within the GUI element.

      Specified by:
      mouseDragged in interface GuiEventListener
      Overrides:
      mouseDragged in class AbstractWidget
      Parameters:
      pMouseX - the X coordinate of the mouse.
      pMouseY - the Y coordinate of the mouse.
      pButton - the button that is being dragged.
      pDragX - the X distance of the drag.
      pDragY - the Y distance of the drag.
      Returns:
      true if the event is consumed, false otherwise.
    • mouseScrolled

      public boolean mouseScrolled(double pMouseX, double pMouseY, double pScrollX, double pScrollY)
      Specified by:
      mouseScrolled in interface GuiEventListener
    • keyPressed

      public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers)
      Called when a keyboard key is pressed within the GUI element.

      Specified by:
      keyPressed in interface GuiEventListener
      Parameters:
      pKeyCode - the key code of the pressed key.
      pScanCode - the scan code of the pressed key.
      pModifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • renderWidget

      public void renderWidget(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)
      Specified by:
      renderWidget in class AbstractWidget
    • getScrollBarHeight

      private int getScrollBarHeight()
    • renderDecorations

      protected void renderDecorations(GuiGraphics pGuiGraphics)
    • innerPadding

      protected int innerPadding()
    • totalInnerPadding

      protected int totalInnerPadding()
    • scrollAmount

      protected double scrollAmount()
    • setScrollAmount

      protected void setScrollAmount(double pScrollAmount)
    • getMaxScrollAmount

      protected int getMaxScrollAmount()
    • getContentHeight

      private int getContentHeight()
    • renderBackground

      protected void renderBackground(GuiGraphics pGuiGraphics)
    • renderBorder

      protected void renderBorder(GuiGraphics pGuiGraphics, int pX, int pY, int pWidth, int pHeight)
    • renderScrollBar

      private void renderScrollBar(GuiGraphics pGuiGraphics)
    • withinContentAreaTopBottom

      protected boolean withinContentAreaTopBottom(int pTop, int pBottom)
    • withinContentAreaPoint

      protected boolean withinContentAreaPoint(double pX, double pY)
    • scrollbarVisible

      protected boolean scrollbarVisible()
    • scrollbarWidth

      public int scrollbarWidth()
    • getInnerHeight

      protected abstract int getInnerHeight()
    • scrollRate

      protected abstract double scrollRate()
    • renderContents

      protected abstract void renderContents(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)