Class TooltipElement
java.lang.Object
com.binaris.wizardry.client.gui.elements.TooltipElement
- Direct Known Subclasses:
TooltipElementProgressionBar,TooltipElementSpellList,TooltipElementText
Used internally for the
text (Check
items (Check
and custom textures and lists (Check
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
FieldsModifier and TypeFieldDescriptionfinal intSpace from this tooltip element and the next one -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voiddrawBackground(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.intdrawBackgroundLayer(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 voiddrawForeground(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.intdrawForegroundLayer(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 intgetHeight(net.minecraft.world.item.ItemStack stack) Returns the vertical height of this element (excluding children or spacing).intgetTotalHeight(net.minecraft.world.item.ItemStack stack) Calculate the used distance between this tooltip element and the next oneprotected abstract booleanisVisible(net.minecraft.world.item.ItemStack stack) Whether this tooltip element should be visible for the given item stack.
-
Field Details
-
spaceAfter
public final int spaceAfterSpace from this tooltip element and the next one
-
-
Constructor Details
-
TooltipElement
-
-
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.
-