Skip to content

imgui

A global table of functions: imgui.<function>(…).

Dear ImGui for Luau scripts, as the global table imgui: snake_case functions over the same calls the dev tools use. A widget returns changed, value; a window or tree that can be open returns whether it is; every begin has its end (ImGui recovers from a script that forgets, at the end of the frame). With no frame open every call does nothing and returns what it was given, so tool code can stay in a shipped game. Ids are the labels, with ImGui's ## and ### conventions.

begin_window

imgui.begin_window: (title: string, open: any, flags: ({ ImGuiWindowFlags } | {})?) -> (boolean, boolean)

Begins a window. Pass true for open to give it a close button; the second result is whether it is still open. Always call end_window.

end_window

imgui.end_window: () -> ()

set_next_window_pos

imgui.set_next_window_pos: (x: number, y: number, condition: ImGuiCond?) -> ()

set_next_window_size

imgui.set_next_window_size: (width: number, height: number, condition: ImGuiCond?) -> ()

begin_child

imgui.begin_child: (id: string, width: number?, height: number?) -> boolean

A scrolling region inside a window. Always call end_child.

end_child

imgui.end_child: () -> ()

text

imgui.text: (text: string) -> ()

text_colored

imgui.text_colored: (color: { number }, text: string) -> ()

Text in a color: a table of 3 or 4 numbers from 0 to 1.

text_wrapped

imgui.text_wrapped: (text: string) -> ()

text_disabled

imgui.text_disabled: (text: string) -> ()

button

imgui.button: (label: string) -> boolean

checkbox

imgui.checkbox: (label: string, value: boolean) -> (boolean, boolean)

slider_float

imgui.slider_float: (label: string, value: number, min: number, max: number) -> (boolean, number)

slider_int

imgui.slider_int: (label: string, value: number, min: number, max: number) -> (boolean, number)

drag_float

imgui.drag_float: (label: string, value: number, speed: number?, min: number?, max: number?) -> (boolean, number)

drag_float3

imgui.drag_float3: (label: string, value: Vector3, speed: number?) -> (boolean, Vector3)

input_int

imgui.input_int: (label: string, value: number) -> (boolean, number)

input_float

imgui.input_float: (label: string, value: number) -> (boolean, number)

input_text

imgui.input_text: (label: string, value: string, maxLength: number?) -> (boolean, string)

A text field of at most max_length bytes.

color_edit

imgui.color_edit: (label: string, color: { number }) -> (boolean, { number })

A color editor: red, green, blue and alpha, from 0 to 1.

combo

imgui.combo: (label: string, index: number, items: { string }) -> (boolean, number)

A drop-down: index counts from 1, like a Luau list.

selectable

imgui.selectable: (label: string, selected: boolean?) -> boolean

progress_bar

imgui.progress_bar: (fraction: number, width: number?, height: number?, overlay: string?) -> ()

plot_lines

imgui.plot_lines: (label: string, values: { number }, min: number?, max: number?, height: number?) -> ()

same_line

imgui.same_line: () -> ()

separator

imgui.separator: () -> ()

spacing

imgui.spacing: () -> ()

indent

imgui.indent: (width: number?) -> ()

unindent

imgui.unindent: (width: number?) -> ()

dummy

imgui.dummy: (width: number, height: number) -> ()

set_next_item_width

imgui.set_next_item_width: (width: number) -> ()

content_region_avail

imgui.content_region_avail: () -> (number, number)

The room left in the window: width and height.

push_id

imgui.push_id: (id: string) -> ()

push_id_number

imgui.push_id_number: (id: number) -> ()

pop_id

imgui.pop_id: () -> ()

collapsing_header

imgui.collapsing_header: (label: string, openByDefault: boolean?) -> boolean

tree_node

imgui.tree_node: (label: string) -> boolean

A tree node; when it returns true, call tree_pop after its content.

tree_pop

imgui.tree_pop: () -> ()

begin_table

imgui.begin_table: (id: string, columns: number, flags: ({ ImGuiTableFlags } | {})?) -> boolean

A table; when it returns true, fill it and call end_table.

end_table

imgui.end_table: () -> ()

table_setup_column

imgui.table_setup_column: (label: string) -> ()

table_headers_row

imgui.table_headers_row: () -> ()

table_next_row

imgui.table_next_row: () -> ()

table_next_column

imgui.table_next_column: () -> boolean

begin_main_menu_bar

imgui.begin_main_menu_bar: () -> boolean

end_main_menu_bar

imgui.end_main_menu_bar: () -> ()

begin_menu

imgui.begin_menu: (label: string) -> boolean

end_menu

imgui.end_menu: () -> ()
imgui.menu_item: (label: string, shortcut: string?, selected: boolean?) -> boolean

begin_tab_bar

imgui.begin_tab_bar: (id: string) -> boolean

end_tab_bar

imgui.end_tab_bar: () -> ()

begin_tab_item

imgui.begin_tab_item: (label: string) -> boolean

end_tab_item

imgui.end_tab_item: () -> ()

open_popup

imgui.open_popup: (id: string) -> ()

begin_popup

imgui.begin_popup: (id: string) -> boolean

A popup opened with open_popup; when it returns true, fill it and call end_popup.

begin_popup_modal

imgui.begin_popup_modal: (title: string) -> boolean

end_popup

imgui.end_popup: () -> ()

close_current_popup

imgui.close_current_popup: () -> ()

set_tooltip

imgui.set_tooltip: (text: string) -> ()

is_item_hovered

imgui.is_item_hovered: () -> boolean

is_item_clicked

imgui.is_item_clicked: () -> boolean

want_capture_mouse

imgui.want_capture_mouse: () -> boolean

True while ImGui wants the mouse: the pointer is over a window, so the game should not also react to a click.

want_capture_keyboard

imgui.want_capture_keyboard: () -> boolean

display_size

imgui.display_size: () -> (number, number)

push_style_color

imgui.push_style_color: (color: ImGuiCol, value: { number }) -> ()

pop_style_color

imgui.pop_style_color: (count: number?) -> ()

push_style_var

imgui.push_style_var: (variable: ImGuiStyleVar, value: number) -> ()

pop_style_var

imgui.pop_style_var: (count: number?) -> ()

begin_disabled

imgui.begin_disabled: (disabled: boolean?) -> ()

end_disabled

imgui.end_disabled: () -> ()

show_demo_window

imgui.show_demo_window: () -> ()

Dear ImGui's own demo window: every widget there is, for a look at what is possible.