ImGui

Render callbacks, widgets, layouts, buffers and the exported ImGui enums.

175 functionssUNC 100%Lynx 0.0.0

The ImGui table records native immediate-mode UI commands. Its calling conventions are the module bindings documented here, not an automatic binding of every upstream ImGui overload.

Frame callbacks and result timing

BlockInput / InputBlocking
Defaulttrue
Captures mouse/keyboard input while the window requires it.
Blur / EnableBlur
Defaultfalse
Requests backdrop blur.
Dockable / AllowDocking
Defaulttrue
Allows docking.
DockToMain / DockToMainUI
Defaulttrue
Docks to the main interface when docking is enabled.
local open, checked, value = true, false, 0.5
local text = ImGui.StringBuffer("Hello", 256)
ImGui.OnRender(function()
if not open then return end
ImGui.SetNextWindowSize(Vector2.new(340, 210), ImGui.Cond.FirstUseEver)
local visible, closed = ImGui.Begin("Example", open, 0, {BlockInput = true})
if closed then open = false end
if visible then
checked = ImGui.Checkbox("Enabled", checked)
value = ImGui.SliderFloat("Amount", value, 0, 1)
local contents, changed = ImGui.InputText("Text", text)
if changed then print(contents) end
if ImGui.Button("Close") then open = false end
end
ImGui.End()
end)

Functions

ImGui.OnRender

ImGui.OnRender(callback: () -> ()): ()

Registers a persistent, non-yielding frame callback. Runs once immediately to build commands, then rebuilds through the scheduler for rendering. Returns no connection. Registering another callback that creates a window with the same title retires the old callback; environment reset removes registrations.

ImGui.Begin

ImGui.Begin(title: string, open: boolean?, flags: number?, options: WindowOptions?): (boolean, boolean)

Records a window. Returns previous visibility (native visibility and open state combined) and close interaction flag; first build falls back to the supplied open value. Defaults open=true, flags=0. Options may be argument 2 or 3. Always pair End, even if visibility is false; do not treat collapsed visibility as a closed window.

Returns

(boolean, boolean)

Latest completed render result; see frame timing above.

ImGui.End

ImGui.End(): ()

Ends the current window; pair with Begin.

ImGui.PushStyleColor

ImGui.PushStyleColor(index: number, color: Color3 | number): ()

Pushes a style color. Index uses ImGui.Color; packed colors preserve alpha, Color3 supplies alpha=1.

ImGui.PopStyleColor

ImGui.PopStyleColor(count: number?): ()

Pops count style colors; default 1.

ImGui.SameLine

ImGui.SameLine(position: number?, spacing: number?): ()

Continues on the same line. Defaults position=0, spacing=-1 (theme spacing).

ImGui.PushID

ImGui.PushID(id: number): ()

Pushes an integer ID into both the recorded and rendered ID stacks. Use stable IDs for repeated controls.

ImGui.PopID

ImGui.PopID(): ()

Pops an ID pushed by PushID.

ImGui.SetNextWindowPos

ImGui.SetNextWindowPos(position: Vector2, condition: number?, pivot: Vector2?): ()

Sets next window position; defaults condition=0 and pivot=(0,0). Use ImGui.Cond.

ImGui.SetNextWindowSize

ImGui.SetNextWindowSize(size: Vector2, condition: number?): ()

Sets next window size; condition defaults to 0.

ImGui.GetWindowPos

ImGui.GetWindowPos(): Vector2

Returns the matching recorded position, size, available content area or pointer coordinate. First build returns (0,0); rendering uses logical DPI-adjusted coordinates.

Returns

Vector2

Latest completed render result; see frame timing above.

ImGui.GetWindowSize

ImGui.GetWindowSize(): Vector2

Returns the matching recorded position, size, available content area or pointer coordinate. First build returns (0,0); rendering uses logical DPI-adjusted coordinates.

Returns

Vector2

Latest completed render result; see frame timing above.

ImGui.Text

ImGui.Text(text: string): ()

Records literal text (not a printf format string); the function name selects normal, disabled, wrapped or bullet presentation.

ImGui.TextColored

ImGui.TextColored(color: Color3 | number, text: string): ()

Records literal colored text; packed color numbers include alpha.

ImGui.TextDisabled

ImGui.TextDisabled(text: string): ()

Records literal text (not a printf format string); the function name selects normal, disabled, wrapped or bullet presentation.

ImGui.TextEx

ImGui.TextEx(text: string, flags: number?): ()

Records literal text with internal text flags; flags defaults to 0.

ImGui.TextWrapped

ImGui.TextWrapped(text: string): ()

Records literal text (not a printf format string); the function name selects normal, disabled, wrapped or bullet presentation.

ImGui.ArrowButton

ImGui.ArrowButton(label: string, direction: number, size: Vector2?): boolean

Arrow button using ImGui.Dir. Size defaults to (0,0); normal ArrowButton uses native sizing. Returns a press interaction.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.ArrowButtonEx

ImGui.ArrowButtonEx(label: string, direction: number, size: Vector2?, flags: number?): boolean

Sized arrow button; defaults size=(0,0), flags=0. Returns a press interaction.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.Button

