Class AbstractSliderButton
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractSliderButton
- All Implemented Interfaces:
GuiEventListener,Renderable,TabOrderedElement,LayoutElement,NarratableEntry,NarrationSupplier
- Direct Known Subclasses:
AbstractOptionSliderButton,ExtendedSlider,InputControlHandlers.NumberRangeHandler.SliderImpl,RealmsSlotOptionsScreen.SettingsSlider
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanstatic final intprotected booleanprivate static final intprivate static final intprivate static final ResourceLocationprivate static final ResourceLocationprivate static final ResourceLocationprivate static final ResourceLocationprotected static final intprotected doubleFields inherited from class net.minecraft.client.gui.components.AbstractWidget
active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, width -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSliderButton(int pX, int pY, int pWidth, int pHeight, Component pMessage, double pValue) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidprotected MutableComponentprotected ResourceLocationprotected ResourceLocationbooleankeyPressed(KeyEvent p_446064_) voidonClick(MouseButtonEvent p_446812_, boolean p_434040_) protected voidonDrag(MouseButtonEvent p_445921_, double p_93591_, double p_93592_) voidonRelease(MouseButtonEvent p_447332_) voidplayDownSound(SoundManager pHandler) voidrenderWidget(GuiGraphics p_283427_, int p_281447_, int p_282852_, float p_282409_) voidsetFocused(boolean p_265705_) Sets the focus state of the GUI element.private voidsetValue(double pValue) private voidsetValueFromMouse(MouseButtonEvent pEvent) protected abstract voidvoidupdateWidgetNarration(NarrationElementOutput p_168798_) Methods inherited from class net.minecraft.client.gui.components.AbstractWidget
clearFGColor, defaultButtonNarrationText, getBottom, getFGColor, getHeight, getMessage, getRectangle, getRight, getTabOrderGroup, getWidth, getX, getY, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrationPriority, nextFocusPath, playButtonClickSound, render, renderScrollingString, renderScrollingString, renderScrollingString, setAlpha, setFGColor, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, 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, keyReleased, mouseMoved, mouseScrolled, shouldTakeFocusAfterInteractionMethods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPositionMethods inherited from interface net.minecraft.client.gui.narration.NarratableEntry
getNarratables
-
Field Details
-
SLIDER_SPRITE
-
HIGHLIGHTED_SPRITE
-
SLIDER_HANDLE_SPRITE
-
SLIDER_HANDLE_HIGHLIGHTED_SPRITE
-
TEXT_MARGIN
protected static final int TEXT_MARGIN- See Also:
-
DEFAULT_HEIGHT
public static final int DEFAULT_HEIGHT- See Also:
-
HANDLE_WIDTH
private static final int HANDLE_WIDTH- See Also:
-
HANDLE_HALF_WIDTH
private static final int HANDLE_HALF_WIDTH- See Also:
-
value
protected double value -
canChangeValue
private boolean canChangeValue -
dragging
protected boolean dragging
-
-
Constructor Details
-
AbstractSliderButton
public AbstractSliderButton(int pX, int pY, int pWidth, int pHeight, Component pMessage, double pValue)
-
-
Method Details
-
getSprite
-
getHandleSprite
-
createNarrationMessage
- Overrides:
createNarrationMessagein classAbstractWidget
-
updateWidgetNarration
- Specified by:
updateWidgetNarrationin classAbstractWidget
-
renderWidget
- Specified by:
renderWidgetin classAbstractWidget
-
onClick
- Overrides:
onClickin classAbstractWidget
-
setFocused
public void setFocused(boolean p_265705_) Description copied from interface:GuiEventListenerSets the focus state of the GUI element.- Specified by:
setFocusedin interfaceGuiEventListener- Overrides:
setFocusedin classAbstractWidget- Parameters:
p_265705_-trueto apply focus,falseto remove focus
-
keyPressed
-
setValueFromMouse
-
setValue
private void setValue(double pValue) -
onDrag
- Overrides:
onDragin classAbstractWidget
-
playDownSound
- Overrides:
playDownSoundin classAbstractWidget
-
onRelease
- Overrides:
onReleasein classAbstractWidget
-
updateMessage
protected abstract void updateMessage() -
applyValue
protected abstract void applyValue()
-