Package foundry.veil.api.client.imgui
Class VeilImGuiUtil
java.lang.Object
foundry.veil.api.client.imgui.VeilImGuiUtil
Extra components and helpers for ImGui.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
Obtains the color of the modidstatic void
component
(net.minecraft.network.chat.FormattedText text) Fully renders Minecraft text into ImGui.static void
component
(net.minecraft.network.chat.FormattedText text, float wrapWidth) Fully renders wrapped Minecraft text into ImGui.static int
getColor
(int color) Retrieves the ImGui font to use for the specified Minecraft style.static net.minecraft.client.StringSplitter
static imgui.ImFont
getStyleFont
(net.minecraft.network.chat.Style style) Retrieves the ImGui font to use for the specified Minecraft style.static void
icon
(int code) Renders an icon with the remixicon fontstatic void
icon
(int code, int color) Renders an icon with the remixicon font and a colorstatic void
resourceLocation
(net.minecraft.resources.ResourceLocation loc) Displays a resource location with a dimmed namespacestatic void
setTooltip
(net.minecraft.network.chat.FormattedText text) Sets the tooltip to the specified componentstatic void
textCentered
(String text, float width) Helper to draw centered text.static void
Displays a (?) with a hover tooltip.
-
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
public static void component(net.minecraft.network.chat.FormattedText text) Fully renders Minecraft text into ImGui.- Parameters:
text
- The text to render
-
component
public static void component(net.minecraft.network.chat.FormattedText text, float wrapWidth) Fully 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
-
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
public static imgui.ImFont getStyleFont(net.minecraft.network.chat.Style style) Retrieves 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
public static int getColor(int color) Retrieves the ImGui font to use for the specified Minecraft style.- Parameters:
color
- The- Returns:
- The ImFont to use
-
getStringSplitter
public static net.minecraft.client.StringSplitter getStringSplitter()- Returns:
- A string splitter for ImGui fonts
-