Class AbstractWidget
java.lang.Object
net.minecraft.client.gui.GuiComponent
net.minecraft.client.gui.components.AbstractWidget
- All Implemented Interfaces:
GuiEventListener
,Widget
,NarratableEntry
,NarrationSupplier
- Direct Known Subclasses:
AbstractButton
,AbstractScrollWidget
,AbstractSliderButton
,EditBox
,GameModeSwitcherScreen.GameModeSlot
,OverlayRecipeComponent.OverlayRecipeButton
,RecipeButton
,StateSwitchingButton
public abstract class AbstractWidget
extends GuiComponent
implements Widget, GuiEventListener, NarratableEntry
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority
-
Field Summary
Modifier and TypeFieldDescriptionboolean
protected float
private boolean
protected int
protected boolean
private Component
protected int
static final int
boolean
static final ResourceLocation
protected int
int
int
Fields inherited from class net.minecraft.client.gui.GuiComponent
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATION
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
ConstructorDescriptionAbstractWidget
(int p_93629_, int p_93630_, int p_93631_, int p_93632_, Component p_93633_) -
Method Summary
Modifier and TypeMethodDescriptionboolean
changeFocus
(boolean p_93691_) void
protected boolean
clicked
(double p_93681_, double p_93682_) protected MutableComponent
protected void
defaultButtonNarrationText
(NarrationElementOutput p_168803_) int
int
int
getWidth()
protected int
getYImage
(boolean p_93668_) boolean
isActive()
boolean
boolean
boolean
isMouseOver
(double p_93672_, double p_93673_) protected boolean
isValidClickButton
(int p_93652_) boolean
mouseClicked
(double p_93641_, double p_93642_, int p_93643_) boolean
mouseDragged
(double p_93645_, double p_93646_, int p_93647_, double p_93648_, double p_93649_) boolean
mouseReleased
(double p_93684_, double p_93685_, int p_93686_) void
onClick
(double p_93634_, double p_93635_) protected void
onDrag
(double p_93636_, double p_93637_, double p_93638_, double p_93639_) protected void
onFocusedChanged
(boolean p_93689_) void
onRelease
(double p_93669_, double p_93670_) void
playDownSound
(SoundManager p_93665_) void
protected void
void
renderButton
(PoseStack p_93676_, int p_93677_, int p_93678_, float p_93679_) void
renderToolTip
(PoseStack p_93653_, int p_93654_, int p_93655_) void
setAlpha
(float p_93651_) void
setFGColor
(int color) protected void
setFocused
(boolean p_93693_) void
setHeight
(int value) void
setMessage
(Component p_93667_) void
setWidth
(int p_93675_) static MutableComponent
wrapDefaultNarrationMessage
(Component p_168800_) Methods inherited from class net.minecraft.client.gui.GuiComponent
blit, blit, blit, blit, blit, blitOutlineBlack, disableScissor, drawCenteredString, drawCenteredString, drawCenteredString, drawString, drawString, drawString, enableScissor, fill, fillGradient, fillGradient, fillGradient, getBlitOffset, hLine, setBlitOffset, vLine
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.components.events.GuiEventListener
charTyped, keyPressed, keyReleased, mouseMoved, mouseScrolled
Methods inherited from interface net.minecraft.client.gui.narration.NarrationSupplier
updateNarration
-
Field Details
-
WIDGETS_LOCATION
-
width
protected int width -
height
protected int height -
x
public int x -
y
public int y -
message
-
isHovered
protected boolean isHovered -
active
public boolean active -
visible
public boolean visible -
alpha
protected float alpha -
focused
private boolean focused -
UNSET_FG_COLOR
public static final int UNSET_FG_COLOR- See Also:
-
packedFGColor
protected int packedFGColor
-
-
Constructor Details
-
AbstractWidget
-
-
Method Details
-
getHeight
public int getHeight() -
getYImage
protected int getYImage(boolean p_93668_) -
render
-
createNarrationMessage
-
wrapDefaultNarrationMessage
-
renderButton
-
renderBg
-
onClick
public void onClick(double p_93634_, double p_93635_) -
onRelease
public void onRelease(double p_93669_, double p_93670_) -
onDrag
protected void onDrag(double p_93636_, double p_93637_, double p_93638_, double p_93639_) -
mouseClicked
public boolean mouseClicked(double p_93641_, double p_93642_, int p_93643_) - Specified by:
mouseClicked
in interfaceGuiEventListener
-
mouseReleased
public boolean mouseReleased(double p_93684_, double p_93685_, int p_93686_) - Specified by:
mouseReleased
in interfaceGuiEventListener
-
isValidClickButton
protected boolean isValidClickButton(int p_93652_) -
mouseDragged
public boolean mouseDragged(double p_93645_, double p_93646_, int p_93647_, double p_93648_, double p_93649_) - Specified by:
mouseDragged
in interfaceGuiEventListener
-
clicked
protected boolean clicked(double p_93681_, double p_93682_) -
isHoveredOrFocused
public boolean isHoveredOrFocused() -
changeFocus
public boolean changeFocus(boolean p_93691_) - Specified by:
changeFocus
in interfaceGuiEventListener
-
onFocusedChanged
protected void onFocusedChanged(boolean p_93689_) -
isMouseOver
public boolean isMouseOver(double p_93672_, double p_93673_) - Specified by:
isMouseOver
in interfaceGuiEventListener
-
renderToolTip
-
playDownSound
-
getWidth
public int getWidth() -
setWidth
public void setWidth(int p_93675_) -
setHeight
public void setHeight(int value) -
setAlpha
public void setAlpha(float p_93651_) -
setMessage
-
getMessage
-
isFocused
public boolean isFocused() -
isActive
public boolean isActive()- Specified by:
isActive
in interfaceNarratableEntry
-
setFocused
protected void setFocused(boolean p_93693_) -
getFGColor
public int getFGColor() -
setFGColor
public void setFGColor(int color) -
clearFGColor
public void clearFGColor() -
narrationPriority
- Specified by:
narrationPriority
in interfaceNarratableEntry
-
defaultButtonNarrationText
-