ImGui.Button(label: string, size: Vector2?): boolean

Returns a press interaction from the last completed render. Size defaults to (0,0); SmallButton records this argument but uses native small-button sizing.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.ButtonEx

ImGui.ButtonEx(label: string, size: Vector2?, flags: number?): boolean

Extended button; defaults size=(0,0), flags=0 (ImGui.ButtonFlags). Returns a press interaction.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.ColorButton

ImGui.ColorButton(label: string, color: Color3 | number, flags: number?, size: Vector2?): boolean

Color button using ImGui.ColorEditFlags. Defaults flags=0, size=(0,0). Returns a press interaction.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.ImageButton

ImGui.ImageButton(texture: number | lightuserdata, size: Vector2, uv0: Vector2?, uv1: Vector2?, background: Color3 | number?, tint: Color3 | number?): boolean

Image button; texture is a native texture identifier, not an encoded image string or Drawing resource. Defaults uv0=(0,0), uv1=(1,1), transparent background and white tint. Use PushID around multiple image buttons.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.InvisibleButton

ImGui.InvisibleButton(size: Vector2, flags: number?): boolean

Invisible interaction region with a generated ID. Defaults flags=0; use PushID for multiple regions.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.RadioButton

ImGui.RadioButton(label: string, active: boolean): boolean

Records the supplied selection state and returns a press interaction; assign your selection in response.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.SmallButton

ImGui.SmallButton(label: string, size: Vector2?): boolean

Returns a press interaction from the last completed render. Size defaults to (0,0); SmallButton records this argument but uses native small-button sizing.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.TabItemButton

ImGui.TabItemButton(label: string, flags: number?): boolean

Button on a tab bar; flags defaults to 0 (ImGui.TabItemFlags).

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.Checkbox

ImGui.Checkbox(label: string, value: boolean?): (boolean, boolean)

Returns value and changed flag; default value=false. Store the returned value for the next build.

Returns

(boolean, boolean)

Latest completed render result; see frame timing above.

ImGui.SliderAngle

ImGui.SliderAngle(label: string, radians: number?, minimumDegrees: number?, maximumDegrees: number?, format: string?, flags: number?): (number, boolean)

Returns radians and changed flag. Defaults radians=0, minimumDegrees=-360, maximumDegrees=360, format=%.0f deg, flags=0.

Returns

(number, boolean)

Latest completed render result; see frame timing above.

ImGui.SliderFloat

ImGui.SliderFloat(label: string, value: number?, minimum: number, maximum: number, format: string?, flags: number?): (number, boolean)

Returns value and changed flag. Initial value defaults to 0; format defaults to %.3f for SliderFloat and %d for SliderInt; flags=0 (ImGui.SliderFlags). Bounds are required, even when value is nil.

Returns

(number, boolean)

Latest completed render result; see frame timing above.

ImGui.SliderInt

ImGui.SliderInt(label: string, value: number?, minimum: number, maximum: number, format: string?, flags: number?): (number, boolean)

Returns value and changed flag. Initial value defaults to 0; format defaults to %.3f for SliderFloat and %d for SliderInt; flags=0 (ImGui.SliderFlags). Bounds are required, even when value is nil.

Returns

(number, boolean)

Latest completed render result; see frame timing above.

ImGui.Combo

ImGui.Combo(label: string, selected: number, items: {string}): (number, boolean)

Returns the zero-based selected index and changed flag. The items table is a normal 1-based Lua array, but selection is native ImGui zero-based; empty items produce -1. Values are clamped to the valid item range on render.

Returns

(number, boolean)

Latest completed render result; see frame timing above.

ImGui.ColorPicker3

ImGui.ColorPicker3(label: string, color: Color3 | number, flags: number?): (Color3, boolean)

Returns RGB Color3 and changed flag; flags defaults to 0. The 4-component variants accept alpha through a packed color number, but the returned Color3 has no alpha channel.

Returns

(Color3, boolean)

Latest completed render result; see frame timing above.

ImGui.ColorPicker4

ImGui.ColorPicker4(label: string, color: Color3 | number, flags: number?): (Color3, boolean)

Returns RGB Color3 and changed flag; flags defaults to 0. The 4-component variants accept alpha through a packed color number, but the returned Color3 has no alpha channel.

Returns

(Color3, boolean)

Latest completed render result; see frame timing above.

ImGui.Selectable

ImGui.Selectable(label: string, selected: boolean?, flags: number?, size: Vector2?): (boolean, boolean)

Returns selected state and interaction flag. Defaults selected=false, flags=0 (ImGui.SelectableFlags), size=(0,0).

Returns

(boolean, boolean)

Latest completed render result; see frame timing above.

ImGui.StringBuffer

ImGui.StringBuffer(initial: string?, capacity: number?): ImGuiStringBuffer

Creates persistent text storage. Defaults initial="", capacity=256 bytes; capacity must be 2..1048576 and includes the terminator. Initial text is truncated to capacity-1 and uses C-string semantics. tostring(buffer) reads its current text. No other methods or writable fields are exposed.

Returns

ImGuiStringBuffer

