Class TooltipElement

java.lang.Object
com.binaris.wizardry.client.gui.elements.TooltipElement
Direct Known Subclasses:
TooltipElementProgressionBar, TooltipElementSpellList, TooltipElementText

public abstract class TooltipElement extends Object
Used internally for the ArcaneWorkbechScreen, this is just the template that display information about the selected item in the menu, with this you could render:
text (Check TooltipElementText)
items (Check TooltipElementUpgrades)
and custom textures and lists (Check TooltipElementSpellEntry and TooltipElementSpellList)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    Space from this tooltip element and the next one
  • Constructor Summary

    Constructors
    Constructor
    Description
    TooltipElement(int spaceAfter, TooltipElement... children)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    drawBackground(net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, net.minecraft.world.item.ItemStack stack, float partialTicks, int mouseX, int mouseY)
    Draws the background layer of this element.
    int
    drawBackgroundLayer(net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, net.minecraft.world.item.ItemStack stack, float partialTicks, int mouseX, int mouseY)
    Renders the background layer for this element and its children.
    protected abstract void
    drawForeground(net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, net.minecraft.world.item.ItemStack stack, int mouseX, int mouseY)
    Draws the foreground layer of this element.
    int
    drawForegroundLayer(net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, net.minecraft.world.item.ItemStack stack, int mouseX, int mouseY)
    Renders the foreground layer for this element and its children.
    protected abstract int
    getHeight(net.minecraft.world.item.ItemStack stack)
    Returns the vertical height of this element (excluding children or spacing).
    int
    getTotalHeight(net.minecraft.world.item.ItemStack stack)
    Calculate the used distance between this tooltip element and the next one
    protected abstract boolean
    isVisible(net.minecraft.world.item.ItemStack stack)
    Whether this tooltip element should be visible for the given item stack.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • spaceAfter

      public final int spaceAfter
      Space from this tooltip element and the next one
  • Constructor Details

    • TooltipElement

      public TooltipElement(int spaceAfter, TooltipElement... children)
  • Method Details

    • getTotalHeight

      public int getTotalHeight(net.minecraft.world.item.ItemStack stack)
      Calculate the used distance between this tooltip element and the next one
    • drawBackgroundLayer

      public int drawBackgroundLayer(net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, net.minecraft.world.item.ItemStack stack, float partialTicks, int mouseX, int mouseY)
      Renders the background layer for this element and its children. This is where you should draw boxes, icons, and backgrounds before text.
    • drawForegroundLayer

      public int drawForegroundLayer(net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, net.minecraft.world.item.ItemStack stack, int mouseX, int mouseY)
      Renders the foreground layer for this element and its children. This is where you should draw text or overlays on top of the background.
    • isVisible

      protected abstract boolean isVisible(net.minecraft.world.item.ItemStack stack)
      Whether this tooltip element should be visible for the given item stack. Used to conditionally render elements based on item tags or state.
    • getHeight

      protected abstract int getHeight(net.minecraft.world.item.ItemStack stack)
      Returns the vertical height of this element (excluding children or spacing).
    • drawBackground

      protected abstract void drawBackground(net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, net.minecraft.world.item.ItemStack stack, float partialTicks, int mouseX, int mouseY)
      Draws the background layer of this element.
    • drawForeground

      protected abstract void drawForeground(net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, net.minecraft.world.item.ItemStack stack, int mouseX, int mouseY)
      Draws the foreground layer of this element.