Skip to main content

Class ImGuiComponents

Class containing various methods providing ImGui components.

Assembly: Dalamud.dll
View Source
Declaration
public static class ImGuiComponents

Methods

ColorPickerWithPalette(int, string, Vector4)

ColorPicker with palette.

View Source
Declaration
public static Vector4 ColorPickerWithPalette(int id, string description, Vector4 originalColor)
Returns

System.Numerics.Vector4: Selected color.

Parameters
TypeNameDescription
System.Int32idId for the color picker.
System.StringdescriptionThe description of the color picker.
System.Numerics.Vector4originalColorThe current color.

ColorPickerWithPalette(int, string, Vector4, ImGuiColorEditFlags)

ColorPicker with palette with color picker options.

View Source
Declaration
public static Vector4 ColorPickerWithPalette(int id, string description, Vector4 originalColor, ImGuiColorEditFlags flags)
Returns

System.Numerics.Vector4: Selected color.

Parameters
TypeNameDescription
System.Int32idId for the color picker.
System.StringdescriptionThe description of the color picker.
System.Numerics.Vector4originalColorThe current color.
ImGuiNET.ImGuiColorEditFlagsflagsFlags to customize color picker.

DisabledButton(FontAwesomeIcon, int?, Vector4?, Vector4?, Vector4?, float)

Alpha modified IconButton component to use an icon as a button with alpha and color options.

View Source
Declaration
public static bool DisabledButton(FontAwesomeIcon icon, int? id = null, Vector4? defaultColor = null, Vector4? activeColor = null, Vector4? hoveredColor = null, float alphaMult = 0.5)
Returns

System.Boolean: Indicator if button is clicked.

Parameters
TypeNameDescription
Dalamud.Interface.FontAwesomeIconiconThe icon for the button.
System.Nullable<System.Int32>idThe ID of the button.
System.Nullable<System.Numerics.Vector4>defaultColorThe default color of the button.
System.Nullable<System.Numerics.Vector4>activeColorThe color of the button when active.
System.Nullable<System.Numerics.Vector4>hoveredColorThe color of the button when hovered.
System.SinglealphaMultA multiplier for the current alpha levels.

DisabledButton(string, Vector4?, Vector4?, Vector4?, float)

Alpha modified Button component to use as a disabled button with alpha and color options.

View Source
Declaration
public static bool DisabledButton(string labelWithId, Vector4? defaultColor = null, Vector4? activeColor = null, Vector4? hoveredColor = null, float alphaMult = 0.5)
Returns

System.Boolean: Indicator if button is clicked.

Parameters
TypeNameDescription
System.StringlabelWithIdThe button label with ID.
System.Nullable<System.Numerics.Vector4>defaultColorThe default color of the button.
System.Nullable<System.Numerics.Vector4>activeColorThe color of the button when active.
System.Nullable<System.Numerics.Vector4>hoveredColorThe color of the button when hovered.
System.SinglealphaMultA multiplier for the current alpha levels.

HelpMarker(string)

HelpMarker component to add a help icon with text on hover.

View Source
Declaration
public static void HelpMarker(string helpText)
Parameters
TypeNameDescription
System.StringhelpTextThe text to display on hover.

HelpMarker(string, FontAwesomeIcon, Vector4?)

HelpMarker component to add a custom icon with text on hover.

View Source
Declaration
public static void HelpMarker(string helpText, FontAwesomeIcon icon, Vector4? color = null)
Parameters
TypeNameDescription
System.StringhelpTextThe text to display on hover.
Dalamud.Interface.FontAwesomeIconiconThe icon to use.
System.Nullable<FFXIVClientStructs.FFXIV.Common.Math.Vector4>colorThe color of the icon.

IconButton(FontAwesomeIcon)

IconButton component to use an icon as a button.

View Source
Declaration
public static bool IconButton(FontAwesomeIcon icon)
Returns

System.Boolean: Indicator if button is clicked.

Parameters
TypeNameDescription
Dalamud.Interface.FontAwesomeIconiconThe icon for the button.

IconButton(FontAwesomeIcon, Vector2)

IconButton component to use an icon as a button.