The result described above.

ImGui.InputText

ImGui.InputText(label: string, buffer: ImGuiStringBuffer, flags: number?): (string, boolean)

Records an editable buffer and returns text and interaction flag. Flags defaults to 0 (ImGui.InputTextFlags). Keep the same buffer across builds; render updates its contents.

Returns

(string, boolean)

Latest completed render result; see frame timing above.

ImGui.InputTextWithHint

ImGui.InputTextWithHint(label: string, hint: string, buffer: ImGuiStringBuffer, flags: number?): (string, boolean)

Like InputText, with placeholder text; flags defaults to 0.

Returns

(string, boolean)

Latest completed render result; see frame timing above.

ImGui.CollapsingHeader

ImGui.CollapsingHeader(label: string, flags: number?): boolean

Returns the previous expanded state; first build=false. Flags defaults to 0 (ImGui.TreeNodeFlags). A header does not need TreePop.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.SetItemAllowOverlap

ImGui.SetItemAllowOverlap(): ()

Allows the last recorded item to overlap another interaction region.

ImGui.GetColorU32

ImGui.GetColorU32(red: number?, green: number?, blue: number?, alpha: number?): number

Immediately converts RGBA floats to a packed color number; each component defaults to 1. Callable outside OnRender.

Returns

number

The result described above.

ImGui.BeginMenuBar

ImGui.BeginMenuBar(): boolean

Begins a window menu bar; first build=true. EndMenuBar is paired when the returned state is true.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.EndMenuBar

