Class DescriptiveText

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

public class DescriptiveText extends Object
Renders a line of text. Can be used to display a description about the text when hovering over it.
  • Constructor Details

    • DescriptiveText

      public DescriptiveText(String text, String description, int x, int y, TextAlignment align)
      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

      public String getDescription()
      Gets the description for the text.
      Returns:
      The description for the text.