java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
com.portingdeadmods.portingdeadlibs.api.client.screens.widgets.AbstractScroller
All Implemented Interfaces:
net.minecraft.client.gui.components.events.GuiEventListener, net.minecraft.client.gui.components.Renderable, net.minecraft.client.gui.components.TabOrderedElement, net.minecraft.client.gui.layouts.LayoutElement, net.minecraft.client.gui.narration.NarratableEntry, net.minecraft.client.gui.narration.NarrationSupplier, net.neoforged.neoforge.client.extensions.IAbstractWidgetExtension

public abstract class AbstractScroller extends net.minecraft.client.gui.components.AbstractWidget
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     

    Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry

    net.minecraft.client.gui.narration.NarratableEntry.NarrationPriority
  • Field Summary

    Fields inherited from class net.minecraft.client.gui.components.AbstractWidget

    active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, width

    Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    DOUBLE_CLICK_THRESHOLD_MS
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractScroller(PDLAbstractContainerScreen<?> parentScreen, int x, int y, int width, int height, int trackLength, AbstractScroller.Mode mode, net.minecraft.resources.ResourceLocation sprite)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    clicked(double mouseX, double mouseY)
     
    abstract int
     
    int
     
    int
     
    abstract int
     
    void
    onRelease(double mouseX, double mouseY)
     
    abstract void
    Called when the scroller is scrolled
    void
    renderWidget(net.minecraft.client.gui.GuiGraphics guiGraphics)
     
    void
    renderWidget(net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick)
     
    void
    updatePos(double mouseX, double mouseY)
     
    protected void
    updateWidgetNarration(net.minecraft.client.gui.narration.NarrationElementOutput narrationElementOutput)
     

    Methods inherited from class net.minecraft.client.gui.components.AbstractWidget

    clearFGColor, createNarrationMessage, defaultButtonNarrationText, getBottom, getFGColor, getHeight, getMessage, getRectangle, getRight, getTabOrderGroup, getTooltip, getWidth, getX, getY, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrationPriority, nextFocusPath, onClick, onDrag, playDownSound, render, renderScrollingString, renderScrollingString, renderScrollingString, setAlpha, setFGColor, setFocused, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessage

    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.components.events.GuiEventListener

    charTyped, getCurrentFocusPath, keyPressed, keyReleased, mouseMoved, mouseScrolled

    Methods inherited from interface net.neoforged.neoforge.client.extensions.IAbstractWidgetExtension

    onClick

    Methods inherited from interface net.minecraft.client.gui.layouts.LayoutElement

    setPosition
  • Constructor Details

    • AbstractScroller

      public AbstractScroller(PDLAbstractContainerScreen<?> parentScreen, int x, int y, int width, int height, int trackLength, AbstractScroller.Mode mode, net.minecraft.resources.ResourceLocation sprite)
      Parameters:
      parentScreen - The parent screen of the scroller
      x - X position of the Top-Left corner of the scroller texture
      y - Y position of the Top-Left corner of the scroller texture
      width - Width of the scroller texture
      height - Height of the scroller texture
      trackLength - The track length of the scroller
      mode - Orientation of the scroller
      sprite - The texture of the scroller - It's recommended the texture to have an odd size (centerable to 1 px. Width for Horizontal - Horizontal for Vertical)
  • Method Details

    • renderWidget

      public void renderWidget(net.minecraft.client.gui.GuiGraphics guiGraphics)
    • renderWidget

      public void renderWidget(net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick)
      Specified by:
      renderWidget in class net.minecraft.client.gui.components.AbstractWidget
    • updateWidgetNarration

      protected void updateWidgetNarration(net.minecraft.client.gui.narration.NarrationElementOutput narrationElementOutput)
      Specified by:
      updateWidgetNarration in class net.minecraft.client.gui.components.AbstractWidget
    • updatePos

      public void updatePos(double mouseX, double mouseY)
    • clicked

      public boolean clicked(double mouseX, double mouseY)
      Overrides:
      clicked in class net.minecraft.client.gui.components.AbstractWidget
    • onRelease

      public void onRelease(double mouseX, double mouseY)
      Overrides:
      onRelease in class net.minecraft.client.gui.components.AbstractWidget
    • getScrollOffset

      public int getScrollOffset()
    • getContentLength

      public abstract int getContentLength()
      Returns:
      The total length of content that could be seen
    • getVisibleContentLength

      public abstract int getVisibleContentLength()
      Returns:
      The total length of the content that is visible at a moment in time
    • onScroll

      public abstract void onScroll()
      Called when the scroller is scrolled
    • getScrollableLength

      public int getScrollableLength()