@Environment(value=CLIENT) public abstract class SliderWidget extends AbstractButtonWidget
Modifier and Type | Field and Description |
---|---|
protected double |
value |
active, alpha, height, hovered, nextNarration, visible, WIDGETS_LOCATION, width, x, y
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE
Constructor and Description |
---|
SliderWidget(int x,
int y,
int width,
int height,
Text text,
double value) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
applyValue() |
protected MutableText |
getNarrationMessage() |
protected int |
getYImage(boolean hovered) |
boolean |
keyPressed(int keyCode,
int scanCode,
int modifiers)
Callback for when a key down event has been captured.
|
void |
onClick(double mouseX,
double mouseY) |
protected void |
onDrag(double mouseX,
double mouseY,
double deltaX,
double deltaY) |
void |
onRelease(double mouseX,
double mouseY) |
void |
playDownSound(SoundManager soundManager) |
protected void |
renderBg(MatrixStack matrices,
MinecraftClient client,
int mouseX,
int mouseY) |
private void |
setValue(double mouseX) |
private void |
setValueFromMouse(double mouseX) |
protected abstract void |
updateMessage() |
changeFocus, clicked, getHeight, getMessage, getWidth, isFocused, isHovered, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrate, onFocusedChanged, queueNarration, render, renderButton, renderToolTip, setAlpha, setFocused, setMessage, setWidth
drawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, setZOffset
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
charTyped, keyReleased, mouseMoved, mouseScrolled
public SliderWidget(int x, int y, int width, int height, Text text, double value)
protected int getYImage(boolean hovered)
getYImage
in class AbstractButtonWidget
protected MutableText getNarrationMessage()
getNarrationMessage
in class AbstractButtonWidget
protected void renderBg(MatrixStack matrices, MinecraftClient client, int mouseX, int mouseY)
renderBg
in class AbstractButtonWidget
public void onClick(double mouseX, double mouseY)
onClick
in class AbstractButtonWidget
public boolean keyPressed(int keyCode, int scanCode, int modifiers)
GLFW
class.keyCode
- the named key code of the event as described in the GLFW
classscanCode
- the unique/platform-specific scan code of the keyboard inputmodifiers
- a GLFW bitfield describing the modifier keys that are held down (see GLFW Modifier key flags)true
to indicate that the event handling is successful/validKeyboard.onKey(long, int, int, int, int)
,
GLFW.GLFW_KEY_Q
,
GLFWKeyCallbackI.invoke(long, int, int, int, int)
private void setValueFromMouse(double mouseX)
private void setValue(double mouseX)
protected void onDrag(double mouseX, double mouseY, double deltaX, double deltaY)
onDrag
in class AbstractButtonWidget
public void playDownSound(SoundManager soundManager)
playDownSound
in class AbstractButtonWidget
public void onRelease(double mouseX, double mouseY)
onRelease
in class AbstractButtonWidget
protected abstract void updateMessage()
protected abstract void applyValue()