public class RoundButton
extends java.lang.Object
Constructor and Description |
---|
RoundButton(int leftOffset,
int topOffset,
java.lang.String text)
Creates a rounded button.
|
RoundButton(int leftOffset,
int topOffset,
java.lang.String text,
int width,
int height) |
Modifier and Type | Method and Description |
---|---|
void |
drawButton(com.mojang.blaze3d.matrix.MatrixStack matrix,
int leftX,
int topY,
double mouseX,
double mouseY,
float zLevel)
Draws the button on the screen.
|
void |
drawButton(com.mojang.blaze3d.matrix.MatrixStack matrix,
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.
|
RoundButton |
setId(int id) |
void |
setText(java.lang.String text)
Sets the text on the button.
|
public RoundButton(int leftOffset, int topOffset, java.lang.String text)
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.public RoundButton(int leftOffset, int topOffset, java.lang.String text, int width, int height)
public void setText(java.lang.String text)
text
- The text on the button.public int getId()
public RoundButton setId(int id)
public void drawButton(com.mojang.blaze3d.matrix.MatrixStack matrix, int leftX, int topY, double mouseX, double mouseY, float zLevel)
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.public void drawButton(com.mojang.blaze3d.matrix.MatrixStack matrix, int leftX, int topY, double mouseX, double mouseY, float zLevel, boolean forceOutline)
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.public boolean isMouseOver(int leftX, int topY, double mouseX, double mouseY)
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.