View Source
Declaration
public static bool IconButton(FontAwesomeIcon icon, Vector2 size)
Returns

System.Boolean: Indicator if button is clicked.

Parameters
TypeNameDescription
Dalamud.Interface.FontAwesomeIconiconThe icon for the button.
System.Numerics.Vector2sizeSets the size of the button. If either dimension is set to 0, that dimension will conform to the size of the icon.

IconButton(FontAwesomeIcon, Vector4?, Vector4?, Vector4?, Vector2?)

IconButton component to use an icon as a button.

View Source
Declaration
public static bool IconButton(FontAwesomeIcon icon, Vector4? defaultColor, Vector4? activeColor = null, Vector4? hoveredColor = null, Vector2? size = null)
Returns

System.Boolean: Indicator if button is clicked.

Parameters
TypeNameDescription
Dalamud.Interface.FontAwesomeIconiconThe icon for the button.
System.Nullable<System.Numerics.Vector4>defaultColorThe default color of the button.
System.Nullable<System.Numerics.Vector4>activeColorThe color of the button when active.
System.Nullable<System.Numerics.Vector4>hoveredColorThe color of the button when hovered.
System.Nullable<System.Numerics.Vector2>sizeSets the size of the button. If either dimension is set to 0, that dimension will conform to the size of the icon.

IconButton(int, FontAwesomeIcon)

IconButton component to use an icon as a button.

View Source
Declaration
public static bool IconButton(int id, FontAwesomeIcon icon)
Returns

System.Boolean: Indicator if button is clicked.

Parameters
TypeNameDescription
System.Int32idThe ID of the button.
Dalamud.Interface.FontAwesomeIconiconThe icon for the button.

IconButton(int, FontAwesomeIcon, Vector2)

IconButton component to use an icon as a button.

View Source
Declaration
public static bool IconButton(int id, FontAwesomeIcon icon, Vector2 size)
Returns

System.Boolean: Indicator if button is clicked.

Parameters
TypeNameDescription
System.Int32idThe ID of the button.
Dalamud.Interface.FontAwesomeIconiconThe icon for the button.
System.Numerics.Vector2sizeSets the size of the button. If either dimension is set to 0, that dimension will conform to the size of the icon.

IconButton(int, FontAwesomeIcon, Vector4?, Vector4?, Vector4?, Vector2?)

IconButton component to use an icon as a button with color options.

View Source
Declaration
public static bool IconButton(int id, FontAwesomeIcon icon, Vector4? defaultColor, Vector4? activeColor = null, Vector4? hoveredColor = null, Vector2? size = null)
Returns

System.Boolean: Indicator if button is clicked.

Parameters
TypeNameDescription
System.Int32idThe ID of the button.
Dalamud.Interface.FontAwesomeIconiconThe icon for the button.
System.Nullable<System.Numerics.Vector4>defaultColorThe default color of the button.
System.Nullable<System.Numerics.Vector4>activeColorThe color of the button when active.
System.Nullable<System.Numerics.Vector4>hoveredColorThe color of the button when hovered.
System.Nullable<System.Numerics.Vector2>sizeSets the size of the button. If either dimension is set to 0, that dimension will conform to the size of the icon.

IconButton(string, FontAwesomeIcon)

IconButton component to use an icon as a button.

View Source
Declaration
public static bool IconButton(string id, FontAwesomeIcon icon)
Returns

System.Boolean: Indicator if button is clicked.

Parameters
TypeNameDescription
System.StringidThe ID of the button.
Dalamud.Interface.FontAwesomeIconiconThe icon for the button.

IconButton(string, FontAwesomeIcon, Vector2)

IconButton component to use an icon as a button.

View Source
Declaration
public static bool IconButton(string id, FontAwesomeIcon icon, Vector2 size)
Returns

System.Boolean: Indicator if button is clicked.

Parameters
TypeNameDescription
System.StringidThe ID of the button.
Dalamud.Interface.FontAwesomeIconiconThe icon for the button.
System.Numerics.Vector2sizeSets the size of the button. If either dimension is set to 0, that dimension will conform to the size of the icon.

IconButton(string, FontAwesomeIcon, Vector4?, Vector4?, Vector4?, Vector2?)

