Class RoundButton
java.lang.Object
com.pixelmonmod.pixelmon.client.gui.widgets.RoundButton
A button with rounded edges.
-
Constructor Summary
ConstructorDescriptionRoundButton
(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 TypeMethodDescriptionvoid
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
getId()
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.
-
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
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
-
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
-
setBackgroundHoverColor
-
getId
public int getId() -
setId
-
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.
-