Class TexturedButton

java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.widgets.Button
net.glasslauncher.mods.api.gcapi.screen.widget.TexturedButton
All Implemented Interfaces:
HasToolTip

public class TexturedButton extends net.minecraft.client.gui.widgets.Button implements HasToolTip
Copied from ModMenu
  • Field Summary

    Fields inherited from class net.minecraft.client.gui.widgets.Button

    active, height, id, text, visible, width, x, y

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

    zOffset
  • Constructor Summary

    Constructors
    Constructor
    Description
    TexturedButton(int buttonId, int x, int y, int width, int height, int u, int v, String texture, int uWidth, int vHeight)
     
    TexturedButton(int buttonId, int x, int y, int width, int height, int u, int v, String texture, int uWidth, int vHeight, String message)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    The tooltip to show, can be multiline by adding another element onto the list.
    int[]
    The position and size of your element.
    protected boolean
    isHovered(int mouseX, int mouseY)
     
    void
    render(net.minecraft.client.Minecraft mc, int mouseX, int mouseY)
     
    void
    setPos(int x, int y)
     

    Methods inherited from class net.minecraft.client.gui.widgets.Button

    getYImage, isMouseOver, mouseReleased, postRender

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

    blit, drawLineHorizontal, drawLineVertical, drawTextWithShadow, drawTextWithShadowCentred, fill, fillGradient

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TexturedButton

      public TexturedButton(int buttonId, int x, int y, int width, int height, int u, int v, String texture, int uWidth, int vHeight)
    • TexturedButton

      public TexturedButton(int buttonId, int x, int y, int width, int height, int u, int v, String texture, int uWidth, int vHeight, String message)
  • Method Details

    • setPos

      public void setPos(int x, int y)
    • isHovered

      protected boolean isHovered(int mouseX, int mouseY)
    • render

      public void render(net.minecraft.client.Minecraft mc, int mouseX, int mouseY)
      Overrides:
      render in class net.minecraft.client.gui.widgets.Button
    • getTooltip

      public List<String> getTooltip()
      Description copied from interface: HasToolTip
      The tooltip to show, can be multiline by adding another element onto the list.
      Specified by:
      getTooltip in interface HasToolTip
      Returns:
      a List of colour-enabled strings to use as a tooltip.
    • getXYWH

      public int[] getXYWH()
      Description copied from interface: HasToolTip
      The position and size of your element. Required.
      Specified by:
      getXYWH in interface HasToolTip
      Returns:
      a 4 length array of ints, the X position, Y position, width and height of your element.