java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
io.github.pixelmk.pixelmkmenu.gui.components.Tooltip
All Implemented Interfaces:
net.minecraft.client.gui.components.events.GuiEventListener, net.minecraft.client.gui.components.Renderable, net.minecraft.client.gui.components.TabOrderedElement, net.minecraft.client.gui.layouts.LayoutElement, net.minecraft.client.gui.narration.NarratableEntry, net.minecraft.client.gui.narration.NarrationSupplier, net.neoforged.neoforge.client.extensions.IAbstractWidgetExtension

public class Tooltip extends net.minecraft.client.gui.components.AbstractWidget
Creates a rendered GUI string with a hoverable tooltip.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry

    net.minecraft.client.gui.narration.NarratableEntry.NarrationPriority
  • Field Summary

    Fields inherited from class net.minecraft.client.gui.components.AbstractWidget

    active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, width

    Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    DOUBLE_CLICK_THRESHOLD_MS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Tooltip(String tooltipText, String textShort, int positionX, int positionY, int verticalOffset)
    Creates a tooltip using the given parameters.
    Tooltip(List<String> tooltipLines, String textShort, int positionX, int positionY, int width, int height, int verticalOffset)
    Constructs a tooltip using the given parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    final net.minecraft.network.chat.Component
     
    protected void
    renderWidget(net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick)
     
    final void
    setMessage(net.minecraft.network.chat.Component message)
     
    protected void
    updateWidgetNarration(net.minecraft.client.gui.narration.NarrationElementOutput narrationElementOutput)
     

    Methods inherited from class net.minecraft.client.gui.components.AbstractWidget

    clearFGColor, clicked, createNarrationMessage, defaultButtonNarrationText, getBottom, getFGColor, getHeight, getRectangle, getRight, getTabOrderGroup, getTooltip, getWidth, getX, getY, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrationPriority, nextFocusPath, onClick, onDrag, onRelease, playDownSound, render, renderScrollingString, renderScrollingString, renderScrollingString, setAlpha, setFGColor, setFocused, setHeight, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessage

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    charTyped, getCurrentFocusPath, keyPressed, keyReleased, mouseMoved, mouseScrolled

    Methods inherited from interface net.neoforged.neoforge.client.extensions.IAbstractWidgetExtension

    onClick

    Methods inherited from interface net.minecraft.client.gui.layouts.LayoutElement

    setPosition
  • Constructor Details

    • Tooltip

      public Tooltip(List<String> tooltipLines, String textShort, int positionX, int positionY, int width, int height, int verticalOffset)
      Constructs a tooltip using the given parameters.
      Parameters:
      tooltipLines - lines to display in the tooltip
      textShort - rendered text
      positionX - position on the horizontal
      positionY - position on the vertical
      width - width of the tooltip
      height - height of the tooltip
      verticalOffset - vertical offset of the tooltip
    • Tooltip

      public Tooltip(String tooltipText, String textShort, int positionX, int positionY, int verticalOffset)
      Creates a tooltip using the given parameters.
      Parameters:
      tooltipText - tooltip text
      textShort - text displayed
      positionX - where is the text on the horizontal
      positionY - where is the text on the vertical
      verticalOffset - how far away is the tooltip
  • Method Details

    • renderWidget

      protected void renderWidget(@Nonnull net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick)
      Specified by:
      renderWidget in class net.minecraft.client.gui.components.AbstractWidget
    • setMessage

      public final void setMessage(@Nonnull net.minecraft.network.chat.Component message)
      Overrides:
      setMessage in class net.minecraft.client.gui.components.AbstractWidget
    • getMessage

      public final net.minecraft.network.chat.Component getMessage()
      Overrides:
      getMessage in class net.minecraft.client.gui.components.AbstractWidget
    • updateWidgetNarration

      protected void updateWidgetNarration(@Nonnull net.minecraft.client.gui.narration.NarrationElementOutput narrationElementOutput)
      Specified by:
      updateWidgetNarration in class net.minecraft.client.gui.components.AbstractWidget