Package codechicken.lib.gui.modular.lib
Interface TooltipHandler<T extends TooltipHandler<T>>
- All Known Implementing Classes:
GuiButton,GuiColourPicker,GuiColourPicker.ColourPreview,GuiColourPicker.SliderBG,GuiContextMenu,GuiDialog,GuiDVD,GuiElement,GuiEnergyBar,GuiEntityRenderer,GuiEventProvider,GuiFluidTank,GuiItemStack,GuiList,GuiManipulable,GuiProgressIcon,GuiRectangle,GuiScrolling,GuiSlider,GuiSlots,GuiText,GuiTextField,GuiTextList,GuiTexture
public interface TooltipHandler<T extends TooltipHandler<T>>
Created by brandon3055 on 01/09/2023
-
Method Summary
Modifier and TypeMethodDescriptionintdefault booleanrenderTooltip(GuiRender render, double mouseX, double mouseY) The method responsible for rendering element tool tips.setTooltip(@Nullable Supplier<List<net.minecraft.network.chat.Component>> tooltip) Add hover text that is to be displayed when the user hovers their cursor over this element.default TsetTooltip(@Nullable Supplier<List<net.minecraft.network.chat.Component>> tooltip, int tooltipDelay) Add hover text that is to be displayed when the user hovers their cursor over this element.default TsetTooltip(@Nullable List<net.minecraft.network.chat.Component> tooltip) Add hover text that is to be displayed when the user hovers their cursor over this element.default TsetTooltip(net.minecraft.network.chat.Component... Tooltip) Add hover text that is to be displayed when the user hovers their cursor over this element.setTooltipDelay(int tooltipDelay) Set a delay before element tooltip is displayed.default TsetTooltipSingle(@Nullable Supplier<net.minecraft.network.chat.Component> tooltip) Add hover text that is to be displayed when the user hovers their cursor over this element.default TsetTooltipSingle(@Nullable net.minecraft.network.chat.Component Tooltip) Add hover text that is to be displayed when the user hovers their cursor over this element.
-
Method Details
-
getTooltip
-
setTooltipDelay
Set a delay before element tooltip is displayed. Default delay is 10 ticks. -
getTooltipDelay
int getTooltipDelay() -
setTooltipSingle
Add hover text that is to be displayed when the user hovers their cursor over this element. (with a delay of 10 ticks) If you have multiple stacked elements with tooltips, only the top most element under the cursor will display its hover text.- Parameters:
Tooltip- A single tooltip text component supplier.- See Also:
-
setTooltip
Add hover text that is to be displayed when the user hovers their cursor over this element. (with a delay of 10 ticks) If you have multiple stacked elements with tooltips, only the top most element under the cursor will display its hover text.- Parameters:
Tooltip- A single tooltip text component supplier.- See Also:
-
setTooltipSingle
default T setTooltipSingle(@Nullable @Nullable Supplier<net.minecraft.network.chat.Component> tooltip) Add hover text that is to be displayed when the user hovers their cursor over this element. (with a delay of 10 ticks) If you have multiple stacked elements with tooltips, only the top most element under the cursor will display its hover text.- Parameters:
tooltip- A single line tooltip component supplier.- See Also:
-
setTooltip
Add hover text that is to be displayed when the user hovers their cursor over this element. (with a delay of 10 ticks) If you have multiple stacked elements with tooltips, only the top most element under the cursor will display its hover text.- Parameters:
tooltip- The tooltip lines. If null or empty, hover text will be disabled- See Also:
-
setTooltip
Add hover text that is to be displayed when the user hovers their cursor over this element. (with a delay of 10 ticks) If you have multiple stacked elements with tooltips, only the top most element under the cursor will display its hover text.- Parameters:
tooltip- The tooltip lines. If null or the returned list is empty, hover text will be disabled- See Also:
-
setTooltip
default T setTooltip(@Nullable @Nullable Supplier<List<net.minecraft.network.chat.Component>> tooltip, int tooltipDelay) Add hover text that is to be displayed when the user hovers their cursor over this element. If you have multiple stacked elements with tooltips, only the top most element under the cursor will display its hover text.- Parameters:
tooltip- The tooltip lines. If null or the returned list is empty, hover text will be disabledtooltipDelay- Delay before hover text is shown.
-
renderTooltip
The method responsible for rendering element tool tips. Called fromGuiElement.renderOverlay(GuiRender, double, double, float, boolean)
-