@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, yGUI_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, setWidthdrawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, setZOffsetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcharTyped, keyReleased, mouseMoved, mouseScrolledpublic SliderWidget(int x,
int y,
int width,
int height,
Text text,
double value)
protected int getYImage(boolean hovered)
getYImage in class AbstractButtonWidgetprotected MutableText getNarrationMessage()
getNarrationMessage in class AbstractButtonWidgetprotected void renderBg(MatrixStack matrices, MinecraftClient client, int mouseX, int mouseY)
renderBg in class AbstractButtonWidgetpublic void onClick(double mouseX,
double mouseY)
onClick in class AbstractButtonWidgetpublic 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 AbstractButtonWidgetpublic void playDownSound(SoundManager soundManager)
playDownSound in class AbstractButtonWidgetpublic void onRelease(double mouseX,
double mouseY)
onRelease in class AbstractButtonWidgetprotected abstract void updateMessage()
protected abstract void applyValue()