Package foundry.veil.api.client.imgui
Class VeilImGuiUtil
java.lang.Object
foundry.veil.api.client.imgui.VeilImGuiUtil
Extra components and helpers for ImGui.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intObtains the color of the modidstatic voidcomponent(net.minecraft.network.chat.FormattedText text) Deprecated.static voidcomponent(net.minecraft.network.chat.FormattedText text, float wrapWidth) Deprecated.UseImGuiMC.component(FormattedText, float)insteadstatic intgetColor(int color) Deprecated.UseImGuiMC.getColor(int)insteadstatic net.minecraft.client.StringSplitterDeprecated.UseImGuiMC.getStringSplitter()insteadstatic imgui.ImFontgetStyleFont(net.minecraft.network.chat.Style style) Deprecated.UseImGuiMC.getStyleFont(Style)insteadstatic voidicon(int code) Renders an icon with the remixicon fontstatic voidicon(int code, int color) Renders an icon with the remixicon font and a colorstatic intrenderArea(int width, int height, Consumer<AdvancedFbo> renderer) Creates a rendering area of the specified size.static voidresourceLocation(net.minecraft.resources.ResourceLocation loc) Displays a resource location with a dimmed namespacestatic voidsetTooltip(net.minecraft.network.chat.FormattedText text) Sets the tooltip to the specified componentstatic voidtextCentered(String text, float width) Helper to draw centered text.static voidDisplays a (?) with a hover tooltip.
-
Field Details
-
ICON_FONT
public static final net.minecraft.resources.ResourceLocation ICON_FONT
-
-
Constructor Details
-
VeilImGuiUtil
public VeilImGuiUtil()
-
-
Method Details
-
tooltip
Displays a (?) with a hover tooltip. Useful for example information.- Parameters:
text- The tooltip text
-
setTooltip
public static void setTooltip(net.minecraft.network.chat.FormattedText text) Sets the tooltip to the specified component- Parameters:
text- The text to render
-
component
@ScheduledForRemoval(inVersion="5.0.0") @Deprecated public static void component(net.minecraft.network.chat.FormattedText text) Deprecated.UseImGuiMC.component(FormattedText)insteadFully renders Minecraft text into ImGui.- Parameters:
text- The text to render
-
component
@ScheduledForRemoval(inVersion="5.0.0") @Deprecated public static void component(net.minecraft.network.chat.FormattedText text, float wrapWidth) Deprecated.UseImGuiMC.component(FormattedText, float)insteadFully renders wrapped Minecraft text into ImGui.- Parameters:
text- The text to renderwrapWidth- The width to wrap to
-
icon
public static void icon(int code) Renders an icon with the remixicon font- Parameters:
code- The icon code (ex. )
-
icon
public static void icon(int code, int color) Renders an icon with the remixicon font and a color- Parameters:
code- The icon code (ex. )color- The color of the icon
-
textCentered
Helper to draw centered text.- Parameters:
text- The text to renderwidth- The width of the area to center on
-
resourceLocation
public static void resourceLocation(net.minecraft.resources.ResourceLocation loc) Displays a resource location with a dimmed namespace- Parameters:
loc- The resource location
-
renderArea
Creates a rendering area of the specified size.- Parameters:
width- The width of the areaheight- The height of the arearenderer- The renderer inside the area- Returns:
- A texture ID that can be displayed in ImGui
-
colorOf
Obtains the color of the modid- Parameters:
modid- The modid to get the color of- Returns:
- color The color based on the hash of the modid
-
getStyleFont
@ScheduledForRemoval(inVersion="5.0.0") @Deprecated public static imgui.ImFont getStyleFont(net.minecraft.network.chat.Style style) Deprecated.UseImGuiMC.getStyleFont(Style)insteadRetrieves the ImGui font to use for the specified Minecraft style.- Parameters:
style- The style to get the font for- Returns:
- The ImFont to use
-
getColor
Deprecated.UseImGuiMC.getColor(int)insteadRetrieves the ARGB color for the specified ImGui style color.- Parameters:
color- The ImGui color index- Returns:
- The ARGB ImGui color
-
getStringSplitter
@ScheduledForRemoval(inVersion="5.0.0") @Deprecated public static net.minecraft.client.StringSplitter getStringSplitter()Deprecated.UseImGuiMC.getStringSplitter()instead- Returns:
- A string splitter for ImGui fonts
-
ImGuiMC.component(FormattedText)instead