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) Fully renders Minecraft text into ImGui.static voidcomponent(net.minecraft.network.chat.FormattedText text, float wrapWidth) Fully renders wrapped Minecraft text into ImGui.static intgetColor(int color) Retrieves the ARGB color for the specified ImGui style color.static net.minecraft.client.StringSplitterstatic imgui.ImFontgetStyleFont(net.minecraft.network.chat.Style style) Retrieves the ImGui font to use for the specified Minecraft style.static 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
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
-
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
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 ARGB color for the specified ImGui style color.- Parameters:
color- The- Returns:
- The ImFont to use
-
getStringSplitter
public static net.minecraft.client.StringSplitter getStringSplitter()- Returns:
- A string splitter for ImGui fonts
-