Class VeilImGuiUtil

java.lang.Object
foundry.veil.api.client.imgui.VeilImGuiUtil

public class VeilImGuiUtil extends Object
Extra components and helpers for ImGui.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    colorOf(String modid)
    Obtains the color of the modid
    static 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 font
    static void
    icon(int code, int color)
    Renders an icon with the remixicon font and a color
    static void
    resourceLocation(net.minecraft.resources.ResourceLocation loc)
    Displays a resource location with a dimmed namespace
    static void
    setTooltip(net.minecraft.network.chat.FormattedText text)
    Sets the tooltip to the specified component
    static void
    textCentered(String text, float width)
    Helper to draw centered text.
    static void
    Displays a (?) with a hover tooltip.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VeilImGuiUtil

      public VeilImGuiUtil()
  • Method Details

    • tooltip

      public static void tooltip(String text)
      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 render
      wrapWidth - 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

      public static void textCentered(String text, float width)
      Helper to draw centered text.
      Parameters:
      text - The text to render
      width - 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

      public static int colorOf(String modid)
      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