Class ImGuiHelpers
Class containing various helper methods for use with ImGui inside Dalamud.
Inheritance
Inherited Members
Namespace: Dalamud.Interface
Assembly: Dalamud.dll
Syntax
public static class ImGuiHelpers
Properties
| Improve this Doc View SourceGlobalScale
Gets the global Dalamud scale.
Declaration
public static float GlobalScale { get; }
Property Value
| Type | Description |
|---|---|
| System.Single |
MainViewport
Gets the main viewport.
Declaration
public static ImGuiViewportPtr MainViewport { get; }
Property Value
| Type | Description |
|---|---|
| ImGuiViewportPtr |
Methods
| Improve this Doc View SourceClickToCopyText(String, String)
Print out text that can be copied when clicked.
Declaration
public static void ClickToCopyText(string text, string textCopy = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text | The text to show. |
| System.String | textCopy | The text to copy when clicked. |
DefaultColorPalette(Int32)
Creates default color palette for use with color pickers.
Declaration
public static List<Vector4> DefaultColorPalette(int swatchCount = 32)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | swatchCount | The total number of swatches to use. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Numerics.Vector4> | Default color palette. |
ForceNextWindowMainViewport()
Force the next ImGui window to stay inside the main game window.
Declaration
public static void ForceNextWindowMainViewport()
GetButtonSize(String)
Get the size of a button considering the default frame padding.
Declaration
public static Vector2 GetButtonSize(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text | Text in the button. |
Returns
| Type | Description |
|---|---|
| System.Numerics.Vector2 | System.Numerics.Vector2 with the size of the button. |
SafeTextWrapped(String)
Write unformatted text wrapped.
Declaration
public static void SafeTextWrapped(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text | The text to write. |
ScaledDummy(Vector2)
Create a dummy scaled by the global Dalamud scale.
Declaration
public static void ScaledDummy(Vector2 size)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Numerics.Vector2 | size | The size of the dummy. |
ScaledDummy(Single)
Create a dummy scaled by the global Dalamud scale.
Declaration
public static void ScaledDummy(float size)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | size | The size of the dummy. |
ScaledDummy(Single, Single)
Create a dummy scaled by the global Dalamud scale.
Declaration
public static void ScaledDummy(float x, float y)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | x | Vector2 X parameter. |
| System.Single | y | Vector2 Y parameter. |
ScaledRelativeSameLine(Single, Single)
Use a relative ImGui.SameLine() from your current cursor position, scaled by the Dalamud global scale.
Declaration
public static void ScaledRelativeSameLine(float offset, float spacing = -1F)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | offset | The offset from your current cursor position. |
| System.Single | spacing | The spacing to use. |
ScaledVector2(Single, Single)
Gets a System.Numerics.Vector2 that is pre-scaled with the GlobalScale multiplier.
Declaration
public static Vector2 ScaledVector2(float x, float y)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | x | Vector2 X parameter. |
| System.Single | y | Vector2 Y parameter. |
Returns
| Type | Description |
|---|---|
| System.Numerics.Vector2 | A scaled Vector2. |
ScaledVector4(Single, Single, Single, Single)
Gets a System.Numerics.Vector4 that is pre-scaled with the GlobalScale multiplier.
Declaration
public static Vector4 ScaledVector4(float x, float y, float z, float w)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | x | Vector4 X parameter. |
| System.Single | y | Vector4 Y parameter. |
| System.Single | z | Vector4 Z parameter. |
| System.Single | w | Vector4 W parameter. |
Returns
| Type | Description |
|---|---|
| System.Numerics.Vector4 | A scaled Vector2. |
SetNextWindowPosRelativeMainViewport(Vector2, ImGuiCond, Vector2)
Set the position of the next window relative to the main viewport.
Declaration
public static void SetNextWindowPosRelativeMainViewport(Vector2 position, ImGuiCond condition = ImGuiCond.None, Vector2 pivot = default(Vector2))
Parameters
| Type | Name | Description |
|---|---|---|
| System.Numerics.Vector2 | position | The position of the next window. |
| ImGuiCond | condition | When to set the position. |
| System.Numerics.Vector2 | pivot | The pivot to set the position around. |
SetWindowPosRelativeMainViewport(String, Vector2, ImGuiCond)
Set the position of a window relative to the main viewport.
Declaration
public static void SetWindowPosRelativeMainViewport(string name, Vector2 position, ImGuiCond condition = ImGuiCond.None)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name/ID of the window. |
| System.Numerics.Vector2 | position | The position of the window. |
| ImGuiCond | condition | When to set the position. |