Class IconButton

java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.widget.ClickableWidget
net.minecraft.client.gui.widget.PressableWidget
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, net.minecraft.client.gui.Narratable, net.minecraft.client.gui.Selectable

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, net.minecraft.client.gui.widget.ButtonWidget.TooltipSupplier

    Nested classes/interfaces inherited from interface net.minecraft.client.gui.Selectable

    net.minecraft.client.gui.Selectable.SelectionType
  • Field Summary

    Fields inherited from class net.minecraft.client.gui.widget.ButtonWidget

    EMPTY, onPress, tooltipSupplier

    Fields inherited from class net.minecraft.client.gui.widget.ClickableWidget

    active, alpha, height, hovered, visible, WIDGETS_TEXTURE, 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
    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.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    renderButton(net.minecraft.client.util.math.MatrixStack matrices, int mouseX, int mouseY, float delta)
     

    Methods inherited from class net.minecraft.client.gui.widget.TexturedButtonWidget

    setPos

    Methods inherited from class net.minecraft.client.gui.widget.ButtonWidget

    appendNarrations, onPress, renderTooltip

    Methods inherited from class net.minecraft.client.gui.widget.PressableWidget

    keyPressed, onClick

    Methods inherited from class net.minecraft.client.gui.widget.ClickableWidget

    appendDefaultNarrations, changeFocus, clicked, getHeight, getMessage, getNarrationMessage, getNarrationMessage, getType, getWidth, getYImage, isFocused, isHovered, isMouseOver, isNarratable, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, onDrag, onFocusedChanged, onRelease, playDownSound, render, renderBackground, setAlpha, setFocused, setMessage, setWidth

    Methods inherited from class net.minecraft.client.gui.DrawableHelper

    drawCenteredText, drawCenteredText, drawCenteredTextWithShadow, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, drawWithOutline, drawWithShadow, fill, fillGradient, fillGradient, fillGradient, getZOffset, 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, 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 button
      y - The y position of the button
      width - The width of the button
      height - The height of the button
      u - The x position of the icon in the texture
      v - The y position of the icon in the texture
      hoveredVOffset - The offset of the icon when hovered
      texture - The texture of the icon
      textureWidth - The width of the texture
      textureHeight - The height of the texture
      pressAction - The action to perform when the button is pressed
  • Method Details

    • renderButton

      public void renderButton(net.minecraft.client.util.math.MatrixStack matrices, int mouseX, int mouseY, float delta)
      Overrides:
      renderButton in class net.minecraft.client.gui.widget.TexturedButtonWidget