Package net.minecraft.client.gui.widget
Class PressableWidget
java.lang.Object
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 named net/minecraft/client/gui/widget/PressableWidgetintermediary net/minecraft/class_4264official fid
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.Selectable
Selectable.SelectionType -
Field Summary
FieldsFields inherited from class net.minecraft.client.gui.widget.ClickableWidget
active, alpha, height, hovered, visible, widthFields inherited from interface net.minecraft.client.gui.Element
MAX_DOUBLE_CLICK_INTERVAL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddrawMessage(DrawContext context, TextRenderer textRenderer, int color) booleankeyPressed(int keyCode, int scanCode, int modifiers) Callback for when a key down event has been captured.voidonClick(double mouseX, double mouseY) abstract voidonPress()protected voidrenderWidget(DrawContext context, int mouseX, int mouseY, float delta) Methods inherited from class net.minecraft.client.gui.widget.ClickableWidget
appendClickableNarrations, appendDefaultNarrations, appendNarrations, clicked, drawScrollableText, drawScrollableText, drawScrollableText, forEachChild, getBottom, getHeight, getMessage, getNarrationMessage, getNarrationMessage, getNavigationFocus, getNavigationOrder, getNavigationPath, getRight, getTooltip, getType, getWidth, getX, getY, isFocused, isHovered, isMouseOver, isNarratable, isSelected, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, onDrag, onRelease, playDownSound, render, setAlpha, setDimensions, setDimensionsAndPosition, setFocused, setHeight, setMessage, setNavigationOrder, setTooltip, setTooltipDelay, setWidth, setX, setYMethods 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_43050
protected static final int field_43050- See Also:
- Mappings:
Namespace Name Mixin selector named field_43050Lnet/minecraft/client/gui/widget/PressableWidget;field_43050:Iintermediary field_43050Lnet/minecraft/class_4264;field_43050:Iofficial eLfid;e:I
-
TEXTURES
- Mappings:
Namespace Name Mixin selector named TEXTURESLnet/minecraft/client/gui/widget/PressableWidget;TEXTURES:Lnet/minecraft/client/gui/screen/ButtonTextures;intermediary field_45339Lnet/minecraft/class_4264;field_45339:Lnet/minecraft/class_8666;official aLfid;a:Lfjz;
-
-
Constructor Details
-
PressableWidget
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/client/gui/widget/ClickableWidget;<init>(IIIILnet/minecraft/text/Text;)Vintermediary <init>Lnet/minecraft/class_339;<init>(IIIILnet/minecraft/class_2561;)Vofficial <init>Lfik;<init>(IIIILwz;)V
-
-
Method Details
-
onPress
public abstract void onPress()- Mappings:
Namespace Name Mixin selector named onPressLnet/minecraft/client/gui/widget/PressableWidget;onPress()Vintermediary method_25306Lnet/minecraft/class_4264;method_25306()Vofficial bLfid;b()V
-
renderWidget
- Specified by:
renderWidgetin classClickableWidget- Mappings:
Namespace Name Mixin selector named renderWidgetLnet/minecraft/client/gui/widget/ClickableWidget;renderWidget(Lnet/minecraft/client/gui/DrawContext;IIF)Vintermediary method_48579Lnet/minecraft/class_339;method_48579(Lnet/minecraft/class_332;IIF)Vofficial bLfik;b(Lfhz;IIF)V
-
drawMessage
- Mappings:
Namespace Name Mixin selector named drawMessageLnet/minecraft/client/gui/widget/PressableWidget;drawMessage(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/client/font/TextRenderer;I)Vintermediary method_48589Lnet/minecraft/class_4264;method_48589(Lnet/minecraft/class_332;Lnet/minecraft/class_327;I)Vofficial aLfid;a(Lfhz;Lfhx;I)V
-
onClick
public void onClick(double mouseX, double mouseY) - Overrides:
onClickin classClickableWidget- Mappings:
Namespace Name Mixin selector named onClickLnet/minecraft/client/gui/widget/ClickableWidget;onClick(DD)Vintermediary method_25348Lnet/minecraft/class_339;method_25348(DD)Vofficial aLfik;a(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 named keyPressedLnet/minecraft/client/gui/Element;keyPressed(III)Zintermediary method_25404Lnet/minecraft/class_364;method_25404(III)Zofficial aLfki;a(III)Z
-