ImGui.EndMenuBar(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.BeginMenu

ImGui.BeginMenu(label: string, enabled: boolean?): boolean

Begins a menu; enabled defaults to true. Pair EndMenu only when true; first build=false.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.EndMenu

ImGui.EndMenu(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.MenuItem

ImGui.MenuItem(label: string, shortcut: string?, selected: boolean?, enabled: boolean?): (boolean, boolean)

Returns selected state and interaction flag. Defaults shortcut="", selected=false, enabled=true.

Returns

(boolean, boolean)

Latest completed render result; see frame timing above.

ImGui.Separator

ImGui.Separator(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.IsItemClicked

ImGui.IsItemClicked(button: number?): boolean

Queries the last item click or named mouse-button state from the completed render. Button defaults to 0 (left); use ImGui.MouseButton.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.TreeNode

ImGui.TreeNode(label: string, id: number?): boolean

Records a tree node, optionally with an explicit integer ID; first build=false. Pair TreePop only for an open node.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.TreeNodeEx

ImGui.TreeNodeEx(label: string, flags: number?, id: number?): boolean

Tree node with ImGui.TreeNodeFlags (default 0) and optional integer ID. Pair TreePop for an open node unless flags disable the push.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.TreePop

ImGui.TreePop(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.Image

ImGui.Image(texture: number | lightuserdata, size: Vector2, uv0: Vector2?, uv1: Vector2?, tint: Color3 | number?, border: Color3 | number?): ()

Records a native texture identifier. Defaults uv0=(0,0), uv1=(1,1), white tint, transparent border. It does not decode image files or accept Drawing resource userdata.

ImGui.PushItemWidth

ImGui.PushItemWidth(width: number): ()

Pushes the width used by subsequent input controls; pair with PopItemWidth.

ImGui.PopItemWidth

ImGui.PopItemWidth(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.SetNextWindowSizeConstraints

ImGui.SetNextWindowSizeConstraints(minimum: Vector2, maximum: Vector2): ()

Constrains the next window size.

ImGui.SetScrollHereX

ImGui.SetScrollHereX(centerRatio: number?): ()

Scrolls the current region toward the last item; centerRatio defaults to 0.5.

ImGui.SetScrollHereY

ImGui.SetScrollHereY(centerRatio: number?): ()

Scrolls the current region toward the last item; centerRatio defaults to 0.5.

ImGui.BeginChild

ImGui.BeginChild(id: string, size: Vector2?, childFlags: number?, windowFlags: number?): ()

Records a child window and returns no value in this binding. Defaults size=(0,0), childFlags=0, windowFlags=0. Always pair EndChild; use ImGui.ChildFlags and ImGui.WindowFlags.

ImGui.EndChild

ImGui.EndChild(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.SetItemDefaultFocus

ImGui.SetItemDefaultFocus(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.SetKeyboardFocusHere

ImGui.SetKeyboardFocusHere(relativeIndex: number?): ()

Requests keyboard focus; relativeIndex defaults to 0.

ImGui.BeginTooltip

ImGui.BeginTooltip(): boolean

Begins a tooltip and returns its prior visibility (first build=true); pair EndTooltip when true.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.BeginTooltipEx

ImGui.BeginTooltipEx(tooltipFlags: number, windowFlags: number): boolean

Extended tooltip with required integer flag arguments; first build=true. Pair EndTooltip when true.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.BeginItemTooltip

ImGui.BeginItemTooltip(): boolean

Begins a tooltip for the last item; first build=false. Pair EndTooltip when true.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.BeginTooltipHidden

ImGui.BeginTooltipHidden(): boolean

Begins a tooltip and returns its prior visibility (first build=true); pair EndTooltip when true.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.EndTooltip

ImGui.EndTooltip(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.BeginPopup

ImGui.BeginPopup(id: string, flags: number?): boolean

Begins a previously opened popup. Flags defaults to 0; first build=false. Pair EndPopup only when true.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.EndPopup

ImGui.EndPopup(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.BeginCombo

ImGui.BeginCombo(label: string, preview: string, flags: number?): boolean

Begins a custom combo body; flags=0 (ImGui.ComboFlags). First build=false; pair EndCombo when true.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.EndCombo

ImGui.EndCombo(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.BeginListBox

ImGui.BeginListBox(label: string, size: Vector2?): boolean

Begins a custom list body; size=(0,0). First build=true; pair EndListBox when true.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.EndListBox

ImGui.EndListBox(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.Indent

ImGui.Indent(width: number?): ()

Adds or removes indentation; width defaults to 0 (theme indentation).

ImGui.Unindent

ImGui.Unindent(width: number?): ()

Adds or removes indentation; width defaults to 0 (theme indentation).

ImGui.GetCursorPos

ImGui.GetCursorPos(): Vector2

Returns the matching recorded position, size, available content area or pointer coordinate. First build returns (0,0); rendering uses logical DPI-adjusted coordinates.

Returns

Vector2

Latest completed render result; see frame timing above.

ImGui.SetCursorPos

ImGui.SetCursorPos(position: Vector2): ()

Sets cursor coordinates relative to the window or screen, respectively; logical DPI-adjusted units.

ImGui.SetVSync

ImGui.SetVSync(enabled: boolean): ()

Sets module VSync immediately; callable outside OnRender.

ImGui.IsItemHovered

ImGui.IsItemHovered(flags: number?): boolean

Returns the named hover/focus state, with flags defaulting to 0; use ImGui.HoveredFlags or ImGui.FocusedFlags. First build=false.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.IsItemActive

ImGui.IsItemActive(): boolean

Returns whether the last item is being activated. First build=false.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.IsItemFocused

ImGui.IsItemFocused(): boolean

Returns whether the last item has keyboard focus. First build=false.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.IsItemVisible

ImGui.IsItemVisible(): boolean

Returns whether the last item is inside its clipping rectangle. First build=false.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.IsItemEdited

ImGui.IsItemEdited(): boolean

Returns whether the last item was edited. First build=false.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.IsItemActivated

ImGui.IsItemActivated(): boolean

Returns whether the last item became active. First build=false.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.IsItemDeactivated

ImGui.IsItemDeactivated(): boolean

Returns whether the last item stopped being active. First build=false.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.IsItemDeactivatedAfterEdit

ImGui.IsItemDeactivatedAfterEdit(): boolean

Returns whether the last item stopped being active after editing. First build=false.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.IsAnyItemHovered

ImGui.IsAnyItemHovered(): boolean

Returns whether the any item is hovered. First build=false.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.IsAnyItemActive

ImGui.IsAnyItemActive(): boolean

Returns whether the any item is active. First build=false.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.IsWindowHovered

ImGui.IsWindowHovered(flags: number?): boolean

Returns the named hover/focus state, with flags defaulting to 0; use ImGui.HoveredFlags or ImGui.FocusedFlags. First build=false.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.IsWindowFocused

ImGui.IsWindowFocused(flags: number?): boolean

Returns the named hover/focus state, with flags defaulting to 0; use ImGui.HoveredFlags or ImGui.FocusedFlags. First build=false.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.IsWindowAppearing

ImGui.IsWindowAppearing(): boolean

Returns whether the window appeared this frame. First build=false.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.IsWindowCollapsed

ImGui.IsWindowCollapsed(): boolean

Returns whether the window is collapsed. First build=false.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.GetItemRectMin

ImGui.GetItemRectMin(): Vector2

Returns the matching recorded position, size, available content area or pointer coordinate. First build returns (0,0); rendering uses logical DPI-adjusted coordinates.

Returns

Vector2

Latest completed render result; see frame timing above.

ImGui.GetItemRectMax

ImGui.GetItemRectMax(): Vector2

Returns the matching recorded position, size, available content area or pointer coordinate. First build returns (0,0); rendering uses logical DPI-adjusted coordinates.

Returns

Vector2

Latest completed render result; see frame timing above.

ImGui.GetItemRectSize

ImGui.GetItemRectSize(): Vector2

Returns the matching recorded position, size, available content area or pointer coordinate. First build returns (0,0); rendering uses logical DPI-adjusted coordinates.

Returns

Vector2

Latest completed render result; see frame timing above.

ImGui.GetContentRegionAvail

ImGui.GetContentRegionAvail(): Vector2

Returns the matching recorded position, size, available content area or pointer coordinate. First build returns (0,0); rendering uses logical DPI-adjusted coordinates.

Returns

Vector2

Latest completed render result; see frame timing above.

ImGui.GetCursorScreenPos

ImGui.GetCursorScreenPos(): Vector2

Returns the matching recorded position, size, available content area or pointer coordinate. First build returns (0,0); rendering uses logical DPI-adjusted coordinates.

Returns

Vector2

Latest completed render result; see frame timing above.

ImGui.GetMousePos

ImGui.GetMousePos(): Vector2

Returns the matching recorded position, size, available content area or pointer coordinate. First build returns (0,0); rendering uses logical DPI-adjusted coordinates.

Returns

Vector2

Latest completed render result; see frame timing above.

ImGui.GetTextLineHeight

ImGui.GetTextLineHeight(): number

Returns the text-line height; first build=0. Layout measurements use logical DPI-adjusted units.

Returns

number

Latest completed render result; see frame timing above.

ImGui.GetTextLineHeightWithSpacing

ImGui.GetTextLineHeightWithSpacing(): number

Returns the text-line height including spacing; first build=0. Layout measurements use logical DPI-adjusted units.

Returns

number

Latest completed render result; see frame timing above.

ImGui.GetFrameHeight

ImGui.GetFrameHeight(): number

Returns the control frame height; first build=0. Layout measurements use logical DPI-adjusted units.

Returns

number

Latest completed render result; see frame timing above.

ImGui.GetFrameHeightWithSpacing

ImGui.GetFrameHeightWithSpacing(): number

Returns the control frame height including spacing; first build=0. Layout measurements use logical DPI-adjusted units.

Returns

number

Latest completed render result; see frame timing above.

ImGui.CalcItemWidth

ImGui.CalcItemWidth(): number

Returns the current item width; first build=0. Layout measurements use logical DPI-adjusted units.

Returns

number

Latest completed render result; see frame timing above.

ImGui.GetCursorPosX

ImGui.GetCursorPosX(): number

Returns the local cursor X; first build=0. Layout measurements use logical DPI-adjusted units.

Returns

number

Latest completed render result; see frame timing above.

ImGui.GetCursorPosY

ImGui.GetCursorPosY(): number

Returns the local cursor Y; first build=0. Layout measurements use logical DPI-adjusted units.

Returns

number

Latest completed render result; see frame timing above.

ImGui.GetScrollX

ImGui.GetScrollX(): number

Returns the horizontal scroll; first build=0. Layout measurements use logical DPI-adjusted units.

Returns

number

Latest completed render result; see frame timing above.

ImGui.GetScrollY

ImGui.GetScrollY(): number

Returns the vertical scroll; first build=0. Layout measurements use logical DPI-adjusted units.

Returns

number

Latest completed render result; see frame timing above.

ImGui.GetScrollMaxX

ImGui.GetScrollMaxX(): number

Returns the maximum horizontal scroll; first build=0. Layout measurements use logical DPI-adjusted units.

Returns

number

Latest completed render result; see frame timing above.

ImGui.GetScrollMaxY

ImGui.GetScrollMaxY(): number

Returns the maximum vertical scroll; first build=0. Layout measurements use logical DPI-adjusted units.

Returns

number

Latest completed render result; see frame timing above.

ImGui.GetTime

ImGui.GetTime(): number

Returns the ImGui elapsed seconds; first build=0. Layout measurements use logical DPI-adjusted units.

Returns

number

Latest completed render result; see frame timing above.

ImGui.GetDeltaTime

ImGui.GetDeltaTime(): number

Returns the render delta seconds; first build=0. Layout measurements use logical DPI-adjusted units.

Returns

number

Latest completed render result; see frame timing above.

ImGui.GetFrameCount

ImGui.GetFrameCount(): number

Returns the render frame count; first build=0. Layout measurements use logical DPI-adjusted units.

Returns

number

Latest completed render result; see frame timing above.

ImGui.GetColumnIndex

ImGui.GetColumnIndex(): number

Returns the zero-based current legacy column; first build=0. Layout measurements use logical DPI-adjusted units.

Returns

number

Latest completed render result; see frame timing above.

ImGui.GetColumnsCount

ImGui.GetColumnsCount(): number

Returns the legacy column count; first build=0. Layout measurements use logical DPI-adjusted units.

Returns

number

Latest completed render result; see frame timing above.

ImGui.Spacing

ImGui.Spacing(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.NewLine

ImGui.NewLine(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.Bullet

ImGui.Bullet(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.BeginGroup

ImGui.BeginGroup(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.EndGroup

ImGui.EndGroup(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.AlignTextToFramePadding

ImGui.AlignTextToFramePadding(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.Dummy

ImGui.Dummy(size: Vector2): ()

Reserves a non-interactive layout region.

ImGui.SetCursorPosX

ImGui.SetCursorPosX(position: number): ()

Sets a local cursor component in logical DPI-adjusted units.

ImGui.SetCursorPosY

ImGui.SetCursorPosY(position: number): ()

Sets a local cursor component in logical DPI-adjusted units.

ImGui.SetCursorScreenPos

ImGui.SetCursorScreenPos(position: Vector2): ()

Sets cursor coordinates relative to the window or screen, respectively; logical DPI-adjusted units.

ImGui.BulletText

ImGui.BulletText(text: string): ()

Records literal text (not a printf format string); the function name selects normal, disabled, wrapped or bullet presentation.

ImGui.LabelText

ImGui.LabelText(label: string, text: string): ()

Records a value with a separate label; both strings are literal, not format strings.

ImGui.InputInt

ImGui.InputInt(label: string, value: number?, step: number?, fastStep: number?, flags: number?): (number, boolean)

Integer input returning value and changed flag. Defaults value=0, step=1, fastStep=100, flags=0 (ImGui.InputTextFlags).

Returns

(number, boolean)

Latest completed render result; see frame timing above.

ImGui.InputFloat

ImGui.InputFloat(label: string, value: number?, step: number?, fastStep: number?, format: string?, flags: number?): (number, boolean)

Float input returning value and changed flag. Defaults value=0, step=0, fastStep=0, format=%.3f, flags=0 (ImGui.InputTextFlags).

Returns

(number, boolean)

Latest completed render result; see frame timing above.

ImGui.DragFloat

ImGui.DragFloat(label: string, value: number?, speed: number?, minimum: number?, maximum: number?, format: string?, flags: number?): (number, boolean)

Drag input returning value and changed flag. Defaults value=0, speed=1, minimum=0, maximum=0 (unbounded), format=%.3f for DragFloat / %d for DragInt, flags=0 (ImGui.SliderFlags).

Returns

(number, boolean)

Latest completed render result; see frame timing above.

ImGui.DragInt

ImGui.DragInt(label: string, value: number?, speed: number?, minimum: number?, maximum: number?, format: string?, flags: number?): (number, boolean)

Drag input returning value and changed flag. Defaults value=0, speed=1, minimum=0, maximum=0 (unbounded), format=%.3f for DragFloat / %d for DragInt, flags=0 (ImGui.SliderFlags).

Returns

(number, boolean)

Latest completed render result; see frame timing above.

ImGui.ColorEdit3

ImGui.ColorEdit3(label: string, color: Color3 | number, flags: number?): (Color3, boolean)

Returns RGB Color3 and changed flag; flags defaults to 0. The 4-component variants accept alpha through a packed color number, but the returned Color3 has no alpha channel.

Returns

(Color3, boolean)

Latest completed render result; see frame timing above.

ImGui.ColorEdit4

ImGui.ColorEdit4(label: string, color: Color3 | number, flags: number?): (Color3, boolean)

Returns RGB Color3 and changed flag; flags defaults to 0. The 4-component variants accept alpha through a packed color number, but the returned Color3 has no alpha channel.

Returns

(Color3, boolean)

Latest completed render result; see frame timing above.

ImGui.ProgressBar

ImGui.ProgressBar(fraction: number, size: Vector2?, overlay: string?): ()

Progress bar; defaults size=(-1,0), overlay="". Fraction is supplied directly to ImGui.

ImGui.ListBox

ImGui.ListBox(label: string, selected: number, items: {string}, heightInItems: number?): (number, boolean)

Returns a zero-based selected index and changed flag. Items use a 1-based Lua array; empty items produce -1. Height defaults to -1.

Returns

(number, boolean)

Latest completed render result; see frame timing above.

ImGui.SetNextItemOpen

ImGui.SetNextItemOpen(open: boolean, condition: number?): ()

Sets next tree item expansion; condition defaults to 0 (ImGui.Cond).

ImGui.BeginTabBar

ImGui.BeginTabBar(id: string, flags: number?): boolean

Begins a tab bar; flags=0 (ImGui.TabBarFlags), first build=true. Pair EndTabBar when true.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.EndTabBar

ImGui.EndTabBar(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.BeginTabItem

ImGui.BeginTabItem(label: string, open: boolean?, flags: number?): (boolean, boolean)

Returns previous tab visibility and previous open state (both true on first build). Omit open to hide its close button; flags=0. Pair EndTabItem only for a visible tab.

Returns

(boolean, boolean)

Latest completed render result; see frame timing above.

ImGui.EndTabItem

ImGui.EndTabItem(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.SetTabItemClosed

ImGui.SetTabItemClosed(label: string): ()

Notifies the tab bar that a tab was closed.

ImGui.BeginTable

ImGui.BeginTable(id: string, columns: number, flags: number?, outerSize: Vector2?, innerWidth: number?): boolean

Begins a table; defaults flags=0 (ImGui.TableFlags), outerSize=(0,0), innerWidth=0. First build=true. Pair EndTable when true.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.EndTable

ImGui.EndTable(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.TableNextRow

ImGui.TableNextRow(flags: number?, minimumHeight: number?): ()

Begins the next table row; defaults flags=0 (ImGui.TableRowFlags), minimumHeight=0.

ImGui.TableNextColumn

ImGui.TableNextColumn(): boolean

Advances a table column and returns its previous visibility; first build=false.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.TableSetColumnIndex

ImGui.TableSetColumnIndex(column: number): boolean

Selects a zero-based table column and returns its previous visibility; first build=false.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.TableSetupColumn

ImGui.TableSetupColumn(label: string, flags: number?, initialWidthOrWeight: number?): ()

Configures a table column; defaults flags=0 (ImGui.TableColumnFlags), initialWidthOrWeight=0. This binding has no user-ID argument.

ImGui.TableSetupScrollFreeze

ImGui.TableSetupScrollFreeze(columns: number, rows: number): ()

Freezes the first columns and rows while scrolling.

ImGui.TableHeadersRow

ImGui.TableHeadersRow(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.OpenPopup

ImGui.OpenPopup(id: string, flags: number?): ()

Opens a popup; flags defaults to 0 (ImGui.PopupFlags).

ImGui.CloseCurrentPopup

ImGui.CloseCurrentPopup(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.BeginPopupModal

ImGui.BeginPopupModal(name: string, open: boolean?, flags: number?): (boolean, boolean)

Returns previous visibility (first=false) and open state (first=true). Omit open to hide the close button; flags=0. Pair EndPopup when visible.

Returns

(boolean, boolean)

Latest completed render result; see frame timing above.

ImGui.BeginPopupContextItem

ImGui.BeginPopupContextItem(id: string?, flags: number?): boolean

Begins a contextual popup. Defaults id="", flags=1 (right mouse button); first build=false. Pair EndPopup when true.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.BeginPopupContextWindow

ImGui.BeginPopupContextWindow(id: string?, flags: number?): boolean

Begins a contextual popup. Defaults id="", flags=1 (right mouse button); first build=false. Pair EndPopup when true.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.BeginPopupContextVoid

ImGui.BeginPopupContextVoid(id: string?, flags: number?): boolean

Begins a contextual popup. Defaults id="", flags=1 (right mouse button); first build=false. Pair EndPopup when true.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.IsPopupOpen

ImGui.IsPopupOpen(id: string, flags: number?): boolean

Queries popup state with flags defaulting to 0; first build=false.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.SetNextWindowCollapsed

ImGui.SetNextWindowCollapsed(collapsed: boolean, condition: number?): ()

Sets next window collapsed state; condition defaults to 0 (ImGui.Cond).

ImGui.SetNextWindowFocus

ImGui.SetNextWindowFocus(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.SetNextWindowBgAlpha

ImGui.SetNextWindowBgAlpha(alpha: number): ()

Sets next window background alpha.

ImGui.SetWindowFontScale

ImGui.SetWindowFontScale(scale: number): ()

Sets current window font scale.

ImGui.SetScrollX

ImGui.SetScrollX(scroll: number): ()

Sets the named scroll component.

ImGui.SetScrollY

ImGui.SetScrollY(scroll: number): ()

Sets the named scroll component.

ImGui.PushStyleVar

ImGui.PushStyleVar(index: number, value: number | Vector2): ()

Pushes a numeric or Vector2 style variable; index uses ImGui.StyleVar and value must match its native type. Pair PopStyleVar.

ImGui.PopStyleVar

ImGui.PopStyleVar(count: number?): ()

Pops style variables; count defaults to 1.

ImGui.BeginDisabled

ImGui.BeginDisabled(disabled: boolean?): ()

Begins a disabled-control region; disabled defaults to true. Pair EndDisabled.

ImGui.EndDisabled

ImGui.EndDisabled(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.IsMouseClicked

ImGui.IsMouseClicked(button: number?): boolean

Queries the last item click or named mouse-button state from the completed render. Button defaults to 0 (left); use ImGui.MouseButton.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.IsMouseDown

ImGui.IsMouseDown(button: number?): boolean

Queries the last item click or named mouse-button state from the completed render. Button defaults to 0 (left); use ImGui.MouseButton.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.IsMouseReleased

ImGui.IsMouseReleased(button: number?): boolean

Queries the last item click or named mouse-button state from the completed render. Button defaults to 0 (left); use ImGui.MouseButton.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.IsMouseDoubleClicked

ImGui.IsMouseDoubleClicked(button: number?): boolean

Queries the last item click or named mouse-button state from the completed render. Button defaults to 0 (left); use ImGui.MouseButton.

Returns

boolean

Latest completed render result; see frame timing above.

ImGui.CalcTextSize

ImGui.CalcTextSize(text: string, wrapWidth: number?): Vector2

Returns prior text measurement; wrapWidth defaults to -1 (no wrapping). First build=(0,0).

Returns

Vector2

Latest completed render result; see frame timing above.

ImGui.Columns

ImGui.Columns(count: number?, id: string?, borders: boolean?): ()

Configures legacy columns; defaults count=1, id="", borders=true. Column indices are zero-based.

ImGui.NextColumn

ImGui.NextColumn(): ()

Records the named layout, scope, focus or popup command. End/Pop commands close their matching Begin/Push scope; TableHeadersRow uses columns configured by TableSetupColumn.

ImGui.GetColumnWidth

ImGui.GetColumnWidth(column: number?): number

Returns prior legacy-column width; column defaults to -1 (current); first build=0.

Returns

number

Latest completed render result; see frame timing above.

ImGui.SetColumnWidth

ImGui.SetColumnWidth(column: number, width: number): ()

Sets zero-based legacy-column width.

ImGui.SetTooltip

ImGui.SetTooltip(text: string): ()

Records literal tooltip text; SetItemTooltip targets the last item.

ImGui.SetItemTooltip

ImGui.SetItemTooltip(text: string): ()

Records literal tooltip text; SetItemTooltip targets the last item.

Read-only enum tables

Only the entries listed here are exported. Combine compatible flag entries with bit32.bor. The table and its nested enum tables are read-only; values are taken from the bundled ImGui build.

ImGui.WindowFlags

EntryValue
None0
NoTitleBar1
NoResize2
NoMove4
NoScrollbar8
NoCollapse32
AlwaysAutoResize64
NoBackground128
MenuBar1024
NoSavedSettings256

ImGui.Cond

EntryValue
None0
Always1
Once2
FirstUseEver4
Appearing8

ImGui.Dir

EntryValue
Left0
Right1
Up2
Down3

ImGui.MouseButton

EntryValue
Left0
Right1
Middle2

ImGui.Color

EntryValue
Text0
TextDisabled1
WindowBg2
ChildBg3
PopupBg4
Border5
FrameBg7
Button21
ButtonHovered22
ButtonActive23
Header24
HeaderHovered25
HeaderActive26
CheckMark18
SliderGrab19
SliderGrabActive20

ImGui.TreeNodeFlags

EntryValue
None0
Selected1
Framed2
DefaultOpen32
OpenOnArrow128
Leaf256
Bullet512

ImGui.InputTextFlags

EntryValue
None0
CharsDecimal1
CharsHexadecimal2
AutoSelectAll4096
EnterReturnsTrue64
ReadOnly512
Password1024

ImGui.SliderFlags

EntryValue
None0
AlwaysClamp1536
Logarithmic32
NoRoundToFormat64
NoInput128

ImGui.ColorEditFlags

EntryValue
None0
NoAlpha2
NoPicker4
NoOptions8
NoInputs32
AlphaBar262144
DisplayRGB1048576
DisplayHSV2097152

ImGui.SelectableFlags

EntryValue
None0
NoAutoClosePopups1
SpanAllColumns2
Disabled8
AllowOverlap16

ImGui.ComboFlags

EntryValue
None0
PopupAlignLeft1
HeightSmall2
HeightRegular4
HeightLarge8
NoArrowButton32
NoPreview64

ImGui.ChildFlags

EntryValue
None0
Borders1
ResizeX4
ResizeY8
AutoResizeX16
AutoResizeY32
FrameStyle128

ImGui.StyleVar

EntryValue
Alpha0
DisabledAlpha1
WindowPadding2
WindowRounding3
WindowBorderSize4
WindowMinSize5
WindowTitleAlign6
ChildRounding7
ChildBorderSize8
PopupRounding9
PopupBorderSize10
FramePadding11
FrameRounding12
FrameBorderSize13
ItemSpacing14
ItemInnerSpacing15
IndentSpacing16
CellPadding17
ScrollbarSize18
ScrollbarRounding19
GrabMinSize21
GrabRounding22
TabRounding25
ButtonTextAlign35
SelectableTextAlign36

ImGui.TabBarFlags

EntryValue
None0
Reorderable1
AutoSelectNewTabs2
TabListPopupButton4
NoCloseWithMiddleMouseButton8
NoTabListScrollingButtons16
NoTooltip32
FittingPolicyResizeDown256
FittingPolicyScroll512

ImGui.TabItemFlags

EntryValue
None0
UnsavedDocument1
SetSelected2
NoCloseWithMiddleMouseButton4
NoPushId8
NoTooltip16
NoReorder32
Leading64
Trailing128

ImGui.TableFlags

EntryValue
None0
Resizable1
Reorderable2
Hideable4
Sortable8
RowBg64
BordersInnerH128
BordersOuterH256
BordersInnerV512
BordersOuterV1024
BordersInner640
BordersOuter1280
Borders1920
NoBordersInBody2048
ScrollX16777216
ScrollY33554432
SizingFixedFit8192
SizingFixedSame16384
SizingStretchProp24576
SizingStretchSame32768

ImGui.TableColumnFlags

EntryValue
None0
DefaultHide2
DefaultSort4
WidthStretch8
WidthFixed16
NoResize32
NoReorder64
NoHide128
NoSort512
IndentEnable65536
NoHeaderLabel4096
AngledHeader262144

ImGui.TableRowFlags

EntryValue
None0
Headers1

ImGui.PopupFlags

EntryValue
None0
MouseButtonLeft4
MouseButtonRight8
MouseButtonMiddle12
NoOpenOverExistingPopup128
NoOpenOverItems256
AnyPopupId1024
AnyPopupLevel2048
AnyPopup3072

ImGui.HoveredFlags

EntryValue
None0
ChildWindows1
RootWindow2
AnyWindow4
NoPopupHierarchy8
AllowWhenBlockedByPopup32
AllowWhenBlockedByActiveItem128
AllowWhenDisabled1024
RootAndChildWindows3
ForTooltip4096
DelayShort32768
DelayNormal65536
Stationary8192

ImGui.FocusedFlags

EntryValue
None0
ChildWindows1
RootWindow2
AnyWindow4
NoPopupHierarchy8
RootAndChildWindows3

ImGui.ButtonFlags

EntryValue
None0
MouseButtonLeft1
MouseButtonRight2
MouseButtonMiddle4