Package net.minecraft.client.gui.widget
Class ButtonWidget
java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.widget.AbstractButtonWidget
net.minecraft.client.gui.widget.AbstractPressableButtonWidget
net.minecraft.client.gui.widget.ButtonWidget
- Direct Known Subclasses:
LockButtonWidget
,MerchantScreen.WidgetButtonPage
,OptionButtonWidget
,PageTurnWidget
,RealmsMainScreen.CloseButton
,RealmsMainScreen.NewsButton
,RealmsMainScreen.PendingInvitesButton
,RealmsMainScreen.ShowPopupButton
,RealmsResetWorldScreen.FrameButton
,RealmsWorldSlotButton
,TexturedButtonWidget
@Environment(CLIENT) public class ButtonWidget extends AbstractPressableButtonWidget
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ButtonWidget.PressAction
static interface
ButtonWidget.TooltipSupplier
-
Field Summary
Fields Modifier and Type Field Description static ButtonWidget.TooltipSupplier
EMPTY
protected ButtonWidget.PressAction
onPress
protected ButtonWidget.TooltipSupplier
tooltipSupplier
Fields inherited from class net.minecraft.client.gui.widget.AbstractButtonWidget
active, alpha, height, hovered, nextNarration, visible, WIDGETS_LOCATION, width, x, y
Fields inherited from class net.minecraft.client.gui.DrawableHelper
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE
-
Constructor Summary
Constructors Constructor 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)
-
Method Summary
Modifier and Type Method Description void
onPress()
void
renderButton(MatrixStack matrices, int mouseX, int mouseY, float delta)
void
renderToolTip(MatrixStack matrices, int mouseX, int mouseY)
Methods inherited from class net.minecraft.client.gui.widget.AbstractPressableButtonWidget
keyPressed, onClick
Methods inherited from class net.minecraft.client.gui.widget.AbstractButtonWidget
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
Methods inherited from class net.minecraft.client.gui.DrawableHelper
drawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, setZOffset
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.client.gui.Element
charTyped, keyReleased, mouseMoved, mouseScrolled
-
Field Details
-
EMPTY
-
onPress
-
tooltipSupplier
-
-
Constructor Details
-
ButtonWidget
public ButtonWidget(int x, int y, int width, int height, Text message, ButtonWidget.PressAction onPress) -
ButtonWidget
public ButtonWidget(int x, int y, int width, int height, Text message, ButtonWidget.PressAction onPress, ButtonWidget.TooltipSupplier tooltipSupplier)
-
-
Method Details
-
onPress
public void onPress()- Specified by:
onPress
in classAbstractPressableButtonWidget
-
renderButton
- Overrides:
renderButton
in classAbstractButtonWidget
-
renderToolTip
- Overrides:
renderToolTip
in classAbstractButtonWidget
-