Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ocornut/imgui/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Dear ImGui uses a cursor-based layout system. The cursor represents the current output position where the next widget will be placed. Understanding cursor positioning is fundamental to creating custom layouts.Coordinate Systems
Dear ImGui uses two coordinate systems:- Absolute coordinates:
GetCursorScreenPos(),SetCursorScreenPos(), allImDrawListfunctions - Window-local coordinates:
GetCursorPos(),SetCursorPos(),GetCursorStartPos()
Primary Cursor Functions
GetCursorScreenPos
Current cursor position in absolute screen coordinates
SetCursorScreenPos
New cursor position in absolute screen coordinates
GetContentRegionAvail
Available space in current region
Window-Local Cursor Functions
These functions use window-local coordinates. Prefer using
GetCursorScreenPos() instead.GetCursorPos
Cursor position in window-local coordinates
GetCursorPosX / GetCursorPosY
SetCursorPos
New cursor position in window-local coordinates
SetCursorPosX / SetCursorPosY
New X position in window-local coordinates
New Y position in window-local coordinates
GetCursorStartPos
GetCursorScreenPos() after Begin() to get the absolute coordinates version.
Initial cursor position in window-local coordinates
Conversion
To convert between coordinate systems:Related Functions
See also:- Spacing & Alignment for
Indent(),Unindent(),Spacing(),Dummy() - Columns & Groups for
BeginGroup(),EndGroup()