Class Slider
- All Implemented Interfaces:
GuiEventListener,Widget,NarratableEntry,NarrationSupplier
This class is blatantly stolen from iChunUtils with permission.
- Author:
- iChun
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.client.gui.components.Button
Button.OnPress, Button.OnTooltipNested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanIs this slider control being dragged.booleandoubledoubleintbooleandoubleThe value of this slider control.Fields inherited from class net.minecraft.client.gui.components.Button
NO_TOOLTIP, onPress, onTooltipFields inherited from class net.minecraft.client.gui.components.AbstractWidget
active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, WIDGETS_LOCATION, width, x, yFields inherited from class net.minecraft.client.gui.GuiComponent
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATION -
Constructor Summary
ConstructorsConstructorDescriptionSlider(int xPos, int yPos, int width, int height, Component prefix, Component suf, double minVal, double maxVal, double currentVal, boolean showDec, boolean drawStr, Button.OnPress handler)Slider(int xPos, int yPos, int width, int height, Component prefix, Component suf, double minVal, double maxVal, double currentVal, boolean showDec, boolean drawStr, Button.OnPress handler, Slider.ISlider par)Slider(int xPos, int yPos, Component displayStr, double minVal, double maxVal, double currentVal, Button.OnPress handler, Slider.ISlider par) -
Method Summary
Modifier and TypeMethodDescriptiondoublegetValue()intintgetYImage(boolean par1)Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over this button.voidonClick(double mouseX, double mouseY)Returns true if the mouse has been pressed on this control.voidonRelease(double mouseX, double mouseY)Fired when the mouse button is released.protected voidFired when the mouse button is dragged.voidsetValue(double d)voidMethods inherited from class net.minecraftforge.fmlclient.gui.widget.ExtendedButton
renderButtonMethods inherited from class net.minecraft.client.gui.components.Button
onPress, renderToolTip, updateNarrationMethods inherited from class net.minecraft.client.gui.components.AbstractButton
keyPressedMethods inherited from class net.minecraft.client.gui.components.AbstractWidget
changeFocus, clearFGColor, clicked, createNarrationMessage, defaultButtonNarrationText, getFGColor, getHeight, getMessage, getWidth, isActive, isFocused, isHovered, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrationPriority, onDrag, onFocusedChanged, playDownSound, render, setAlpha, setFGColor, setFocused, setHeight, setMessage, setWidth, wrapDefaultNarrationMessageMethods inherited from class net.minecraft.client.gui.GuiComponent
blit, blit, blit, blit, blit, blitOutlineBlack, drawCenteredString, drawCenteredString, drawCenteredString, drawString, drawString, drawString, fill, fillGradient, fillGradient, fillGradient, getBlitOffset, hLine, setBlitOffset, vLineMethods 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, keyReleased, mouseMoved, mouseScrolled
-
Field Details
-
sliderValue
public double sliderValueThe value of this slider control. -
dispString
-
dragging
public boolean draggingIs this slider control being dragged. -
showDecimal
public boolean showDecimal -
minValue
public double minValue -
maxValue
public double maxValue -
precision
public int precision -
parent
-
suffix
-
drawString
public boolean drawString
-
-
Constructor Details
-
Slider
public Slider(int xPos, int yPos, int width, int height, Component prefix, Component suf, double minVal, double maxVal, double currentVal, boolean showDec, boolean drawStr, Button.OnPress handler) -
Slider
public Slider(int xPos, int yPos, int width, int height, Component prefix, Component suf, double minVal, double maxVal, double currentVal, boolean showDec, boolean drawStr, Button.OnPress handler, @Nullable Slider.ISlider par) -
Slider
public Slider(int xPos, int yPos, Component displayStr, double minVal, double maxVal, double currentVal, Button.OnPress handler, Slider.ISlider par)
-
-
Method Details
-
getYImage
public int getYImage(boolean par1)Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over this button.- Overrides:
getYImagein classAbstractWidget
-
renderBg
Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e).- Overrides:
renderBgin classAbstractWidget
-
onClick
public void onClick(double mouseX, double mouseY)Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent e).- Overrides:
onClickin classAbstractButton
-
updateSlider
public void updateSlider() -
onRelease
public void onRelease(double mouseX, double mouseY)Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e).- Overrides:
onReleasein classAbstractWidget
-
getValueInt
public int getValueInt() -
getValue
public double getValue() -
setValue
public void setValue(double d)
-