Class SpriteIconButton
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
net.minecraft.client.gui.components.SpriteIconButton
- All Implemented Interfaces:
GuiEventListener, Renderable, TabOrderedElement, LayoutElement, NarratableEntry, NarrationSupplier
- Direct Known Subclasses:
SpriteIconButton.CenteredIcon, SpriteIconButton.TextAndIcon
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classNested classes/interfaces inherited from class Button
Button.CreateNarration, Button.OnPress, Button.PlainNested classes/interfaces inherited from class AbstractWidget
AbstractWidget.WithInactiveMessageNested classes/interfaces inherited from interface NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Identifierprivate booleanprivate static final Identifierprivate static final intprivate static final intprivate static final Tooltipprotected final WidgetSpritesprotected final intprotected final intprotected final intprotected final intprivate final booleanFields inherited from class Button
BIG_WIDTH, createNarration, DEFAULT_HEIGHT, DEFAULT_NARRATION, DEFAULT_SPACING, DEFAULT_WIDTH, onPress, SMALL_WIDTHFields inherited from class AbstractButton
SPRITES, TEXT_MARGINFields inherited from class AbstractWidget
active, alpha, height, isHovered, message, packedFGColor, UNSET_FG_COLOR, visible, width -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSpriteIconButton(int width, int height, Component message, int spriteWidth, int spriteHeight, int spriteOffsetX, int spriteOffsetY, WidgetSprites sprite, Button.OnPress onPress, @Nullable Component tooltip, @Nullable Button.CreateNarration narration, boolean switchToLoadingAfterPress) -
Method Summary
Modifier and TypeMethodDescriptionstatic SpriteIconButton.Builderbuilder(Component message, Button.OnPress onPress, boolean iconOnly) protected booleanprotected voidextractSprite(GuiGraphicsExtractor graphics, int x, int y) booleanisActive()voidonPress(InputWithModifiers input) voidsetLoading(boolean loading) voidsetLoading(boolean loading, Tooltip loadingTooltip) Methods inherited from class Button
builder, createNarrationMessage, updateWidgetNarrationMethods inherited from class AbstractButton
extractContents, extractDefaultLabel, extractDefaultSprite, extractWidgetRenderState, keyPressed, onClick, setOverrideRenderHighlightedSpriteMethods inherited from class AbstractWidget.WithInactiveMessage
defaultInactiveMessage, getMessage, setMessageMethods inherited from class AbstractWidget
clearFGColor, defaultButtonNarrationText, extractRenderState, extractScrollingStringOverContents, extractTooltipForNextRenderPass, getAlpha, getBottom, getFGColor, getHeight, getRectangle, getRight, getTabOrderGroup, getWidth, getX, getY, handleCursor, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrationPriority, nextFocusPath, onDrag, onRelease, playButtonClickSound, playDownSound, 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, preeditUpdated, shouldTakeFocusAfterInteractionMethods inherited from interface LayoutElement
setPositionMethods inherited from interface NarratableEntry
getNarratables
-
Field Details
-
BUTTON_DISABLED_SPRITE
-
LOADING_SPRITE
-
LOADING_TOOLTIP
-
LOADING_SPRITE_W
private static final int LOADING_SPRITE_W- See Also:
-
LOADING_SPRITE_H
private static final int LOADING_SPRITE_H- See Also:
-
sprite
-
spriteWidth
protected final int spriteWidth -
spriteHeight
protected final int spriteHeight -
spriteOffsetX
protected final int spriteOffsetX -
spriteOffsetY
protected final int spriteOffsetY -
switchToLoadingAfterPress
private final boolean switchToLoadingAfterPress -
defaultTooltip
-
loading
private boolean loading
-
-
Constructor Details
-
SpriteIconButton
private SpriteIconButton(int width, int height, Component message, int spriteWidth, int spriteHeight, int spriteOffsetX, int spriteOffsetY, WidgetSprites sprite, Button.OnPress onPress, @Nullable Component tooltip, @Nullable Button.CreateNarration narration, boolean switchToLoadingAfterPress)
-
-
Method Details
-
setLoading
public void setLoading(boolean loading) -
setLoading
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceNarratableEntry- Overrides:
isActivein classAbstractWidget
-
onPress
-
extractSprite
-
extractLoadingStateIfLoading
-
builder
public static SpriteIconButton.Builder builder(Component message, Button.OnPress onPress, boolean iconOnly)
-