@Environment(value=CLIENT) public class ButtonWidget extends AbstractPressableButtonWidget
Modifier and Type | Class and Description |
---|---|
static interface |
ButtonWidget.PressAction |
static interface |
ButtonWidget.TooltipSupplier |
Modifier and Type | Field and Description |
---|---|
static ButtonWidget.TooltipSupplier |
EMPTY |
protected ButtonWidget.PressAction |
onPress |
protected ButtonWidget.TooltipSupplier |
tooltipSupplier |
active, alpha, height, hovered, nextNarration, visible, WIDGETS_LOCATION, width, x, y
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE
Constructor and Description |
---|
ButtonWidget(int x,
int y,
int width,
int height,
Text message,
ButtonWidget.PressAction onPress) |
ButtonWidget(int x,
int y,
int width,
int height,
Text message,
ButtonWidget.PressAction onPress,
ButtonWidget.TooltipSupplier tooltipSupplier) |
Modifier and Type | Method and Description |
---|---|
void |
onPress() |
void |
renderButton(MatrixStack matrices,
int mouseX,
int mouseY,
float delta) |
void |
renderToolTip(MatrixStack matrices,
int mouseX,
int mouseY) |
keyPressed, onClick
changeFocus, clicked, getHeight, getMessage, getNarrationMessage, getWidth, getYImage, isFocused, isHovered, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrate, onDrag, onFocusedChanged, onRelease, playDownSound, queueNarration, render, renderBg, 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 static final ButtonWidget.TooltipSupplier EMPTY
protected final ButtonWidget.PressAction onPress
protected final ButtonWidget.TooltipSupplier tooltipSupplier
public ButtonWidget(int x, int y, int width, int height, Text message, ButtonWidget.PressAction onPress)
public ButtonWidget(int x, int y, int width, int height, Text message, ButtonWidget.PressAction onPress, ButtonWidget.TooltipSupplier tooltipSupplier)
public void onPress()
onPress
in class AbstractPressableButtonWidget
public void renderButton(MatrixStack matrices, int mouseX, int mouseY, float delta)
renderButton
in class AbstractButtonWidget
public void renderToolTip(MatrixStack matrices, int mouseX, int mouseY)
renderToolTip
in class AbstractButtonWidget