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 ClassesNested classes/interfaces inherited from class net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractWidget.WithInactiveMessageNested 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
ConstructorsConstructorDescriptionAbstractScroller(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 TypeMethodDescriptionprotected voidextractWidgetRenderState(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, float partialTick) abstract intintintabstract intbooleanmouseClicked(net.minecraft.client.input.MouseButtonEvent event, boolean doubleClick) voidonRelease(net.minecraft.client.input.MouseButtonEvent event) abstract voidonScroll()Called when the scroller is scrolledvoidupdatePos(double mouseX, double mouseY) protected voidupdateWidgetNarration(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, wrapDefaultNarrationMessageMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
charTyped, getBorderForArrowNavigation, getCurrentFocusPath, keyPressed, keyReleased, mouseMoved, mouseScrolled, preeditUpdated, shouldTakeFocusAfterInteractionMethods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPositionMethods 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 scrollerx- X position of the Top-Left corner of the scroller texturey- Y position of the Top-Left corner of the scroller texturewidth- Width of the scroller textureheight- Height of the scroller texturetrackLength- The track length of the scrollermode- Orientation of the scrollersprite- 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:
extractWidgetRenderStatein classnet.minecraft.client.gui.components.AbstractWidget
-
updateWidgetNarration
protected void updateWidgetNarration(net.minecraft.client.gui.narration.NarrationElementOutput narrationElementOutput) - Specified by:
updateWidgetNarrationin classnet.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:
mouseClickedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Overrides:
mouseClickedin classnet.minecraft.client.gui.components.AbstractWidget
-
onRelease
public void onRelease(net.minecraft.client.input.MouseButtonEvent event) - Overrides:
onReleasein classnet.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()
-