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 double
static final int
private static final ResourceLocation
private static final ResourceLocation
private boolean
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
ConstructorsConstructorDescriptionAbstractScrollArea
(int pX, int pY, int pWidth, int pHeight, Component pMessage) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract int
int
boolean
mouseDragged
(double pMouseX, double pMouseY, int pButton, double pDragX, double pDragY) Called when the mouse is dragged within the GUI element.boolean
mouseScrolled
(double pMouseX, double pMouseY, double pScrollX, double pScrollY) void
onRelease
(double pMouseX, double pMouseY) void
protected void
renderScrollbar
(GuiGraphics pGuiGraphics) double
protected boolean
protected int
protected int
protected int
protected abstract double
void
setScrollAmount
(double pScrollAmount) boolean
updateScrolling
(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, 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, 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, getBorderForArrowNavigation, getCurrentFocusPath, keyPressed, keyReleased, mouseMoved
Methods inherited from interface net.neoforged.neoforge.client.extensions.IAbstractWidgetExtension
onClick
Methods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPosition
Methods 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
-
-
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 interfaceGuiEventListener
- Overrides:
mouseDragged
in classAbstractWidget
- 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 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()
-