Package net.uku3lig.ukulib.utils
Class IconButton
java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.widget.AbstractButtonWidget
net.minecraft.client.gui.widget.AbstractPressableButtonWidget
net.minecraft.client.gui.widget.ButtonWidget
net.minecraft.client.gui.widget.TexturedButtonWidget
net.uku3lig.ukulib.utils.IconButton
- All Implemented Interfaces:
net.minecraft.client.gui.Drawable,net.minecraft.client.gui.Element
public class IconButton
extends net.minecraft.client.gui.widget.TexturedButtonWidget
A simple button with an icon. Works best when the button is square.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.client.gui.widget.ButtonWidget
net.minecraft.client.gui.widget.ButtonWidget.PressAction -
Field Summary
Fields inherited from class net.minecraft.client.gui.widget.ButtonWidget
onPressFields inherited from class net.minecraft.client.gui.widget.AbstractButtonWidget
active, alpha, height, isHovered, nextNarration, visible, WIDGETS_LOCATION, width, x, yFields inherited from class net.minecraft.client.gui.DrawableHelper
BACKGROUND_LOCATION, blitOffset, GUI_ICONS_LOCATION, STATS_ICON_LOCATION -
Constructor Summary
ConstructorsConstructorDescriptionIconButton(int x, int y, int width, int height, int u, int v, int hoveredVOffset, net.minecraft.util.Identifier texture, int textureWidth, int textureHeight, net.minecraft.client.gui.widget.ButtonWidget.PressAction pressAction) Makes a new button with an icon. -
Method Summary
Methods inherited from class net.minecraft.client.gui.widget.TexturedButtonWidget
setPosMethods inherited from class net.minecraft.client.gui.widget.ButtonWidget
onPressMethods inherited from class net.minecraft.client.gui.widget.AbstractPressableButtonWidget
keyPressed, onClickMethods inherited from class net.minecraft.client.gui.widget.AbstractButtonWidget
changeFocus, clicked, getMessage, getNarrationMessage, getWidth, getYImage, isFocused, isHovered, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrate, onDrag, onFocusedChanged, onRelease, playDownSound, render, renderBg, renderToolTip, setAlpha, setFocused, setMessage, setWidthMethods inherited from class net.minecraft.client.gui.DrawableHelper
blit, blit, blit, blit, blit, drawCenteredString, drawRightAlignedString, drawString, fill, fillGradient, hLine, innerBlit, vLineMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.Element
charTyped, keyReleased, mouseMoved, mouseScrolled
-
Constructor Details
-
IconButton
public IconButton(int x, int y, int width, int height, int u, int v, int hoveredVOffset, net.minecraft.util.Identifier texture, int textureWidth, int textureHeight, net.minecraft.client.gui.widget.ButtonWidget.PressAction pressAction) Makes a new button with an icon.- Parameters:
x- The x position of the buttony- The y position of the buttonwidth- The width of the buttonheight- The height of the buttonu- The x position of the icon in the texturev- The y position of the icon in the texturehoveredVOffset- The offset of the icon when hoveredtexture- The texture of the icontextureWidth- The width of the texturetextureHeight- The height of the texturepressAction- The action to perform when the button is pressed
-
-
Method Details
-
renderButton
public void renderButton(int mouseX, int mouseY, float delta) - Overrides:
renderButtonin classnet.minecraft.client.gui.widget.TexturedButtonWidget
-