Class RoundSpriteButton
java.lang.Object
com.pixelmonmod.pixelmon.client.gui.widgets.RoundSpriteButton
A button with rounded edges.
-
Constructor Summary
ConstructorsConstructorDescriptionRoundSpriteButton
(int leftOffset, int topOffset, net.minecraft.resources.ResourceLocation sprite) Creates a rounded button. -
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.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) setSize
(int width, int height)
-
Constructor Details
-
RoundSpriteButton
public RoundSpriteButton(int leftOffset, int topOffset, net.minecraft.resources.ResourceLocation sprite) 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.sprite
- The sprite to draw on the button.
-
-
Method Details
-
setBackgroundColor
-
setBackgroundHoverColor
-
setSize
-
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.
-