Class ImGuiComponents
Class containing various methods providing ImGui components.
Assembly: Dalamud.dll
public static class ImGuiComponents
Methods
ColorPickerWithPalette(int, string, Vector4)
ColorPicker with palette.
public static Vector4 ColorPickerWithPalette(int id, string description, Vector4 originalColor)
Returns
System.Numerics.Vector4: Selected color.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | id | Id for the color picker. |
System.String | description | The description of the color picker. |
System.Numerics.Vector4 | originalColor | The current color. |
ColorPickerWithPalette(int, string, Vector4, ImGuiColorEditFlags)
ColorPicker with palette with color picker options.
public static Vector4 ColorPickerWithPalette(int id, string description, Vector4 originalColor, ImGuiColorEditFlags flags)
Returns
System.Numerics.Vector4: Selected color.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | id | Id for the color picker. |
System.String | description | The description of the color picker. |
System.Numerics.Vector4 | originalColor | The current color. |
Dalamud.Bindings.ImGui.ImGuiColorEditFlags | flags | Flags 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.
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
| Type | Name | Description |
|---|---|---|
| Dalamud.Interface.FontAwesomeIcon | icon | The icon for the button. |
System.Nullable<System.Int32> | id | The ID of the button. |
System.Nullable<System.Numerics.Vector4> | defaultColor | The default color of the button. |
System.Nullable<System.Numerics.Vector4> | activeColor | The color of the button when active. |
System.Nullable<System.Numerics.Vector4> | hoveredColor | The color of the button when hovered. |
System.Single | alphaMult | A 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.
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
| Type | Name | Description |
|---|---|---|
System.String | labelWithId | The button label with ID. |
System.Nullable<System.Numerics.Vector4> | defaultColor | The default color of the button. |
System.Nullable<System.Numerics.Vector4> | activeColor | The color of the button when active. |
System.Nullable<System.Numerics.Vector4> | hoveredColor | The color of the button when hovered. |
System.Single | alphaMult | A multiplier for the current alpha levels. |
HelpMarker(string)
HelpMarker component to add a help icon with text on hover.
public static void HelpMarker(string helpText)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | helpText | The text to display on hover. |
HelpMarker(string, FontAwesomeIcon, Vector4?)
HelpMarker component to add a custom icon with text on hover.
public static void HelpMarker(string helpText, FontAwesomeIcon icon, Vector4? color = null)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | helpText | The text to display on hover. |
| Dalamud.Interface.FontAwesomeIcon | icon | The icon to use. |
System.Nullable<FFXIVClientStructs.FFXIV.Common.Math.Vector4> | color | The color of the icon. |
IconButton(FontAwesomeIcon)
IconButton component to use an icon as a button.
public static bool IconButton(FontAwesomeIcon icon)
Returns
System.Boolean: Indicator if button is clicked.
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Interface.FontAwesomeIcon | icon | The icon for the button. |
IconButton(FontAwesomeIcon, Vector2)
IconButton component to use an icon as a button.
public static bool IconButton(FontAwesomeIcon icon, Vector2 size)
Returns
System.Boolean: Indicator if button is clicked.
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Interface.FontAwesomeIcon | icon | The icon for the button. |
System.Numerics.Vector2 | size | Sets 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.
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
| Type | Name | Description |
|---|---|---|
| Dalamud.Interface.FontAwesomeIcon | icon | The icon for the button. |
System.Nullable<System.Numerics.Vector4> | defaultColor | The default color of the button. |
System.Nullable<System.Numerics.Vector4> | activeColor | The color of the button when active. |
System.Nullable<System.Numerics.Vector4> | hoveredColor | The color of the button when hovered. |
System.Nullable<System.Numerics.Vector2> | size | Sets 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.
public static bool IconButton(int id, FontAwesomeIcon icon)
Returns
System.Boolean: Indicator if button is clicked.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | id | The ID of the button. |
| Dalamud.Interface.FontAwesomeIcon | icon | The icon for the button. |
IconButton(int, FontAwesomeIcon, Vector2)
IconButton component to use an icon as a button.
public static bool IconButton(int id, FontAwesomeIcon icon, Vector2 size)
Returns
System.Boolean: Indicator if button is clicked.
Parameters
| Type | Name | Description |
|---|---|---|
System.Int32 | id | The ID of the button. |
| Dalamud.Interface.FontAwesomeIcon | icon | The icon for the button. |
System.Numerics.Vector2 | size | Sets 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.
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
| Type | Name | Description |
|---|---|---|
System.Int32 | id | The ID of the button. |
| Dalamud.Interface.FontAwesomeIcon | icon | The icon for the button. |
System.Nullable<System.Numerics.Vector4> | defaultColor | The default color of the button. |
System.Nullable<System.Numerics.Vector4> | activeColor | The color of the button when active. |
System.Nullable<System.Numerics.Vector4> | hoveredColor | The color of the button when hovered. |
System.Nullable<System.Numerics.Vector2> | size | Sets 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.
public static bool IconButton(string id, FontAwesomeIcon icon)
Returns
System.Boolean: Indicator if button is clicked.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | id | The ID of the button. |
| Dalamud.Interface.FontAwesomeIcon | icon | The icon for the button. |
IconButton(string, FontAwesomeIcon, Vector2)
IconButton component to use an icon as a button.
public static bool IconButton(string id, FontAwesomeIcon icon, Vector2 size)
Returns
System.Boolean: Indicator if button is clicked.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | id | The ID of the button. |
| Dalamud.Interface.FontAwesomeIcon | icon | The icon for the button. |
System.Numerics.Vector2 | size | Sets 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.
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
| Type | Name | Description |
|---|---|---|
System.String | id | The ID of the button. |
| Dalamud.Interface.FontAwesomeIcon | icon | The icon for the button. |
System.Nullable<System.Numerics.Vector4> | defaultColor | The default color of the button. |
System.Nullable<System.Numerics.Vector4> | activeColor | The color of the button when active. |
System.Nullable<System.Numerics.Vector4> | hoveredColor | The color of the button when hovered. |
System.Nullable<System.Numerics.Vector2> | size | Sets 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.
public static bool IconButton(string iconText)
Returns
System.Boolean: Indicator if button is clicked.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | iconText | Text already containing the icon string. |
IconButton(string, Vector2)
IconButton component to use an icon as a button.
public static bool IconButton(string iconText, Vector2 size)
Returns
System.Boolean: Indicator if button is clicked.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | iconText | Text already containing the icon string. |
System.Numerics.Vector2 | size | Sets 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.
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
| Type | Name | Description |
|---|---|---|
System.String | iconText | Text already containing the icon string. |
System.Nullable<System.Numerics.Vector4> | defaultColor | The default color of the button. |
System.Nullable<System.Numerics.Vector4> | activeColor | The color of the button when active. |
System.Nullable<System.Numerics.Vector4> | hoveredColor | The color of the button when hovered. |
System.Nullable<System.Numerics.Vector2> | size | Sets 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.
public static bool IconButtonWithText(FontAwesomeIcon icon, string text, Vector2 size)
Returns
System.Boolean: Indicator if button is clicked.
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Interface.FontAwesomeIcon | icon | Icon to show. |
System.String | text | Text to show. |
System.Numerics.Vector2 | size | Sets 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.
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
| Type | Name | Description |
|---|---|---|
| Dalamud.Interface.FontAwesomeIcon | icon | Icon to show. |
System.String | text | Text to show. |
System.Nullable<System.Numerics.Vector4> | defaultColor | The default color of the button. |
System.Nullable<System.Numerics.Vector4> | activeColor | The color of the button when active. |
System.Nullable<System.Numerics.Vector4> | hoveredColor | The color of the button when hovered. |
System.Nullable<System.Numerics.Vector2> | size | Sets 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.
public static float GetIconButtonWithTextWidth(FontAwesomeIcon icon, string text)
Returns
System.Single: Width.
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Interface.FontAwesomeIcon | icon | Icon to use. |
System.String | text | Text to use. |
IconButtonSelect<T>(string, ref T, IEnumerable<FontAwesomeIcon>, IEnumerable<T>, uint, Vector2?, Vector4?, Vector4?, Vector4?)
A radio-like input that uses icon buttons.
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
| Type | Name | Description |
|---|---|---|
System.String | label | Text that will be used to generate individual labels for the buttons. |
<T> | val | The value to set. |
System.Collections.Generic.IEnumerable<Dalamud.Interface.FontAwesomeIcon> | optionIcons | The icons that will be displayed on each button. |
System.Collections.Generic.IEnumerable<<T>> | optionValues | The options that each button will apply. |
System.UInt32 | columns | Arranges the buttons in a grid with the given number of columns. 0 = ignored (all buttons drawn in one row). |
System.Nullable<System.Numerics.Vector2> | buttonSize | Sets 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> | defaultColor | The default color of the button range. |
System.Nullable<System.Numerics.Vector4> | activeColor | The color of the actively-selected button. |
System.Nullable<System.Numerics.Vector4> | hoveredColor | The color of the buttons when hovered. |
Type Parameters
| Name | Description |
|---|---|
T | The 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.
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
| Type | Name | Description |
|---|---|---|
System.String | label | Text that will be used to generate individual labels for the buttons. |
<T> | val | The value to set. |
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<Dalamud.Interface.FontAwesomeIcon,<T>>> | options | A list of all icon/option pairs. |
System.UInt32 | columns | Arranges the buttons in a grid with the given number of columns. 0 = ignored (all buttons drawn in one row). |
System.Nullable<System.Numerics.Vector2> | buttonSize | Sets 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> | defaultColor | The default color of the button range. |
System.Nullable<System.Numerics.Vector4> | activeColor | The color of the actively-selected button. |
System.Nullable<System.Numerics.Vector4> | hoveredColor | The color of the buttons when hovered. |
Type Parameters
| Name | Description |
|---|---|
T | The type of the value being set. |
Test()
Test component to demonstrate how ImGui components work.
public static void Test()
TextWithLabel(string, string, string)
TextWithLabel component to show labeled text.
public static void TextWithLabel(string label, string value, string hint = "")
Parameters
| Type | Name | Description |
|---|---|---|
System.String | label | The label for text. |
System.String | value | The text value. |
System.String | hint | The hint to show on hover. |
ToggleButton(string, ref bool)
Draw a toggle button.
public static bool ToggleButton(string id, ref bool v)
Returns
System.Boolean: If the button has been interacted with this frame.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | id | The id of the button. |
System.Boolean | v | The state of the switch. |
DisabledToggleButton(string, bool)
Draw a disabled toggle button.
public static void DisabledToggleButton(string id, bool v)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | id | The id of the button. |
System.Boolean | v | The state of the switch. |