Spacing Functions
Spacing
Dummy
InvisibleButton(), Dummy() won’t take mouse clicks or be navigable.
const ImVec2&
Size of the dummy item in pixels
NewLine
SameLine() or force a new line when in a horizontal-layout context.
Example:
Horizontal Layout
SameLine
float
default:"0.0f"
Absolute X position from left of window. Use 0.0f to use current position.
float
default:"-1.0f"
Spacing from previous widget. Use -1.0f to use default spacing (style.ItemInnerSpacing.x).
Indentation
Indent
indent_w, or style.IndentSpacing if indent_w <= 0.
float
default:"0.0f"
Indentation width in pixels. Use 0.0f or negative for default
style.IndentSpacing.Unindent
indent_w, or style.IndentSpacing if indent_w <= 0.
float
default:"0.0f"
Indentation width in pixels. Use 0.0f or negative for default
style.IndentSpacing.Alignment
AlignTextToFramePadding
FramePadding.y so that it will align properly to regularly framed items (call if you have text on a line before a framed item).
Example:
Separator
Separator
SeparatorText
const char*
Text to display on the separator
Measurement Functions
GetTextLineHeight
FontSize.
float
Height in pixels
GetTextLineHeightWithSpacing
FontSize + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of text).
float
Height with spacing in pixels
GetFrameHeight
FontSize + style.FramePadding.y * 2.
float
Frame height in pixels
GetFrameHeightWithSpacing
FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets).
float
Frame height with spacing in pixels