IconButton component to use an icon as a button with color options.

View Source
Declaration
public static bool IconButton(string id, FontAwesomeIcon icon, Vector4? defaultColor, Vector4? activeColor = null, Vector4? hoveredColor = null, Vector2? size = null)
Returns

System.Boolean: Indicator if button is clicked.

Parameters
TypeNameDescription
System.StringidThe ID of the button.
Dalamud.Interface.FontAwesomeIconiconThe icon for the button.
System.Nullable<System.Numerics.Vector4>defaultColorThe default color of the button.
System.Nullable<System.Numerics.Vector4>activeColorThe color of the button when active.
System.Nullable<System.Numerics.Vector4>hoveredColorThe color of the button when hovered.
System.Nullable<System.Numerics.Vector2>sizeSets the size of the button. If either dimension is set to 0, that dimension will conform to the size of the icon.

IconButton(string)

IconButton component to use an icon as a button.

View Source
Declaration
public static bool IconButton(string iconText)
Returns

System.Boolean: Indicator if button is clicked.

Parameters
TypeNameDescription
System.StringiconTextText already containing the icon string.

IconButton(string, Vector2)

IconButton component to use an icon as a button.

View Source
Declaration
public static bool IconButton(string iconText, Vector2 size)
Returns

System.Boolean: Indicator if button is clicked.

Parameters
TypeNameDescription
System.StringiconTextText already containing the icon string.
System.Numerics.Vector2sizeSets the size of the button. If either dimension is set to 0, that dimension will conform to the size of the icon.

IconButton(string, Vector4?, Vector4?, Vector4?, Vector2?)

IconButton component to use an icon as a button with color options.

View Source
Declaration
public static bool IconButton(string iconText, Vector4? defaultColor, Vector4? activeColor = null, Vector4? hoveredColor = null, Vector2? size = null)
Returns

System.Boolean: Indicator if button is clicked.

Parameters
TypeNameDescription
System.StringiconTextText already containing the icon string.
System.Nullable<System.Numerics.Vector4>defaultColorThe default color of the button.
System.Nullable<System.Numerics.Vector4>activeColorThe color of the button when active.
System.Nullable<System.Numerics.Vector4>hoveredColorThe color of the button when hovered.
System.Nullable<System.Numerics.Vector2>sizeSets the size of the button. If either dimension is set to 0, that dimension will conform to the size of the icon.

IconButtonWithText(FontAwesomeIcon, string, Vector2)

IconButton component to use an icon as a button with color options.

View Source
Declaration
public static bool IconButtonWithText(FontAwesomeIcon icon, string text, Vector2 size)
Returns

System.Boolean: Indicator if button is clicked.

Parameters
TypeNameDescription
Dalamud.Interface.FontAwesomeIconiconIcon to show.
System.StringtextText to show.
System.Numerics.Vector2sizeSets the size of the button. If either dimension is set to 0,
that dimension will conform to the size of the icon and text.

IconButtonWithText(FontAwesomeIcon, string, Vector4?, Vector4?, Vector4?, Vector2?)

IconButton component to use an icon as a button with color options.

View Source
Declaration
public static bool IconButtonWithText(FontAwesomeIcon icon, string text, Vector4? defaultColor = null, Vector4? activeColor = null, Vector4? hoveredColor = null, Vector2? size = null)
Returns

System.Boolean: Indicator if button is clicked.

Parameters
TypeNameDescription
Dalamud.Interface.FontAwesomeIconiconIcon to show.
System.StringtextText to show.
System.Nullable<System.Numerics.Vector4>defaultColorThe default color of the button.
System.Nullable<System.Numerics.Vector4>activeColorThe color of the button when active.
System.Nullable<System.Numerics.Vector4>hoveredColorThe color of the button when hovered.
System.Nullable<System.Numerics.Vector2>sizeSets the size of the button. If either dimension is set to 0,
that dimension will conform to the size of the icon and text.

GetIconButtonWithTextWidth(FontAwesomeIcon, string)

Get width of IconButtonWithText component.

View Source
Declaration
public static float GetIconButtonWithTextWidth(FontAwesomeIcon icon, string text)
Returns

System.Single: Width.

