@Environment(value=CLIENT) public abstract class AbstractButtonWidget extends DrawableHelper implements Drawable, Element
| Modifier and Type | Field and Description |
|---|---|
boolean |
active |
protected float |
alpha |
private boolean |
focused |
protected int |
height |
protected boolean |
hovered |
private Text |
message |
protected long |
nextNarration |
boolean |
visible |
private boolean |
wasHovered |
static Identifier |
WIDGETS_LOCATION |
protected int |
width |
int |
x |
int |
y |
BACKGROUND_TEXTURE, GUI_ICONS_TEXTURE, STATS_ICON_TEXTURE| Constructor and Description |
|---|
AbstractButtonWidget(int x,
int y,
int width,
int height,
Text message) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
changeFocus(boolean lookForwards) |
protected boolean |
clicked(double mouseX,
double mouseY) |
int |
getHeight() |
Text |
getMessage() |
protected MutableText |
getNarrationMessage() |
int |
getWidth() |
protected int |
getYImage(boolean isHovered) |
boolean |
isFocused() |
boolean |
isHovered() |
boolean |
isMouseOver(double mouseX,
double mouseY) |
protected boolean |
isValidClickButton(int button) |
boolean |
mouseClicked(double mouseX,
double mouseY,
int button) |
boolean |
mouseDragged(double mouseX,
double mouseY,
int button,
double deltaX,
double deltaY) |
boolean |
mouseReleased(double mouseX,
double mouseY,
int button) |
protected void |
narrate() |
void |
onClick(double mouseX,
double mouseY) |
protected void |
onDrag(double mouseX,
double mouseY,
double deltaX,
double deltaY) |
protected void |
onFocusedChanged(boolean bool) |
void |
onRelease(double mouseX,
double mouseY) |
void |
playDownSound(SoundManager soundManager) |
void |
queueNarration(int delay) |
void |
render(MatrixStack matrices,
int mouseX,
int mouseY,
float delta) |
protected void |
renderBg(MatrixStack matrices,
MinecraftClient client,
int mouseX,
int mouseY) |
void |
renderButton(MatrixStack matrices,
int mouseX,
int mouseY,
float delta) |
void |
renderToolTip(MatrixStack matrices,
int mouseX,
int mouseY) |
void |
setAlpha(float value) |
protected void |
setFocused(boolean focused) |
void |
setMessage(Text text) |
void |
setWidth(int value) |
drawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, setZOffsetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcharTyped, keyPressed, keyReleased, mouseMoved, mouseScrolledpublic static final Identifier WIDGETS_LOCATION
protected int width
protected int height
public int x
public int y
private Text message
private boolean wasHovered
protected boolean hovered
public boolean active
public boolean visible
protected float alpha
protected long nextNarration
private boolean focused
public AbstractButtonWidget(int x,
int y,
int width,
int height,
Text message)
public int getHeight()
protected int getYImage(boolean isHovered)
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta)
protected void narrate()
protected MutableText getNarrationMessage()
public void renderButton(MatrixStack matrices, int mouseX, int mouseY, float delta)
protected void renderBg(MatrixStack matrices, MinecraftClient client, int mouseX, int mouseY)
public void onClick(double mouseX,
double mouseY)
public void onRelease(double mouseX,
double mouseY)
protected void onDrag(double mouseX,
double mouseY,
double deltaX,
double deltaY)
public boolean mouseClicked(double mouseX,
double mouseY,
int button)
mouseClicked in interface Elementpublic boolean mouseReleased(double mouseX,
double mouseY,
int button)
mouseReleased in interface Elementprotected boolean isValidClickButton(int button)
public boolean mouseDragged(double mouseX,
double mouseY,
int button,
double deltaX,
double deltaY)
mouseDragged in interface Elementprotected boolean clicked(double mouseX,
double mouseY)
public boolean isHovered()
public boolean changeFocus(boolean lookForwards)
changeFocus in interface Elementprotected void onFocusedChanged(boolean bool)
public boolean isMouseOver(double mouseX,
double mouseY)
isMouseOver in interface Elementpublic void renderToolTip(MatrixStack matrices, int mouseX, int mouseY)
public void playDownSound(SoundManager soundManager)
public int getWidth()
public void setWidth(int value)
public void setAlpha(float value)
public void setMessage(Text text)
public void queueNarration(int delay)
public Text getMessage()
public boolean isFocused()
protected void setFocused(boolean focused)