@Environment(value=CLIENT) public abstract class AbstractPressableButtonWidget extends AbstractButtonWidget
active, alpha, height, hovered, nextNarration, visible, WIDGETS_LOCATION, width, x, y
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE
Constructor and Description |
---|
AbstractPressableButtonWidget(int x,
int y,
int width,
int height,
Text message) |
Modifier and Type | Method and Description |
---|---|
boolean |
keyPressed(int keyCode,
int scanCode,
int modifiers)
Callback for when a key down event has been captured.
|
void |
onClick(double mouseX,
double mouseY) |
abstract void |
onPress() |
changeFocus, clicked, getHeight, getMessage, getNarrationMessage, getWidth, getYImage, isFocused, isHovered, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrate, onDrag, onFocusedChanged, onRelease, playDownSound, queueNarration, render, renderBg, 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 AbstractPressableButtonWidget(int x, int y, int width, int height, Text message)
public abstract void onPress()
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)