Package net.minecraft.client.gui.widget
Class PressableWidget
java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.widget.ClickableWidget
net.minecraft.client.gui.widget.PressableWidget
- All Implemented Interfaces:
Drawable,Element,Narratable,Navigable,Selectable,Widget
- Direct Known Subclasses:
BeaconScreen.BaseButtonWidget,ButtonWidget,CheckboxWidget,CyclingButtonWidget
A pressable widget has a press action. It is pressed when it is clicked. It is
also pressed when enter or space keys are pressed when it is selected.
- Mappings:
Namespace Name official enrintermediary net/minecraft/class_4264named net/minecraft/client/gui/widget/PressableWidget
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.Selectable
Selectable.SelectionType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intFields inherited from class net.minecraft.client.gui.widget.ClickableWidget
ACCESSIBILITY_TEXTURE, active, alpha, height, hovered, visible, WIDGETS_TEXTURE, widthFields inherited from class net.minecraft.client.gui.DrawableHelper
field_43045, GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTUREFields inherited from interface net.minecraft.client.gui.Element
MAX_DOUBLE_CLICK_INTERVAL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddrawMessage(MatrixStack matrixStack, TextRenderer textRenderer, int int2) booleankeyPressed(int keyCode, int scanCode, int modifiers) Callback for when a key down event has been captured.private intvoidonClick(double mouseX, double mouseY) abstract voidonPress()voidrenderButton(MatrixStack matrices, int mouseX, int mouseY, float delta) Methods inherited from class net.minecraft.client.gui.widget.ClickableWidget
appendClickableNarrations, appendDefaultNarrations, appendNarrations, clicked, drawTexture, forEachChild, getHeight, getMessage, getNarrationMessage, getNarrationMessage, getNavigationFocus, getNavigationOrder, getNavigationPath, getTooltipPositioner, getType, getWidth, getX, getY, isFocused, isHovered, isMouseOver, isNarratable, isValidClickButton, method_49604, method_49605, method_49606, mouseClicked, mouseDragged, mouseReleased, onDrag, onRelease, playDownSound, render, setAlpha, setFocused, setMessage, setNavigationOrder, setTooltip, setTooltipDelay, setWidth, setX, setYMethods inherited from class net.minecraft.client.gui.DrawableHelper
disableScissor, drawCenteredTextWithShadow, drawCenteredTextWithShadow, drawCenteredTextWithShadow, drawHorizontalLine, drawNineSlicedTexture, drawNineSlicedTexture, drawRepeatingTexture, drawSprite, drawSprite, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawTextWithShadow, drawTextWithShadow, drawVerticalLine, drawWithOutline, enableScissor, fill, fill, fillGradient, fillGradient, fillGradient, method_49601Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.Element
charTyped, getFocusedPath, keyReleased, mouseMoved, mouseScrolledMethods inherited from interface net.minecraft.client.gui.widget.Widget
setPosition
-
Field Details
-
field_43046
protected static final int field_43046- See Also:
- Mappings:
Namespace Name Mixin selector official kLenr;k:Iintermediary field_43046Lnet/minecraft/class_4264;field_43046:Inamed field_43046Lnet/minecraft/client/gui/widget/PressableWidget;field_43046:I
-
field_43047
protected static final int field_43047- See Also:
- Mappings:
Namespace Name Mixin selector official lLenr;l:Iintermediary field_43047Lnet/minecraft/class_4264;field_43047:Inamed field_43047Lnet/minecraft/client/gui/widget/PressableWidget;field_43047:I
-
field_43048
protected static final int field_43048- See Also:
- Mappings:
Namespace Name Mixin selector official mLenr;m:Iintermediary field_43048Lnet/minecraft/class_4264;field_43048:Inamed field_43048Lnet/minecraft/client/gui/widget/PressableWidget;field_43048:I
-
field_43049
protected static final int field_43049- See Also:
- Mappings:
Namespace Name Mixin selector official nLenr;n:Iintermediary field_43049Lnet/minecraft/class_4264;field_43049:Inamed field_43049Lnet/minecraft/client/gui/widget/PressableWidget;field_43049:I
-
field_43050
protected static final int field_43050- See Also:
- Mappings:
Namespace Name Mixin selector official oLenr;o:Iintermediary field_43050Lnet/minecraft/class_4264;field_43050:Inamed field_43050Lnet/minecraft/client/gui/widget/PressableWidget;field_43050:I
-
-
Constructor Details
-
PressableWidget
- Mappings:
Namespace Name Mixin selector official <init>Lenx;<init>(IIIILti;)Vintermediary <init>Lnet/minecraft/class_339;<init>(IIIILnet/minecraft/class_2561;)Vnamed <init>Lnet/minecraft/client/gui/widget/ClickableWidget;<init>(IIIILnet/minecraft/text/Text;)V
-
-
Method Details
-
onPress
public abstract void onPress()- Mappings:
Namespace Name Mixin selector official cLenr;c()Vintermediary method_25306Lnet/minecraft/class_4264;method_25306()Vnamed onPressLnet/minecraft/client/gui/widget/PressableWidget;onPress()V
-
renderButton
- Specified by:
renderButtonin classClickableWidget- Mappings:
Namespace Name Mixin selector official bLenx;b(Lehc;IIF)Vintermediary method_48579Lnet/minecraft/class_339;method_48579(Lnet/minecraft/class_4587;IIF)Vnamed renderButtonLnet/minecraft/client/gui/widget/ClickableWidget;renderButton(Lnet/minecraft/client/util/math/MatrixStack;IIF)V
-
drawMessage
- Mappings:
Namespace Name Mixin selector official aLenr;a(Lehc;Lenn;I)Vintermediary method_48589Lnet/minecraft/class_4264;method_48589(Lnet/minecraft/class_4587;Lnet/minecraft/class_327;I)Vnamed drawMessageLnet/minecraft/client/gui/widget/PressableWidget;drawMessage(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/font/TextRenderer;I)V
-
method_49602
private int method_49602()- Mappings:
Namespace Name Mixin selector official aLenr;a()Iintermediary method_49602Lnet/minecraft/class_4264;method_49602()Inamed method_49602Lnet/minecraft/client/gui/widget/PressableWidget;method_49602()I
-
onClick
public void onClick(double mouseX, double mouseY) - Overrides:
onClickin classClickableWidget- Mappings:
Namespace Name Mixin selector official aLenx;a(DD)Vintermediary method_25348Lnet/minecraft/class_339;method_25348(DD)Vnamed onClickLnet/minecraft/client/gui/widget/ClickableWidget;onClick(DD)V
-
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers) Callback for when a key down event has been captured. The key code is identified by the constants inGLFWclass.- Parameters:
keyCode- the named key code of the event as described in theGLFWclassscanCode- 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)- Returns:
trueto indicate that the event handling is successful/valid- See Also:
- Mappings:
Namespace Name Mixin selector official aLepj;a(III)Zintermediary method_25404Lnet/minecraft/class_364;method_25404(III)Znamed keyPressedLnet/minecraft/client/gui/Element;keyPressed(III)Z
-