Parameters
TypeNameDescription
Dalamud.Interface.FontAwesomeIconiconIcon to use.
System.StringtextText to use.

IconButtonSelect<T>(string, ref T, IEnumerable<FontAwesomeIcon>, IEnumerable<T>, uint, Vector2?, Vector4?, Vector4?, Vector4?)

A radio-like input that uses icon buttons.

View Source
Declaration
public static bool IconButtonSelect<T>(string label, ref T val, IEnumerable<FontAwesomeIcon> optionIcons, IEnumerable<T> optionValues, uint columns = 0, Vector2? buttonSize = null, Vector4? defaultColor = null, Vector4? activeColor = null, Vector4? hoveredColor = null)
Returns

System.Boolean: True if any button is clicked.

Parameters
TypeNameDescription
System.StringlabelText that will be used to generate individual labels for the buttons.
<T>valThe value to set.
System.Collections.Generic.IEnumerable<Dalamud.Interface.FontAwesomeIcon>optionIconsThe icons that will be displayed on each button.
System.Collections.Generic.IEnumerable<<T>>optionValuesThe options that each button will apply.
System.UInt32columnsArranges the buttons in a grid with the given number of columns. 0 = ignored (all buttons drawn in one row).
System.Nullable<System.Numerics.Vector2>buttonSizeSets the size of all buttons. If either dimension is set to 0, that dimension will conform to the size of the icon.
System.Nullable<System.Numerics.Vector4>defaultColorThe default color of the button range.
System.Nullable<System.Numerics.Vector4>activeColorThe color of the actively-selected button.
System.Nullable<System.Numerics.Vector4>hoveredColorThe color of the buttons when hovered.
Type Parameters
NameDescription
TThe type of the value being set.

IconButtonSelect<T>(string, ref T, IEnumerable<KeyValuePair<FontAwesomeIcon, T>>, uint, Vector2?, Vector4?, Vector4?, Vector4?)

A radio-like input that uses icon buttons.

View Source
Declaration
public static bool IconButtonSelect<T>(string label, ref T val, IEnumerable<KeyValuePair<FontAwesomeIcon, T>> options, uint columns = 0, Vector2? buttonSize = null, Vector4? defaultColor = null, Vector4? activeColor = null, Vector4? hoveredColor = null)
Returns

System.Boolean: True if any button is clicked.

Parameters
TypeNameDescription
System.StringlabelText that will be used to generate individual labels for the buttons.
<T>valThe value to set.
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<Dalamud.Interface.FontAwesomeIcon,<T>>>optionsA list of all icon/option pairs.
System.UInt32columnsArranges the buttons in a grid with the given number of columns. 0 = ignored (all buttons drawn in one row).
System.Nullable<System.Numerics.Vector2>buttonSizeSets the size of all buttons. If either dimension is set to 0, that dimension will conform to the size of the icon.
System.Nullable<System.Numerics.Vector4>defaultColorThe default color of the button range.
System.Nullable<System.Numerics.Vector4>activeColorThe color of the actively-selected button.
System.Nullable<System.Numerics.Vector4>hoveredColorThe color of the buttons when hovered.
Type Parameters
NameDescription
TThe type of the value being set.

Test()

Test component to demonstrate how ImGui components work.

View Source
Declaration
public static void Test()

TextWithLabel(string, string, string)

TextWithLabel component to show labeled text.

View Source
Declaration
public static void TextWithLabel(string label, string value, string hint = "")
Parameters
TypeNameDescription
System.StringlabelThe label for text.
System.StringvalueThe text value.
System.StringhintThe hint to show on hover.

ToggleButton(string, ref bool)

Draw a toggle button.

View Source
Declaration
public static bool ToggleButton(string id, ref bool v)
Returns

System.Boolean: If the button has been interacted with this frame.

Parameters
TypeNameDescription
System.StringidThe id of the button.
System.BooleanvThe state of the switch.

DisabledToggleButton(string, bool)

Draw a disabled toggle button.

View Source
Declaration
public static void DisabledToggleButton(string id, bool v)
Parameters
TypeNameDescription
System.StringidThe id of the button.
System.BooleanvThe state of the switch.