Class AbstractScroller

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

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 class net.minecraft.client.gui.components.AbstractWidget

    net.minecraft.client.gui.components.AbstractWidget.WithInactiveMessage

    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, message, packedFGColor, UNSET_FG_COLOR, visible, width
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractScroller(net.minecraft.client.gui.screens.Screen parentScreen, int x, int y, int width, int height, int trackLength, AbstractScroller.Mode mode, net.minecraft.resources.Identifier sprite)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    extractWidgetRenderState(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, float partialTick)
     
    abstract int
     
    int
     
    int
     
    abstract int
     
    boolean
    mouseClicked(net.minecraft.client.input.MouseButtonEvent event, boolean doubleClick)
     
    void
    onRelease(net.minecraft.client.input.MouseButtonEvent event)
     
    abstract void
    Called when the scroller is scrolled
    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, extractRenderState, extractScrollingStringOverContents, getAlpha, getBottom, getFGColor, getHeight, getMessage, getRectangle, getRight, getTabOrderGroup, getWidth, getX, getY, handleCursor, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, mouseDragged, mouseReleased, narrationPriority, nextFocusPath, onClick, onDrag, playButtonClickSound, playDownSound, setAlpha, setFGColor, setFocused, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessage

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

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

    charTyped, getBorderForArrowNavigation, getCurrentFocusPath, keyPressed, keyReleased, mouseMoved, mouseScrolled, preeditUpdated, shouldTakeFocusAfterInteraction

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

    setPosition

    Methods inherited from interface net.minecraft.client.gui.narration.NarratableEntry

    getNarratables
  • Constructor Details

    • AbstractScroller

      public AbstractScroller(net.minecraft.client.gui.screens.Screen parentScreen, int x, int y, int width, int height, int trackLength, AbstractScroller.Mode mode, net.minecraft.resources.Identifier 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

    • extractWidgetRenderState

      protected void extractWidgetRenderState(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, float partialTick)
      Specified by:
      extractWidgetRenderState 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)
    • mouseClicked

      public boolean mouseClicked(net.minecraft.client.input.MouseButtonEvent event, boolean doubleClick)
      Specified by:
      mouseClicked in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      mouseClicked in class net.minecraft.client.gui.components.AbstractWidget
    • onRelease

      public void onRelease(net.minecraft.client.input.MouseButtonEvent event)
      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()