Package net.minecraft.client.gui.widget
Class Widget
java.lang.Object
net.minecraft.client.gui.AbstractGui
net.minecraft.client.gui.widget.Widget
- All Implemented Interfaces:
IGuiEventListener
,IRenderable
- Direct Known Subclasses:
AbstractButton
,AbstractSlider
,GamemodeSelectionScreen.SelectorWidget
,RecipeOverlayGui.RecipeButtonWidget
,RecipeWidget
,TextFieldWidget
,ToggleWidget
-
Field Summary
Modifier and TypeFieldDescriptionboolean
protected float
private boolean
protected int
protected boolean
private ITextComponent
protected long
protected int
static final int
boolean
private boolean
static final ResourceLocation
protected int
int
int
Fields inherited from class net.minecraft.client.gui.AbstractGui
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATION
-
Constructor Summary
ConstructorDescriptionWidget
(int p_i232254_1_, int p_i232254_2_, int p_i232254_3_, int p_i232254_4_, ITextComponent p_i232254_5_) -
Method Summary
Modifier and TypeMethodDescriptionboolean
changeFocus
(boolean p_231049_1_) void
protected boolean
clicked
(double p_230992_1_, double p_230992_3_) protected IFormattableTextComponent
int
int
int
getWidth()
protected int
getYImage
(boolean p_230989_1_) boolean
boolean
boolean
isMouseOver
(double p_231047_1_, double p_231047_3_) protected boolean
isValidClickButton
(int p_230987_1_) boolean
mouseClicked
(double p_231044_1_, double p_231044_3_, int p_231044_5_) boolean
mouseDragged
(double p_231045_1_, double p_231045_3_, int p_231045_5_, double p_231045_6_, double p_231045_8_) boolean
mouseReleased
(double p_231048_1_, double p_231048_3_, int p_231048_5_) protected void
narrate()
void
onClick
(double p_230982_1_, double p_230982_3_) protected void
onDrag
(double p_230983_1_, double p_230983_3_, double p_230983_5_, double p_230983_7_) protected void
onFocusedChanged
(boolean p_230995_1_) void
onRelease
(double p_231000_1_, double p_231000_3_) void
playDownSound
(SoundHandler p_230988_1_) void
queueNarration
(int p_230994_1_) void
render
(MatrixStack p_230430_1_, int p_230430_2_, int p_230430_3_, float p_230430_4_) protected void
renderBg
(MatrixStack p_230441_1_, Minecraft p_230441_2_, int p_230441_3_, int p_230441_4_) void
renderButton
(MatrixStack p_230431_1_, int p_230431_2_, int p_230431_3_, float p_230431_4_) void
renderToolTip
(MatrixStack p_230443_1_, int p_230443_2_, int p_230443_3_) void
setAlpha
(float p_230986_1_) void
setFGColor
(int color) protected void
setFocused
(boolean p_230996_1_) void
setHeight
(int value) void
setMessage
(ITextComponent p_238482_1_) void
setWidth
(int p_230991_1_) Methods inherited from class net.minecraft.client.gui.AbstractGui
blit, blit, blit, blit, blit, blitOutlineBlack, drawCenteredString, drawCenteredString, drawString, drawString, fill, 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.IGuiEventListener
charTyped, keyPressed, keyReleased, mouseMoved, mouseScrolled
-
Field Details
-
WIDGETS_LOCATION
-
width
protected int width -
height
protected int height -
x
public int x -
y
public int y -
message
-
wasHovered
private boolean wasHovered -
isHovered
protected boolean isHovered -
active
public boolean active -
visible
public boolean visible -
alpha
protected float alpha -
nextNarration
protected long nextNarration -
focused
private boolean focused -
UNSET_FG_COLOR
public static final int UNSET_FG_COLOR- See Also:
-
packedFGColor
protected int packedFGColor
-
-
Constructor Details
-
Widget
public Widget(int p_i232254_1_, int p_i232254_2_, int p_i232254_3_, int p_i232254_4_, ITextComponent p_i232254_5_)
-
-
Method Details
-
getHeight
public int getHeight() -
getYImage
protected int getYImage(boolean p_230989_1_) -
render
- Specified by:
render
in interfaceIRenderable
-
narrate
protected void narrate() -
createNarrationMessage
-
renderButton
public void renderButton(MatrixStack p_230431_1_, int p_230431_2_, int p_230431_3_, float p_230431_4_) -
renderBg
protected void renderBg(MatrixStack p_230441_1_, Minecraft p_230441_2_, int p_230441_3_, int p_230441_4_) -
onClick
public void onClick(double p_230982_1_, double p_230982_3_) -
onRelease
public void onRelease(double p_231000_1_, double p_231000_3_) -
onDrag
protected void onDrag(double p_230983_1_, double p_230983_3_, double p_230983_5_, double p_230983_7_) -
mouseClicked
public boolean mouseClicked(double p_231044_1_, double p_231044_3_, int p_231044_5_) - Specified by:
mouseClicked
in interfaceIGuiEventListener
-
mouseReleased
public boolean mouseReleased(double p_231048_1_, double p_231048_3_, int p_231048_5_) - Specified by:
mouseReleased
in interfaceIGuiEventListener
-
isValidClickButton
protected boolean isValidClickButton(int p_230987_1_) -
mouseDragged
public boolean mouseDragged(double p_231045_1_, double p_231045_3_, int p_231045_5_, double p_231045_6_, double p_231045_8_) - Specified by:
mouseDragged
in interfaceIGuiEventListener
-
clicked
protected boolean clicked(double p_230992_1_, double p_230992_3_) -
isHovered
public boolean isHovered() -
changeFocus
public boolean changeFocus(boolean p_231049_1_) - Specified by:
changeFocus
in interfaceIGuiEventListener
-
onFocusedChanged
protected void onFocusedChanged(boolean p_230995_1_) -
isMouseOver
public boolean isMouseOver(double p_231047_1_, double p_231047_3_) - Specified by:
isMouseOver
in interfaceIGuiEventListener
-
renderToolTip
-
playDownSound
-
getWidth
public int getWidth() -
setWidth
public void setWidth(int p_230991_1_) -
setHeight
public void setHeight(int value) -
setAlpha
public void setAlpha(float p_230986_1_) -
setMessage
-
queueNarration
public void queueNarration(int p_230994_1_) -
getMessage
-
isFocused
public boolean isFocused() -
setFocused
protected void setFocused(boolean p_230996_1_) -
getFGColor
public int getFGColor() -
setFGColor
public void setFGColor(int color) -
clearFGColor
public void clearFGColor()
-