Package net.minecraft.client.gui.widget
Class ToggleButtonWidget
java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.widget.AbstractButtonWidget
net.minecraft.client.gui.widget.ToggleButtonWidget
- Direct Known Subclasses:
RecipeGroupButtonWidget
@Environment(CLIENT) public class ToggleButtonWidget extends AbstractButtonWidget
-
Field Summary
Fields Modifier and Type Field Description protected int
hoverVOffset
protected int
pressedUOffset
protected Identifier
texture
protected boolean
toggled
protected int
u
protected int
v
Fields inherited from class net.minecraft.client.gui.widget.AbstractButtonWidget
active, alpha, height, hovered, nextNarration, visible, WIDGETS_LOCATION, width, x, y
Fields inherited from class net.minecraft.client.gui.DrawableHelper
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE
-
Constructor Summary
Constructors Constructor Description ToggleButtonWidget(int x, int y, int width, int height, boolean toggled)
-
Method Summary
Modifier and Type Method Description boolean
isToggled()
void
renderButton(MatrixStack matrices, int mouseX, int mouseY, float delta)
void
setPos(int x, int y)
void
setTextureUV(int u, int v, int pressedUOffset, int hoverVOffset, Identifier texture)
void
setToggled(boolean toggled)
Methods inherited from class net.minecraft.client.gui.widget.AbstractButtonWidget
changeFocus, clicked, getHeight, getMessage, getNarrationMessage, getWidth, getYImage, isFocused, isHovered, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrate, onClick, onDrag, onFocusedChanged, onRelease, playDownSound, queueNarration, render, renderBg, renderToolTip, setAlpha, setFocused, setMessage, setWidth
Methods inherited from class net.minecraft.client.gui.DrawableHelper
drawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, setZOffset
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.Element
charTyped, keyPressed, keyReleased, mouseMoved, mouseScrolled
-
Field Details
-
texture
-
toggled
protected boolean toggled -
u
protected int u -
v
protected int v -
pressedUOffset
protected int pressedUOffset -
hoverVOffset
protected int hoverVOffset
-
-
Constructor Details
-
ToggleButtonWidget
public ToggleButtonWidget(int x, int y, int width, int height, boolean toggled)
-
-
Method Details
-
setTextureUV
-
setToggled
public void setToggled(boolean toggled) -
isToggled
public boolean isToggled() -
setPos
public void setPos(int x, int y) -
renderButton
- Overrides:
renderButton
in classAbstractButtonWidget
-