Class FancyButtonWidget

java.lang.Object
net.minecraft.client.gui.DrawContext
net.minecraft.client.gui.widget.ButtonWidget
net.glasslauncher.mods.api.gcapi.screen.widget.FancyButtonWidget
All Implemented Interfaces:
HasDrawable, HasToolTip

public class FancyButtonWidget extends net.minecraft.client.gui.widget.ButtonWidget implements HasDrawable, HasToolTip
  • Field Summary

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

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

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

    zOffset
  • Constructor Summary

    Constructors
    Constructor
    Description
    FancyButtonWidget(int id, int x, int y, int width, int height, String text)
     
    FancyButtonWidget(int id, int x, int y, int width, int height, String text, int overriddenColour)
     
    FancyButtonWidget(int id, int x, int y, String text)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    draw(int mouseX, int mouseY)
    Use this to render your drawable on the screen.
    The tooltip to show, can be multiline by adding another element onto the list.
    int[]
    The position and size of your element.
    void
    keyPressed(char character, int key)
    Called whenever a key is pressed.
    void
    mouseClicked(int mouseX, int mouseY, int button)
    Note: This is called any time the mouse is clicked.
    void
    render(net.minecraft.client.Minecraft minecraft, int mouseX, int mouseY)
     
    void
    setID(int id)
    Called when the config category is adding the drawable.
    void
    setXYWH(int x, int y, int width, int height)
    Called when setting the drawable position.
    void
    Called every frame.

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

    isMouseOver, method_1187, method_1188, mouseReleased

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

    drawCenteredTextWithShadow, drawHorizontalLine, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient

    Methods inherited from class java.lang.Object

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

    • FancyButtonWidget

      public FancyButtonWidget(int id, int x, int y, int width, int height, String text, int overriddenColour)
    • FancyButtonWidget

      public FancyButtonWidget(int id, int x, int y, int width, int height, String text)
    • FancyButtonWidget

      public FancyButtonWidget(int id, int x, int y, String text)
  • Method Details

    • setXYWH

      public void setXYWH(int x, int y, int width, int height)
      Description copied from interface: HasDrawable
      Called when setting the drawable position. X and Y is the top left corner.
      Specified by:
      setXYWH in interface HasDrawable
    • tick

      public void tick()
      Description copied from interface: HasDrawable
      Called every frame.
      Specified by:
      tick in interface HasDrawable
    • keyPressed

      public void keyPressed(char character, int key)
      Description copied from interface: HasDrawable
      Called whenever a key is pressed.
      Specified by:
      keyPressed in interface HasDrawable
    • draw

      public void draw(int mouseX, int mouseY)
      Description copied from interface: HasDrawable
      Use this to render your drawable on the screen.
      Specified by:
      draw in interface HasDrawable
    • render

      public void render(net.minecraft.client.Minecraft minecraft, int mouseX, int mouseY)
      Overrides:
      render in class net.minecraft.client.gui.widget.ButtonWidget
    • mouseClicked

      public void mouseClicked(int mouseX, int mouseY, int button)
      Description copied from interface: HasDrawable
      Note: This is called any time the mouse is clicked. Check the button ID if you want to only do stuff with your button.
      Specified by:
      mouseClicked in interface HasDrawable
    • setID

      public void setID(int id)
      Description copied from interface: HasDrawable
      Called when the config category is adding the drawable.
      Specified by:
      setID in interface HasDrawable
    • 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.