Class RoundButton

java.lang.Object
com.pixelmonmod.pixelmon.client.gui.widgets.RoundButton

public class RoundButton extends Object
A button with rounded edges.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RoundButton(int leftOffset, int topOffset, String text)
    Creates a rounded button.
    RoundButton(int leftOffset, int topOffset, String text, int width, int height)
     
    RoundButton(int leftOffset, int topOffset, net.minecraft.network.chat.Component text)
    Creates a rounded button.
    RoundButton(int leftOffset, int topOffset, net.minecraft.network.chat.Component text, int width, int height)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    drawButton(net.minecraft.client.gui.GuiGraphics graphics, int leftX, int topY, double mouseX, double mouseY, float zLevel)
    Draws the button on the screen.
    void
    drawButton(net.minecraft.client.gui.GuiGraphics graphics, int leftX, int topY, double mouseX, double mouseY, float zLevel, boolean forceOutline)
    Draws the button on the screen.
    int
     
    boolean
    isMouseOver(int leftX, int topY, double mouseX, double mouseY)
    Checks if the cursor is over the button.
    void
    setBackgroundColor(Color backgroundColor)
     
    void
    setBackgroundHoverColor(Color backgroundHoverColor)
     
    setId(int id)
     
    void
    setText(net.minecraft.network.chat.Component text)
    Sets the text on the button.

    Methods inherited from class java.lang.Object

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

    • RoundButton

      public RoundButton(int leftOffset, int topOffset, net.minecraft.network.chat.Component text)
      Creates a rounded button.
      Parameters:
      leftOffset - The x offset of the button from the left of the screen.
      topOffset - The y offset of the button from the top of the screen.
      text - The text on the button.
    • RoundButton

      public RoundButton(int leftOffset, int topOffset, String text)
      Creates a rounded button.
      Parameters:
      leftOffset - The x offset of the button from the left of the screen.
      topOffset - The y offset of the button from the top of the screen.
      text - The text on the button.
    • RoundButton

      public RoundButton(int leftOffset, int topOffset, String text, int width, int height)
    • RoundButton

      public RoundButton(int leftOffset, int topOffset, net.minecraft.network.chat.Component text, int width, int height)
  • Method Details

    • setText

      public void setText(net.minecraft.network.chat.Component text)
      Sets the text on the button.
      Parameters:
      text - The text on the button.
    • setBackgroundColor

      public void setBackgroundColor(Color backgroundColor)
    • setBackgroundHoverColor

      public void setBackgroundHoverColor(Color backgroundHoverColor)
    • getId

      public int getId()
    • setId

      public RoundButton setId(int id)
    • drawButton

      public void drawButton(net.minecraft.client.gui.GuiGraphics graphics, int leftX, int topY, double mouseX, double mouseY, float zLevel)
      Draws the button on the screen.
      Parameters:
      leftX - The x coordinate of the left side of the screen.
      topY - The y coordinate of the top of the screen.
      mouseX - The x coordinate of the cursor.
      mouseY - The y coordinate of the cursor.
      zLevel - The z coordinate of the button.
    • drawButton

      public void drawButton(net.minecraft.client.gui.GuiGraphics graphics, int leftX, int topY, double mouseX, double mouseY, float zLevel, boolean forceOutline)
      Draws the button on the screen.
      Parameters:
      leftX - The x coordinate of the left side of the screen.
      topY - The y coordinate of the top of the screen.
      mouseX - The x coordinate of the cursor.
      mouseY - The y coordinate of the cursor.
      zLevel - The z coordinate of the button.
      forceOutline - Whether to force an outline to appear on the button regardless of mouseover.
    • isMouseOver

      public boolean isMouseOver(int leftX, int topY, double mouseX, double mouseY)
      Checks if the cursor is over the button.
      Parameters:
      leftX - The x coordinate of the left side of the screen.
      topY - The y coordinate of the top of the screen.
      mouseX - The x coordinate of the cursor.
      mouseY - The y coordinate of the cursor.
      Returns:
      Whether the cursor is over the button.