Class DescriptiveText
java.lang.Object
com.pixelmonmod.pixelmon.client.gui.widgets.DescriptiveText
Renders a line of text. Can be used to display a description about the text when hovering over it.
-
Constructor Summary
ConstructorsConstructorDescriptionDescriptiveText(String text, String description, int x, int y, TextAlignment align) Initializes the text with description. -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(net.minecraft.client.gui.GuiGraphics graphics) Draws the text.Gets the description for the text.booleanisHovering(int cursorX, int cursorY) Checks if the cursor is hovering over the text.
-
Constructor Details
-
DescriptiveText
Initializes the text with description.- Parameters:
text- The line of text to display.description- A description for the line of text.x- The x coordinate of the text.y- The y coordinate of the text.align- The alignment of the text.
-
-
Method Details
-
draw
public void draw(net.minecraft.client.gui.GuiGraphics graphics) Draws the text. -
isHovering
public boolean isHovering(int cursorX, int cursorY) Checks if the cursor is hovering over the text.- Parameters:
cursorX- The x coordinate of the cursor.cursorY- The y coordinate of the cursor.- Returns:
- Whether the cursor is hovering over the text.
-
getDescription
Gets the description for the text.- Returns:
- The description for the text.
-