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
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doublestatic final intprivate static final ResourceLocationprivate static final ResourceLocationprivate booleanFields inherited from class net.minecraft.client.gui.components.AbstractWidget
active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, widthFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
ConstructorsConstructorDescriptionAbstractScrollArea(int p_386878_, int p_387233_, int p_388234_, int p_386759_, Component p_388945_) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract intintbooleanmouseDragged(double p_387876_, double p_387261_, int p_386570_, double p_387432_, double p_386793_) Called when the mouse is dragged within the GUI element.booleanmouseScrolled(double p_388530_, double p_387300_, double p_388604_, double p_386550_) voidonRelease(double p_387091_, double p_388483_) voidprotected voidrenderScrollbar(GuiGraphics pGuiGraphics) doubleprotected booleanprotected intprotected intprotected intprotected abstract doublevoidsetScrollAmount(double pScrollAmount) booleanupdateScrolling(double pMouseX, double pMouseY, int pButton) 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, mouseReleased, narrationPriority, nextFocusPath, onClick, onDrag, playButtonClickSound, playDownSound, render, renderScrollingString, renderScrollingString, renderScrollingString, renderWidget, setAlpha, setFGColor, setFocused, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, updateWidgetNarration, visitWidgets, wrapDefaultNarrationMessageMethods inherited from class java.lang.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, mouseMovedMethods inherited from interface net.neoforged.neoforge.client.extensions.IAbstractWidgetExtension
onClickMethods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPositionMethods inherited from interface net.minecraft.client.gui.narration.NarratableEntry
getNarratables
-
Field Details
-
SCROLLBAR_WIDTH
public static final int SCROLLBAR_WIDTH- See Also:
-
scrollAmount
private double scrollAmount -
SCROLLER_SPRITE
-
SCROLLER_BACKGROUND_SPRITE
-
scrolling
private boolean scrolling
-
-
Constructor Details
-
AbstractScrollArea
public AbstractScrollArea(int p_386878_, int p_387233_, int p_388234_, int p_386759_, Component p_388945_)
-
-
Method Details
-
mouseScrolled
public boolean mouseScrolled(double p_388530_, double p_387300_, double p_388604_, double p_386550_) -
mouseDragged
public boolean mouseDragged(double p_387876_, double p_387261_, int p_386570_, double p_387432_, double p_386793_) Description copied from interface:GuiEventListenerCalled when the mouse is dragged within the GUI element.- Specified by:
mouseDraggedin interfaceGuiEventListener- Overrides:
mouseDraggedin classAbstractWidget- Parameters:
p_387876_- the X coordinate of the mouse.p_387261_- the Y coordinate of the mouse.p_386570_- the button that is being dragged.p_387432_- the X distance of the drag.p_386793_- the Y distance of the drag.- Returns:
trueif the event is consumed,falseotherwise.
-
onRelease
public void onRelease(double p_387091_, double p_388483_) - Overrides:
onReleasein classAbstractWidget
-
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
-
contentHeight
protected abstract int contentHeight() -
scrollRate
protected abstract double scrollRate()
-