Show / Hide Table of Contents

# Class ImGuiHelpers

Class containing various helper methods for use with ImGui inside Dalamud.

##### Inheritance

System.Object
ImGuiHelpers

##### Inherited Members

System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()

###### Namespace: Dalamud.Interface

###### Assembly: Dalamud.dll

##### Syntax

    public static class ImGuiHelpers

### Properties

| Improve this Doc View Source

#### GlobalScale

Gets the global Dalamud scale.

##### Declaration

    public static float GlobalScale { get; }

##### Property Value

Type | Description
--- | ---
System.Single |

| Improve this Doc View Source

#### MainViewport

Gets the main viewport.

##### Declaration

    public static ImGuiViewportPtr MainViewport { get; }

##### Property Value

Type | Description
--- | ---
ImGuiViewportPtr |

### Methods

| Improve this Doc View Source

#### ClickToCopyText(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.

| Improve this Doc View Source

#### 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.

| Improve this Doc View Source

#### ForceNextWindowMainViewport()

Force the next ImGui window to stay inside the main game window.

##### Declaration

    public static void ForceNextWindowMainViewport()

| Improve this Doc View Source

#### 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.

| Improve this Doc View Source

#### 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.

| Improve this Doc View Source

#### 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.

| Improve this Doc View Source

#### 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.

| Improve this Doc View Source

#### 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.

| Improve this Doc View Source

#### 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.

| Improve this Doc View Source

#### 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.

| Improve this Doc View Source

#### 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.

| Improve this Doc View Source

#### 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.