public class OnOffButton extends IndexedButton
idNO_TOOLTIP, onPress, onTooltip| Constructor and Description |
|---|
OnOffButton(int id,
int x,
int y,
int width,
int height,
boolean on,
net.minecraft.client.gui.widget.button.Button.IPressable pressedAction)
Initializes an on/off button.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isOn()
Checks if the button is on.
|
void |
setOn(boolean on)
Sets whether the button is on.
|
boolean |
toggle()
Toggles the button on or off.
|
getID, setMessageonPress, renderButton, renderToolTipkeyPressed, onClickchangeFocus, clearFGColor, clicked, createNarrationMessage, getFGColor, getHeight, getMessage, getWidth, getYImage, isFocused, isHovered, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrate, onDrag, onFocusedChanged, onRelease, playDownSound, queueNarration, render, renderBg, setAlpha, setFGColor, setFocused, setHeight, setMessage, setWidthblit, blit, blit, blit, blit, blitOutlineBlack, drawCenteredString, drawCenteredString, drawString, drawString, fill, fillGradient, fillGradient, getBlitOffset, hLine, setBlitOffset, vLinepublic OnOffButton(int id,
int x,
int y,
int width,
int height,
boolean on,
net.minecraft.client.gui.widget.button.Button.IPressable pressedAction)
x - The x coordinate of the left side of the button.y - The y coordinate of the top of the button.width - The width of the button.height - The height of the button.on - Whether the button is initially on.public boolean toggle()
public boolean isOn()
public void setOn(boolean on)
on - Whether the button will be on.