Class Tooltip
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, widthFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal net.minecraft.network.chat.Componentprotected voidrenderWidget(net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) final voidsetMessage(net.minecraft.network.chat.Component message) protected voidupdateWidgetNarration(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, wrapDefaultNarrationMessageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
charTyped, getCurrentFocusPath, keyPressed, keyReleased, mouseMoved, mouseScrolledMethods inherited from interface net.neoforged.neoforge.client.extensions.IAbstractWidgetExtension
onClickMethods 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 tooltiptextShort- rendered textpositionX- position on the horizontalpositionY- position on the verticalwidth- width of the tooltipheight- height of the tooltipverticalOffset- 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 texttextShort- text displayedpositionX- where is the text on the horizontalpositionY- where is the text on the verticalverticalOffset- 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:
renderWidgetin classnet.minecraft.client.gui.components.AbstractWidget
-
setMessage
public final void setMessage(@Nonnull net.minecraft.network.chat.Component message) - Overrides:
setMessagein classnet.minecraft.client.gui.components.AbstractWidget
-
getMessage
public final net.minecraft.network.chat.Component getMessage()- Overrides:
getMessagein classnet.minecraft.client.gui.components.AbstractWidget
-
updateWidgetNarration
protected void updateWidgetNarration(@Nonnull net.minecraft.client.gui.narration.NarrationElementOutput narrationElementOutput) - Specified by:
updateWidgetNarrationin classnet.minecraft.client.gui.components.AbstractWidget
-