Class AbstractScrollArea

java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractScrollArea
All Implemented Interfaces:
GuiEventListener, Renderable, TabOrderedElement, LayoutElement, NarratableEntry, NarrationSupplier, IAbstractWidgetExtension
Direct Known Subclasses:
AbstractContainerWidget, AbstractTextAreaWidget

public abstract class AbstractScrollArea extends AbstractWidget
  • Field Details

    • SCROLLBAR_WIDTH

      public static final int SCROLLBAR_WIDTH
      See Also:
    • scrollAmount

      private double scrollAmount
    • SCROLLER_SPRITE

      private static final ResourceLocation SCROLLER_SPRITE
    • SCROLLER_BACKGROUND_SPRITE

      private static final ResourceLocation SCROLLER_BACKGROUND_SPRITE
    • scrolling

      private boolean scrolling
  • Constructor Details

    • AbstractScrollArea

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

    • mouseScrolled

      public boolean mouseScrolled(double pMouseX, double pMouseY, double pScrollX, double pScrollY)
    • 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.
    • onRelease

      public void onRelease(double pMouseX, double pMouseY)
      Overrides:
      onRelease in class AbstractWidget
    • scrollAmount

      public double scrollAmount()
    • setScrollAmount

      public void setScrollAmount(double pScrollAmount)
    • updateScrolling

      public boolean updateScrolling(double pMouseX, double pMouseY, int pButton)
    • refreshScrollAmount

      public void refreshScrollAmount()
    • maxScrollAmount

      public int maxScrollAmount()
    • scrollbarVisible

      protected boolean scrollbarVisible()
    • scrollerHeight

      protected int scrollerHeight()
    • scrollBarX

      protected int scrollBarX()
    • scrollBarY

      protected int scrollBarY()
    • renderScrollbar

      protected void renderScrollbar(GuiGraphics pGuiGraphics)
    • contentHeight

      protected abstract int contentHeight()
    • scrollRate

      protected abstract double scrollRate()