mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-02 05:43:40 +01:00
feat: add SetWindowPosRelativeMainViewport to ImGuiHelpers
This commit is contained in:
parent
633fe68046
commit
3076e13920
1 changed files with 16 additions and 0 deletions
|
|
@ -37,10 +37,26 @@ namespace Dalamud.Interface
|
|||
public static void ScaledRelativeSameLine(float offset, float spacing = -1.0f) =>
|
||||
ImGui.SameLine(ImGui.GetCursorPosX() + (offset * GlobalScale));
|
||||
|
||||
/// <summary>
|
||||
/// Set the position of the next window relative to the main viewport.
|
||||
/// </summary>
|
||||
/// <param name="position">The position of the next window.</param>
|
||||
/// <param name="condition">When to set the position.</param>
|
||||
/// <param name="pivot">The pivot to set the position around.</param>
|
||||
public static void SetNextWindowPosRelativeMainViewport(
|
||||
Vector2 position, ImGuiCond condition = ImGuiCond.None, Vector2 pivot = default)
|
||||
=> ImGui.SetNextWindowPos(position + MainViewport.Pos, condition, pivot);
|
||||
|
||||
/// <summary>
|
||||
/// Set the position of a window relative to the main viewport.
|
||||
/// </summary>
|
||||
/// <param name="name">The name/ID of the window.</param>
|
||||
/// <param name="position">The position of the window.</param>
|
||||
/// <param name="condition">When to set the position.</param>
|
||||
public static void SetWindowPosRelativeMainViewport(
|
||||
string name, Vector2 position, ImGuiCond condition = ImGuiCond.None)
|
||||
=> ImGui.SetWindowPos(position + MainViewport.Pos, condition);
|
||||
|
||||
/// <summary>
|
||||
/// Get data needed for each new frame.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue