public class GuiSlider extends GuiButton
Modifier and Type | Class and Description |
---|---|
static interface |
GuiSlider.FormatHelper |
Modifier and Type | Field and Description |
---|---|
boolean |
isMouseDown |
BUTTON_TEXTURES, displayString, enabled, height, hovered, id, packedFGColour, visible, width, x, y
ICONS, OPTIONS_BACKGROUND, STAT_ICONS, zLevel
Constructor and Description |
---|
GuiSlider(GuiPageButtonList.GuiResponder guiResponder,
int idIn,
int x,
int y,
java.lang.String nameIn,
float minIn,
float maxIn,
float defaultValue,
GuiSlider.FormatHelper formatter) |
Modifier and Type | Method and Description |
---|---|
protected int |
getHoverState(boolean mouseOver)
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.
|
float |
getSliderPosition()
Gets the slider's position.
|
float |
getSliderValue()
Gets the value of the slider.
|
protected void |
mouseDragged(Minecraft mc,
int mouseX,
int mouseY)
Fired when the mouse button is dragged.
|
boolean |
mousePressed(Minecraft mc,
int mouseX,
int mouseY)
Returns true if the mouse has been pressed on this control.
|
void |
mouseReleased(int mouseX,
int mouseY)
Fired when the mouse button is released.
|
void |
setSliderPosition(float position)
Sets the position of the slider and notifies the associated responder
of the change
|
void |
setSliderValue(float value,
boolean notifyResponder)
Sets the slider's value, optionally notifying the associated responder of the change.
|
drawButton, drawButtonForegroundLayer, getButtonWidth, isMouseOver, playPressSound, setWidth
drawCenteredString, drawGradientRect, drawHorizontalLine, drawModalRectWithCustomSizedTexture, drawRect, drawScaledCustomSizeModalRect, drawString, drawTexturedModalRect, drawTexturedModalRect, drawTexturedModalRect, drawVerticalLine
public GuiSlider(GuiPageButtonList.GuiResponder guiResponder, int idIn, int x, int y, java.lang.String nameIn, float minIn, float maxIn, float defaultValue, GuiSlider.FormatHelper formatter)
public float getSliderValue()
public void setSliderValue(float value, boolean notifyResponder)
public float getSliderPosition()
protected int getHoverState(boolean mouseOver)
getHoverState
in class GuiButton
protected void mouseDragged(Minecraft mc, int mouseX, int mouseY)
mouseDragged
in class GuiButton
public void setSliderPosition(float position)
public boolean mousePressed(Minecraft mc, int mouseX, int mouseY)
mousePressed
in class GuiButton
public void mouseReleased(int mouseX, int mouseY)
mouseReleased
in class GuiButton