Class Slider
- All Implemented Interfaces:
IGuiEventListener,IRenderable
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.widget.button.Button
Button.IPressable, Button.ITooltip -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanIs this slider control being dragged.booleandoubledoubleintbooleandoubleThe value of this slider control.Fields inherited from class net.minecraft.client.gui.widget.button.Button
NO_TOOLTIP, onPress, onTooltipFields inherited from class net.minecraft.client.gui.widget.Widget
active, alpha, height, isHovered, nextNarration, packedFGColor, UNSET_FG_COLOR, visible, WIDGETS_LOCATION, width, x, yFields inherited from class net.minecraft.client.gui.AbstractGui
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATION -
Constructor Summary
ConstructorsConstructorDescriptionSlider(int xPos, int yPos, int width, int height, ITextComponent prefix, ITextComponent suf, double minVal, double maxVal, double currentVal, boolean showDec, boolean drawStr, Button.IPressable handler) Slider(int xPos, int yPos, int width, int height, ITextComponent prefix, ITextComponent suf, double minVal, double maxVal, double currentVal, boolean showDec, boolean drawStr, Button.IPressable handler, Slider.ISlider par) Slider(int xPos, int yPos, ITextComponent displayStr, double minVal, double maxVal, double currentVal, Button.IPressable 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 voidrenderBg(MatrixStack mStack, Minecraft par1Minecraft, int par2, int par3) Fired when the mouse button is dragged.voidsetValue(double d) voidMethods inherited from class net.minecraftforge.fml.client.gui.widget.ExtendedButton
renderButtonMethods inherited from class net.minecraft.client.gui.widget.button.Button
onPress, renderToolTipMethods inherited from class net.minecraft.client.gui.widget.button.AbstractButton
keyPressedMethods inherited from class net.minecraft.client.gui.widget.Widget
changeFocus, clearFGColor, clicked, createNarrationMessage, getFGColor, getHeight, getMessage, getWidth, isFocused, isHovered, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrate, onDrag, onFocusedChanged, playDownSound, queueNarration, render, setAlpha, setFGColor, setFocused, setHeight, setMessage, setWidthMethods inherited from class net.minecraft.client.gui.AbstractGui
blit, blit, blit, blit, blit, blitOutlineBlack, drawCenteredString, drawCenteredString, drawString, drawString, fill, 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.IGuiEventListener
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, ITextComponent prefix, ITextComponent suf, double minVal, double maxVal, double currentVal, boolean showDec, boolean drawStr, Button.IPressable handler) -
Slider
public Slider(int xPos, int yPos, int width, int height, ITextComponent prefix, ITextComponent suf, double minVal, double maxVal, double currentVal, boolean showDec, boolean drawStr, Button.IPressable handler, @Nullable Slider.ISlider par) -
Slider
public Slider(int xPos, int yPos, ITextComponent displayStr, double minVal, double maxVal, double currentVal, Button.IPressable 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. -
renderBg
Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e). -
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). -
getValueInt
public int getValueInt() -
getValue
public double getValue() -
setValue
public void setValue(double d)
-