Class Button
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractWidget.WithInactiveMessage
net.minecraft.client.gui.components.AbstractButton
net.minecraft.client.gui.components.Button
- All Implemented Interfaces:
GuiEventListener, Renderable, TabOrderedElement, LayoutElement, NarratableEntry, NarrationSupplier
- Direct Known Subclasses:
Button.Plain, ExtendedButton, ImageButton, LockIconButton, PageButton, PlainTextButton, RealmsResetWorldScreen.FrameButton, RealmsWorldSlotButton, SpriteIconButton
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfacestatic interfacestatic classNested classes/interfaces inherited from class AbstractWidget
AbstractWidget.WithInactiveMessageNested classes/interfaces inherited from interface NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprotected final Button.CreateNarrationstatic final intprotected static final Button.CreateNarrationstatic final intstatic final intprotected final Button.OnPressstatic final intFields inherited from class AbstractButton
SPRITES, TEXT_MARGINFields inherited from class AbstractWidget
active, alpha, height, isHovered, message, packedFGColor, UNSET_FG_COLOR, visible, width -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedButton(int x, int y, int width, int height, Component message, Button.OnPress onPress, Button.CreateNarration createNarration) protectedButton(Button.Builder builder) -
Method Summary
Modifier and TypeMethodDescriptionstatic Button.Builderbuilder(Component message, Button.OnPress onPress) protected MutableComponentvoidonPress(InputWithModifiers input) voidMethods inherited from class AbstractButton
keyPressed, onClick, renderContents, renderDefaultLabel, renderDefaultSprite, renderWidget, setOverrideRenderHighlightedSpriteMethods inherited from class AbstractWidget.WithInactiveMessage
defaultInactiveMessage, getMessage, setMessageMethods inherited from class AbstractWidget
clearFGColor, defaultButtonNarrationText, getAlpha, getBottom, getFGColor, getHeight, getRectangle, getRight, getTabOrderGroup, getWidth, getX, getY, handleCursor, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrationPriority, nextFocusPath, onDrag, onRelease, playButtonClickSound, playDownSound, render, renderScrollingStringOverContents, setAlpha, setFGColor, setFocused, setHeight, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessageMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface GuiEventListener
charTyped, getBorderForArrowNavigation, getCurrentFocusPath, keyReleased, mouseMoved, mouseScrolled, shouldTakeFocusAfterInteractionMethods inherited from interface LayoutElement
setPositionMethods inherited from interface NarratableEntry
getNarratables
-
Field Details
-
SMALL_WIDTH
public static final int SMALL_WIDTH- See Also:
-
DEFAULT_WIDTH
public static final int DEFAULT_WIDTH- See Also:
-
BIG_WIDTH
public static final int BIG_WIDTH- See Also:
-
DEFAULT_HEIGHT
public static final int DEFAULT_HEIGHT- See Also:
-
DEFAULT_SPACING
public static final int DEFAULT_SPACING- See Also:
-
DEFAULT_NARRATION
-
onPress
-
createNarration
-
-
Constructor Details
-
Button
protected Button(int x, int y, int width, int height, Component message, Button.OnPress onPress, Button.CreateNarration createNarration) -
Button
-
-
Method Details
-
builder
-
onPress
- Specified by:
onPressin classAbstractButton
-
createNarrationMessage
- Overrides:
createNarrationMessagein classAbstractWidget
-
updateWidgetNarration
- Specified by:
updateWidgetNarrationin classAbstractWidget
-