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
,ForgeSlider
,RealmsSlotOptionsScreen.SettingsSlider
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
private static final int
private boolean
private static final int
private static final int
private static final int
private static final int
private static final int
static final ResourceLocation
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected double
Fields inherited from class net.minecraft.client.gui.components.AbstractWidget
ACCESSIBILITY_TEXTURE, active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, WIDGETS_LOCATION, width
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
ConstructorDescriptionAbstractSliderButton
(int p_93579_, int p_93580_, int p_93581_, int p_93582_, Component p_93583_, double p_93584_) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
protected MutableComponent
protected int
protected int
boolean
keyPressed
(int p_93596_, int p_93597_, int p_93598_) void
onClick
(double p_93588_, double p_93589_) protected void
onDrag
(double p_93591_, double p_93592_, double p_93593_, double p_93594_) void
onRelease
(double p_93609_, double p_93610_) void
playDownSound
(SoundManager p_93605_) void
renderWidget
(GuiGraphics p_283427_, int p_281447_, int p_282852_, float p_282409_) void
setFocused
(boolean p_265705_) private void
setValue
(double p_93612_) private void
setValueFromMouse
(double p_93586_) protected abstract void
void
updateWidgetNarration
(NarrationElementOutput p_168798_) Methods inherited from class net.minecraft.client.gui.components.AbstractWidget
clearFGColor, clicked, createTooltipPositioner, defaultButtonNarrationText, getFGColor, getHeight, getMessage, getRectangle, getTabOrderGroup, getTooltip, getWidth, getX, getY, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrationPriority, nextFocusPath, render, renderScrollingString, renderScrollingString, renderTexture, setAlpha, setFGColor, setHeight, setMessage, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, 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, getCurrentFocusPath, keyReleased, mouseMoved, mouseScrolled
Methods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPosition
-
Field Details
-
SLIDER_LOCATION
-
TEXTURE_WIDTH
protected static final int TEXTURE_WIDTH- See Also:
-
TEXTURE_HEIGHT
protected static final int TEXTURE_HEIGHT- See Also:
-
TEXTURE_BORDER_X
protected static final int TEXTURE_BORDER_X- See Also:
-
TEXTURE_BORDER_Y
protected static final int TEXTURE_BORDER_Y- See Also:
-
TEXT_MARGIN
protected static final int TEXT_MARGIN- See Also:
-
HEIGHT
private static final int HEIGHT- See Also:
-
HANDLE_HALF_WIDTH
private static final int HANDLE_HALF_WIDTH- See Also:
-
HANDLE_WIDTH
private static final int HANDLE_WIDTH- See Also:
-
BACKGROUND
private static final int BACKGROUND- See Also:
-
BACKGROUND_FOCUSED
private static final int BACKGROUND_FOCUSED- See Also:
-
HANDLE
private static final int HANDLE- See Also:
-
HANDLE_FOCUSED
private static final int HANDLE_FOCUSED- See Also:
-
value
protected double value -
canChangeValue
private boolean canChangeValue
-
-
Constructor Details
-
AbstractSliderButton
public AbstractSliderButton(int p_93579_, int p_93580_, int p_93581_, int p_93582_, Component p_93583_, double p_93584_)
-
-
Method Details
-
getTextureY
protected int getTextureY() -
getHandleTextureY
protected int getHandleTextureY() -
createNarrationMessage
- Overrides:
createNarrationMessage
in classAbstractWidget
-
updateWidgetNarration
- Specified by:
updateWidgetNarration
in classAbstractWidget
-
renderWidget
- Specified by:
renderWidget
in classAbstractWidget
-
onClick
public void onClick(double p_93588_, double p_93589_) - Overrides:
onClick
in classAbstractWidget
-
setFocused
public void setFocused(boolean p_265705_) - Specified by:
setFocused
in interfaceGuiEventListener
- Overrides:
setFocused
in classAbstractWidget
-
keyPressed
public boolean keyPressed(int p_93596_, int p_93597_, int p_93598_) -
setValueFromMouse
private void setValueFromMouse(double p_93586_) -
setValue
private void setValue(double p_93612_) -
onDrag
protected void onDrag(double p_93591_, double p_93592_, double p_93593_, double p_93594_) - Overrides:
onDrag
in classAbstractWidget
-
playDownSound
- Overrides:
playDownSound
in classAbstractWidget
-
onRelease
public void onRelease(double p_93609_, double p_93610_) - Overrides:
onRelease
in classAbstractWidget
-
updateMessage
protected abstract void updateMessage() -
applyValue
protected abstract void applyValue()
-