Skip to content

Latest commit

 

History

History
1770 lines (720 loc) · 88.9 KB

api_details.md

File metadata and controls

1770 lines (720 loc) · 88.9 KB

This file was automatically generated on Wed Feb 3 04:16:10 2021, UTC

ImGui

Supported methods (298)

No source comment. See imgui.h for more info.

NULL = destroy current context

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

access the Style structure (colors, sizes). Always use PushStyleCol(), PushStyleVar() to modify style mid-frame!

ends the Dear ImGui frame. automatically called by Render(). If you don't need to render data (skipping rendering) you may call EndFrame() without Render()... but you'll have wasted CPU already! If you don't need to render, better to not create any windows and not call NewFrame() at all!

ends the Dear ImGui frame, finalize the draw data. You can then get call GetDrawData().

create Demo window. demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application!

create Metrics/Debugger window. display Dear ImGui internals: windows, draw commands, various internal state, etc.

create About window. display Dear ImGui version, credits and build/system information.

add style editor block (not a window). you can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it uses the default style)

add style selector block (not a window), essentially a combo listing the default styles.

add font selector block (not a window), essentially a combo listing the loaded fonts.

add basic help/info block (not a window): how to manipulate ImGui as a end-user (mouse/keyboard controls).

get the compiled version string e.g. "1.80 WIP" (essentially the value for IMGUI_VERSION from the compiled version of imgui.cpp)

new, recommended style (default)

best used with borders and a custom, thicker font

classic imgui style

  • ImGui.Begin(name: string, p_open: boolean = nil, flags: ImGuiWindowFlags = 0) -> p_open: boolean, out: boolean

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

  • ImGui.BeginChild(id: number, size_x: number = 0, size_y: number = 0, border: boolean = false, flags: ImGuiWindowFlags = 0) -> out: boolean

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

is current window focused? or its root/child, depending on flags. see flags for options.

is current window hovered (and typically: not blocked by a popup/modal)? see flags for options. NB: If you are trying to check whether your mouse should be dispatched to imgui or to your app, you should use the 'io.WantCaptureMouse' boolean for that! Please read the FAQ!

get draw list associated to the current window, to append your own drawing primitives

get DPI scale currently associated to the current window's viewport.

get current window position in screen space (useful if you want to do your own drawing via the DrawList API)

get current window size

get current window width (shortcut for GetWindowSize().x)

get current window height (shortcut for GetWindowSize().y)

  • ImGui.SetNextWindowPos(pos_x: number, pos_y: number, cond: ImGuiCond = 0, pivot_x: number = 0, pivot_y: number = 0)

set next window position. call before Begin(). use pivot=(0.5f,0.5f) to center on given point, etc.

set next window size. set axis to 0.0f to force an auto-fit on this axis. call before Begin()

set next window content size (~ scrollable client area, which enforce the range of scrollbars). Not including window decorations (title bar, menu bar, etc.) nor WindowPadding. set an axis to 0.0f to leave it automatic. call before Begin()

set next window collapsed state. call before Begin()

set next window to be focused / top-most. call before Begin()

set next window background color alpha. helper to easily override the Alpha component of ImGuiCol_WindowBg/ChildBg/PopupBg. you may also use ImGuiWindowFlags_NoBackground.

set next window viewport

set font scale. Adjust IO.FontGlobalScale if you want to scale all windows. This is an old API! For correct scaling, prefer to reload font + rebuild ImFontAtlas + call style.ScaleAllSizes().

set named window position.

set named window size. set axis to 0.0f to force an auto-fit on this axis.

set named window collapsed state

set named window to be focused / top-most. use NULL to remove focus.

== GetContentRegionMax() - GetCursorPos()

current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates

content boundaries min (roughly (0,0)-Scroll), in window coordinates

content boundaries max (roughly (0,0)+Size-Scroll) where Size can be override with SetNextWindowContentSize(), in window coordinates

No source comment. See imgui.h for more info.

get scrolling amount [0 .. GetScrollMaxX()]

get scrolling amount [0 .. GetScrollMaxY()]

set scrolling amount [0 .. GetScrollMaxX()]

set scrolling amount [0 .. GetScrollMaxY()]

get maximum scrolling amount ~~ ContentSize.x - WindowSize.x - DecorationsSize.x

get maximum scrolling amount ~~ ContentSize.y - WindowSize.y - DecorationsSize.y

adjust scrolling amount to make current cursor position visible. center_x_ratio=0.0: left, 0.5: center, 1.0: right. When using to make a "default/current item" visible, consider using SetItemDefaultFocus() instead.

adjust scrolling amount to make current cursor position visible. center_y_ratio=0.0: top, 0.5: center, 1.0: bottom. When using to make a "default/current item" visible, consider using SetItemDefaultFocus() instead.

adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position.

adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position.

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

modify a style ImVec2 variable. always use this if you modify the style after NewFrame().

No source comment. See imgui.h for more info.

allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets

No source comment. See imgui.h for more info.

in 'repeat' mode, Button*() functions return repeated true in a typematic manner (using io.KeyRepeatDelay/io.KeyRepeatRate setting). Note that you can call IsItemActive() after any Button() to tell if the button is held in the current frame.

No source comment. See imgui.h for more info.

push width of items for common large "item+label" widgets. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -FLT_MIN always align width to the right side).

No source comment. See imgui.h for more info.

set width of the next common large "item+label" widget. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -FLT_MIN always align width to the right side)

width of item given pushed settings and current cursor position. NOT necessarily the width of last item unlike most 'Item' functions.

push word-wrapping position for Text*() commands. < 0.0f: no wrapping; 0.0f: wrap to end of window (or column); > 0.0f: wrap at 'wrap_pos_x' position in window local space

No source comment. See imgui.h for more info.

get current font size (= height in pixels) of current font with current scale applied

get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API

retrieve style color as stored in ImGuiStyle structure. use to feed back into PushStyleColor(), otherwise use GetColorU32() to get style color with style alpha baked in.

separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator.

  • ImGui.SameLine(offset_from_start_x: number = 0, spacing: number = -1)

call between widgets or groups to layout them horizontally. X position given in window coordinates.

undo a SameLine() or force a new line when in an horizontal-layout context.

add vertical spacing.

add a dummy item of given size. unlike InvisibleButton(), Dummy() won't take the mouse click or be navigable into.

move content position toward the right, by indent_w, or style.IndentSpacing if indent_w <= 0

move content position back to the left, by indent_w, or style.IndentSpacing if indent_w <= 0

lock horizontal starting position

unlock horizontal starting position + capture the whole group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.)

cursor position in window coordinates (relative to window position)

  • ImGui.GetCursorPosX() -> out: number

    (some functions are using window-relative coordinates, such as: GetCursorPos, GetCursorStartPos, GetContentRegionMax, GetWindowContentRegion* etc.

  • ImGui.GetCursorPosY() -> out: number

    other functions such as GetCursorScreenPos or everything in ImDrawList::

  • ImGui.SetCursorPos(local_pos_x: number, local_pos_y: number)

    are using the main, absolute coordinate system.

  • ImGui.SetCursorPosX(local_x: number)

    GetWindowPos() + GetCursorPos() == GetCursorScreenPos() etc.)

  • ImGui.SetCursorPosY(local_y: number)

No source comment. See imgui.h for more info.

initial cursor position in window coordinates

cursor position in absolute screen coordinates (0..io.DisplaySize) or natural OS coordinates when using multiple viewport. Useful to work with ImDrawList API.

cursor position in absolute screen coordinates (0..io.DisplaySize) or natural OS coordinates when using multiple viewport.

vertically align upcoming text baseline to FramePadding.y so that it will align properly to regularly framed items (call if you have text on a line before a framed item)

~ FontSize

~ FontSize + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of text)

~ FontSize + style.FramePadding.y * 2

~ FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets)

push integer into the ID stack (will hash integer).

pop from the ID stack.

  • ImGui.GetID(str_id_begin: string, str_id_end: string) -> out: number

No source comment. See imgui.h for more info.

raw text without formatting. Roughly equivalent to Text("%s", text) but: A) doesn't require null terminated string if 'text_end' is specified, B) it's faster, no memory copy is done, no buffer size limits, recommended for long chunks of text.

formatted text

  • ImGui.TextColored(col_x: number, col_y: number, col_z: number, col_w: number, fmt: string, ...)

shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor();

shortcut for PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_TextDisabled]); Text(fmt, ...); PopStyleColor();

shortcut for PushTextWrapPos(0.0f); Text(fmt, ...); PopTextWrapPos();. Note that this won't work on an auto-resizing window if there's no other widgets to extend the window width, yoy may need to set a size using SetNextWindowSize().

display text+label aligned the same way as value+label widgets

shortcut for Bullet()+Text()

  • ImGui.Button(label: string, size_x: number = 0, size_y: number = 0) -> out: boolean

button

button with FramePadding=(0,0) to easily embed within text

  • ImGui.InvisibleButton(str_id: string, size_x: number, size_y: number, flags: ImGuiButtonFlags = 0) -> out: boolean

flexible button behavior without the visuals, frequently useful to build custom behaviors using the public api (along with IsItemActive, IsItemHovered, etc.)

square button with an arrow shape

  • ImGui.Image(user_texture_id: Image, size_x: number, size_y: number, uv0_x: number = 0, uv0_y: number = 0, uv1_x: number = 1, uv1_y: number = 1, tint_col_x: number = 1, tint_col_y: number = 1, tint_col_z: number = 1, tint_col_w: number = 1, border_col_x: number = 0, border_col_y: number = 0, border_col_z: number = 0, border_col_w: number = 0)

No source comment. See imgui.h for more info.

  • ImGui.ImageButton(user_texture_id: Image, size_x: number, size_y: number, uv0_x: number = 0, uv0_y: number = 0, uv1_x: number = 1, uv1_y: number = 1, frame_padding: number = -1, bg_col_x: number = 0, bg_col_y: number = 0, bg_col_z: number = 0, bg_col_w: number = 0, tint_col_x: number = 1, tint_col_y: number = 1, tint_col_z: number = 1, tint_col_w: number = 1) -> out: boolean

<0 frame_padding uses default frame padding settings. 0 for no padding

  • ImGui.Checkbox(label: string, v: boolean) -> v: boolean, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.CheckboxFlags(label: string, flags: number, flags_value: number) -> flags: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.RadioButton(label: string, v: number, v_button: number) -> v: number, out: boolean

shortcut to handle the above pattern when value is an integer

  • ImGui.ProgressBar(fraction: number, size_arg_x: number = -FLT_MIN, size_arg_y: number = 0, overlay: string = nil)

No source comment. See imgui.h for more info.

draw a small circle + keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses

  • ImGui.BeginCombo(label: string, preview_value: string, flags: ImGuiComboFlags = 0) -> out: boolean

No source comment. See imgui.h for more info.

only call EndCombo() if BeginCombo() returns true!

  • ImGui.Combo(label: string, current_item: number, items_separated_by_zeros: string, popup_max_height_in_items: number = -1) -> current_item: number, out: boolean

Separate items with \0 within a string, end item-list with \0\0. e.g. "One\0Two\0Three\0"

  • ImGui.DragFloat(label: string, v: number, v_speed: number = 1, v_min: number = 0, v_max: number = 0, format: string = "%.3f", flags: ImGuiSliderFlags = 0) -> v: number, out: boolean

If v_min >= v_max we have no bound

  • ImGui.DragFloat2(label: string, v: table, v_speed: number = 1, v_min: number = 0, v_max: number = 0, format: string = "%.3f", flags: ImGuiSliderFlags = 0) -> v[0]: number, v[1]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.DragFloat3(label: string, v: table, v_speed: number = 1, v_min: number = 0, v_max: number = 0, format: string = "%.3f", flags: ImGuiSliderFlags = 0) -> v[0]: number, v[1]: number, v[2]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.DragFloat4(label: string, v: table, v_speed: number = 1, v_min: number = 0, v_max: number = 0, format: string = "%.3f", flags: ImGuiSliderFlags = 0) -> v[0]: number, v[1]: number, v[2]: number, v[3]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.DragFloatRange2(label: string, v_current_min: number, v_current_max: number, v_speed: number = 1, v_min: number = 0, v_max: number = 0, format: string = "%.3f", format_max: string = nil, flags: ImGuiSliderFlags = 0) -> v_current_min: number, v_current_max: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.DragInt(label: string, v: number, v_speed: number = 1, v_min: number = 0, v_max: number = 0, format: string = "%d", flags: ImGuiSliderFlags = 0) -> v: number, out: boolean

If v_min >= v_max we have no bound

  • ImGui.DragInt2(label: string, v: table, v_speed: number = 1, v_min: number = 0, v_max: number = 0, format: string = "%d", flags: ImGuiSliderFlags = 0) -> v[0]: number, v[1]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.DragInt3(label: string, v: table, v_speed: number = 1, v_min: number = 0, v_max: number = 0, format: string = "%d", flags: ImGuiSliderFlags = 0) -> v[0]: number, v[1]: number, v[2]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.DragInt4(label: string, v: table, v_speed: number = 1, v_min: number = 0, v_max: number = 0, format: string = "%d", flags: ImGuiSliderFlags = 0) -> v[0]: number, v[1]: number, v[2]: number, v[3]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.DragIntRange2(label: string, v_current_min: number, v_current_max: number, v_speed: number = 1, v_min: number = 0, v_max: number = 0, format: string = "%d", format_max: string = nil, flags: ImGuiSliderFlags = 0) -> v_current_min: number, v_current_max: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.SliderFloat(label: string, v: number, v_min: number, v_max: number, format: string = "%.3f", flags: ImGuiSliderFlags = 0) -> v: number, out: boolean

adjust format to decorate the value with a prefix or a suffix for in-slider labels or unit display.

  • ImGui.SliderFloat2(label: string, v: table, v_min: number, v_max: number, format: string = "%.3f", flags: ImGuiSliderFlags = 0) -> v[0]: number, v[1]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.SliderFloat3(label: string, v: table, v_min: number, v_max: number, format: string = "%.3f", flags: ImGuiSliderFlags = 0) -> v[0]: number, v[1]: number, v[2]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.SliderFloat4(label: string, v: table, v_min: number, v_max: number, format: string = "%.3f", flags: ImGuiSliderFlags = 0) -> v[0]: number, v[1]: number, v[2]: number, v[3]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.SliderAngle(label: string, v_rad: number, v_degrees_min: number = -360, v_degrees_max: number = 360, format: string = "%.0f deg", flags: ImGuiSliderFlags = 0) -> v_rad: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.SliderInt(label: string, v: number, v_min: number, v_max: number, format: string = "%d", flags: ImGuiSliderFlags = 0) -> v: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.SliderInt2(label: string, v: table, v_min: number, v_max: number, format: string = "%d", flags: ImGuiSliderFlags = 0) -> v[0]: number, v[1]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.SliderInt3(label: string, v: table, v_min: number, v_max: number, format: string = "%d", flags: ImGuiSliderFlags = 0) -> v[0]: number, v[1]: number, v[2]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.SliderInt4(label: string, v: table, v_min: number, v_max: number, format: string = "%d", flags: ImGuiSliderFlags = 0) -> v[0]: number, v[1]: number, v[2]: number, v[3]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.VSliderFloat(label: string, size_x: number, size_y: number, v: number, v_min: number, v_max: number, format: string = "%.3f", flags: ImGuiSliderFlags = 0) -> v: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.VSliderInt(label: string, size_x: number, size_y: number, v: number, v_min: number, v_max: number, format: string = "%d", flags: ImGuiSliderFlags = 0) -> v: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.InputFloat(label: string, v: number, step: number = 0, step_fast: number = 0, format: string = "%.3f", flags: ImGuiInputTextFlags = 0) -> v: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.InputFloat2(label: string, v: table, format: string = "%.3f", flags: ImGuiInputTextFlags = 0) -> v[0]: number, v[1]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.InputFloat3(label: string, v: table, format: string = "%.3f", flags: ImGuiInputTextFlags = 0) -> v[0]: number, v[1]: number, v[2]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.InputFloat4(label: string, v: table, format: string = "%.3f", flags: ImGuiInputTextFlags = 0) -> v[0]: number, v[1]: number, v[2]: number, v[3]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.InputInt(label: string, v: number, step: number = 1, step_fast: number = 100, flags: ImGuiInputTextFlags = 0) -> v: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.InputInt2(label: string, v: table, flags: ImGuiInputTextFlags = 0) -> v[0]: number, v[1]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.InputInt3(label: string, v: table, flags: ImGuiInputTextFlags = 0) -> v[0]: number, v[1]: number, v[2]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.InputInt4(label: string, v: table, flags: ImGuiInputTextFlags = 0) -> v[0]: number, v[1]: number, v[2]: number, v[3]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.InputDouble(label: string, v: number, step: number = 0, step_fast: number = 0, format: string = "%.6f", flags: ImGuiInputTextFlags = 0) -> v: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.ColorEdit3(label: string, col: table, flags: ImGuiColorEditFlags = 0) -> col[0]: number, col[1]: number, col[2]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.ColorEdit4(label: string, col: table, flags: ImGuiColorEditFlags = 0) -> col[0]: number, col[1]: number, col[2]: number, col[3]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.ColorPicker3(label: string, col: table, flags: ImGuiColorEditFlags = 0) -> col[0]: number, col[1]: number, col[2]: number, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.ColorButton(desc_id: string, col_x: number, col_y: number, col_z: number, col_w: number, flags: ImGuiColorEditFlags = 0, size_x: number = 0, size_y: number = 0) -> out: boolean

display a color square/button, hover for details, return true when pressed.

initialize current options (generally on application startup) if you want to select a default format, picker type, etc. User will be able to change many settings, unless you pass the _NoOptions flag to your calls.

helper variation to easily decorelate the id from the displayed string. Read the FAQ about why and how to use ID. to align arbitrary text at the same level as a TreeNode() you can use Bullet().

  • ImGui.TreeNodeEx(str_id: string, flags: ImGuiTreeNodeFlags, fmt: string, ...) -> out: boolean

No source comment. See imgui.h for more info.

~ Indent()+PushId(). Already called by TreeNode() when returning true, but you can call TreePush/TreePop yourself if desired.

~ Unindent()+PopId()

horizontal distance preceding label when using TreeNode*() or Bullet() == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode

  • ImGui.CollapsingHeader(label: string, p_visible: boolean, flags: ImGuiTreeNodeFlags = 0) -> p_visible: boolean, out: boolean

when 'p_visible != NULL': if '*p_visible==true' display an additional small close button on upper right of the header which will set the bool to false when clicked, if '*p_visible==false' don't display the header.

set next TreeNode/CollapsingHeader open state.

  • ImGui.Selectable(label: string, p_selected: boolean, flags: ImGuiSelectableFlags = 0, size_x: number = 0, size_y: number = 0) -> p_selected: boolean, out: boolean

"bool* p_selected" point to the selection state (read-write), as a convenient helper.

use if you want to reimplement ListBox() will custom data or interactions. if the function return true, you can output elements then call ListBoxFooter() afterwards.

"

terminate the scrolling region. only call ListBoxFooter() if ListBoxHeader() returned true!

  • ImGui.Value(prefix: string, v: number, float_format: string = nil)

No source comment. See imgui.h for more info.

append to menu-bar of current window (requires ImGuiWindowFlags_MenuBar flag set on parent window).

only call EndMenuBar() if BeginMenuBar() returns true!

create and append to a full screen menu-bar.

only call EndMainMenuBar() if BeginMainMenuBar() returns true!

create a sub-menu entry. only call EndMenu() if this returns true!

only call EndMenu() if BeginMenu() returns true!

  • ImGui.MenuItem(label: string, shortcut: string, p_selected: boolean, enabled: boolean = true) -> p_selected: boolean, out: boolean

return true when activated + toggle (*p_selected) if p_selected != NULL

begin/append a tooltip window. to create full-featured tooltip (with any kind of items).

No source comment. See imgui.h for more info.

set a text-only tooltip, typically use with ImGui::IsItemHovered(). override any previous call to SetTooltip().

return true if the popup is open, and you can start outputting to it.

  • ImGui.BeginPopupModal(name: string, p_open: boolean = nil, flags: ImGuiWindowFlags = 0) -> p_open: boolean, out: boolean

return true if the modal is open, and you can start outputting to it.

only call EndPopup() if BeginPopupXXX() returns true!

call to mark popup as open (don't call every frame!).

helper to open popup when clicked on last item. return true when just opened. (note: actually triggers on the mouse released event to be consistent with popup behaviors)

manually close the popup we have begin-ed into.

open+begin popup when clicked on last item. if you can pass a NULL str_id only if the previous item had an id. If you want to use that on a non-interactive item such as Text() you need to pass in an explicit ID here. read comments in .cpp!

open+begin popup when clicked on current window.

open+begin popup when clicked in void (where there are no windows).

return true if the popup is open.

  • ImGui.BeginTable(str_id: string, column: number, flags: ImGuiTableFlags = 0, outer_size_x: number = 0, outer_size_y: number = 0, inner_width: number = 0) -> out: boolean

No source comment. See imgui.h for more info.

only call EndTable() if BeginTable() returns true!

append into the first cell of a new row.

append into the next column (or first column of next row if currently in last column). Return true when column is visible.

append into the specified column. Return true when column is visible.

  • ImGui.TableSetupColumn(label: string, flags: ImGuiTableColumnFlags = 0, init_width_or_weight: number = 0, user_id: number = 0)

No source comment. See imgui.h for more info.

lock columns/rows so they stay visible when scrolled.

submit all headers cells based on data provided to TableSetupColumn() + submit context menu

submit one header cell manually (rarely used)

return number of columns (value passed to BeginTable)

return current column index.

return current row index.

return "" if column didn't have a name declared by TableSetupColumn(). Pass -1 to use current column.

change the color of a cell, row, or column. See ImGuiTableBgTarget_ flags for details.

  • ImGui.Columns(count: number = 1, id: string = nil, border: boolean = true)

No source comment. See imgui.h for more info.

next column, defaults to current row or next row if the current row is finished

get current column index

get column width (in pixels). pass -1 to use current column

set column width (in pixels). pass -1 to use current column

get position of column line (in pixels, from the left side of the contents region). pass -1 to use current column, otherwise 0..GetColumnsCount() inclusive. column 0 is typically 0.0f

set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column

No source comment. See imgui.h for more info.

create and append into a TabBar

only call EndTabBar() if BeginTabBar() returns true!

  • ImGui.BeginTabItem(label: string, p_open: boolean = nil, flags: ImGuiTabItemFlags = 0) -> p_open: boolean, out: boolean

create a Tab. Returns true if the Tab is selected.

only call EndTabItem() if BeginTabItem() returns true!

create a Tab behaving like a button. return true when clicked. cannot be selected in the tab bar.

notify TabBar or Docking system of a closed tab/window ahead (useful to reduce visual flicker on reorderable tab bars). For tab-bar: call after BeginTabBar() and before Tab submissions. Otherwise call with a window name.

  • ImGui.DockSpace(id: number, size_x: number = 0, size_y: number = 0, flags: ImGuiDockNodeFlags = 0)

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

set next window dock id (FIXME-DOCK)

No source comment. See imgui.h for more info.

is current window docked into another window?

start logging to tty (stdout)

start logging to file

start logging to OS clipboard

stop logging (close file, etc.)

helper to display buttons for logging to tty/file/clipboard

pass text data straight to log (without being displayed)

call when the current item is active. If this return true, you can call SetDragDropPayload() + EndDragDropSource()

only call EndDragDropSource() if BeginDragDropSource() returns true!

call after submitting an item that may receive a payload. If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget()

only call EndDragDropTarget() if BeginDragDropTarget() returns true!

  • ImGui.PushClipRect(clip_rect_min_x: number, clip_rect_min_y: number, clip_rect_max_x: number, clip_rect_max_y: number, intersect_with_current_clip_rect: boolean)

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

make last item the default focused item of a window.

focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget. Use -1 to access previous widget.

is the last item hovered? (and usable, aka not blocked by a popup, etc.). See ImGuiHoveredFlags for more options.

is the last item active? (e.g. button being held, text field being edited. This will continuously return true while holding mouse button on an item. Items that don't interact will always return false)

is the last item focused for keyboard/gamepad navigation?

is the last item clicked? (e.g. button/node just clicked on) == IsMouseClicked(mouse_button) && IsItemHovered()

is the last item visible? (items may be out of sight because of clipping/scrolling)

did the last item modify its underlying value this frame? or was pressed? This is generally the same as the "bool" return value of many widgets.

was the last item just made active (item was previously inactive).

was the last item just made inactive (item was previously active). Useful for Undo/Redo patterns with widgets that requires continuous editing.

was the last item just made inactive and made a value change when it was active? (e.g. Slider/Drag moved). Useful for Undo/Redo patterns with widgets that requires continuous editing. Note that you may get false positives (some widgets such as Combo()/ListBox()/Selectable() will return true even when clicking an already selected item).

was the last item open state toggled? set by TreeNode().

is any item hovered?

is any item active?

is any item focused?

get upper-left bounding rectangle of the last item (screen space)

get lower-right bounding rectangle of the last item (screen space)

get size of last item

allow last item to be overlapped by a subsequent item. sometimes useful with invisible buttons, selectables, etc. to catch unused area.

  • ImGui.IsRectVisible(rect_min_x: number, rect_min_y: number, rect_max_x: number, rect_max_y: number) -> out: boolean

test if rectangle (in screen space) is visible / not clipped. to perform coarse clipping on user's side.

get global imgui time. incremented by io.DeltaTime every frame.

get global imgui frame count. incremented by 1 every frame.

get background draw list for the viewport associated to the current window. this draw list will be the first rendering one. Useful to quickly draw shapes/text behind dear imgui contents.

get foreground draw list for the viewport associated to the current window. this draw list will be the last rendered one. Useful to quickly draw shapes/text over dear imgui contents.

get a string corresponding to the enum value (for display, saving, etc.).

  • ImGui.CalcListClipping(items_count: number, items_height: number, out_items_display_start: number, out_items_display_end: number) -> out_items_display_start: number, out_items_display_end: number

calculate coarse clipping for large list of evenly sized items. Prefer using the ImGuiListClipper higher-level helper if you can.

  • ImGui.BeginChildFrame(id: number, size_x: number, size_y: number, flags: ImGuiWindowFlags = 0) -> out: boolean

helper to create a child window / scrolling region that looks like a normal widget frame

always call EndChildFrame() regardless of BeginChildFrame() return values (which indicates a collapsed/clipped window)

  • ImGui.CalcTextSize(text: string, text_end: string = nil, hide_text_after_double_hash: boolean = false, wrap_width: number = -1) -> out_x: number, out_y: number

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

map ImGuiKey_* values into user's key index. == io.KeyMap[key]

is key being held. == io.KeysDown[user_key_index].

was key pressed (went from !Down to Down)? if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate

was key released (went from Down to !Down)?

uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate

attention: misleading name! manually override io.WantCaptureKeyboard flag next frame (said flag is entirely left for your application to handle). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard_value"; after the next NewFrame() call.

is mouse button held?

did mouse button clicked? (went from !Down to Down)

did mouse button released? (went from Down to !Down)

did mouse button double-clicked? (note that a double-click will also report IsMouseClicked() == true)

  • ImGui.IsMouseHoveringRect(r_min_x: number, r_min_y: number, r_max_x: number, r_max_y: number, clip: boolean = true) -> out: boolean

is mouse hovering given bounding rect (in screen space). clipped by current clipping settings, but disregarding of other consideration of focus/window ordering/popup-block.

by convention we use (-FLT_MAX,-FLT_MAX) to denote that there is no mouse available

is any mouse button held?

shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls

retrieve mouse position at the time of opening popup we have BeginPopup() into (helper to avoid user backing that value themselves)

is mouse dragging? (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold)

  • ImGui.GetMouseDragDelta(button: ImGuiMouseButton = 0, lock_threshold: number = -1) -> out_x: number, out_y: number

return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold)

No source comment. See imgui.h for more info.

get desired cursor type, reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you

set desired cursor type

attention: misleading name! manually override io.WantCaptureMouse flag next frame (said flag is entirely left for your application to handle). This is equivalent to setting "io.WantCaptureMouse = want_capture_mouse_value;" after the next NewFrame() call.

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

call after CreateContext() and before the first call to NewFrame(). NewFrame() automatically calls LoadIniSettingsFromDisk(io.IniFilename).

this is automatically called (if io.IniFilename is not empty) a few seconds after any modification that should be reflected in the .ini file (and also by DestroyContext).

call in main loop. will call CreateWindow/ResizeWindow/etc. platform functions for each secondary viewport, and DestroyWindow for each inactive viewport.

call DestroyWindow platform functions for all viewports. call from backend Shutdown() if you need to close platform windows before imgui shutdown. otherwise will be called by DestroyContext().

  • ImGui.InputText(label: string, str: string, flags: ImGuiInputTextFlags = 0, callback: function = nil) -> str: string, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.InputTextMultiline(label: string, str: string, size_x: number = 0, size_y: number = 0, flags: ImGuiInputTextFlags = 0, callback: function = nil) -> str: string, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.InputTextWithHint(label: string, hint: string, str: string, flags: ImGuiInputTextFlags = 0, callback: function = nil) -> str: string, out: boolean

No source comment. See imgui.h for more info.

  • ImGui.NewFrame()
  • ImGui.ColorPicker4(label, col1, col2, col3, col4, flags)

Unsupported methods (25)

accept contents of a given type. If ImGuiDragDropFlags_AcceptBeforeDelivery is set you can peek into the payload before the mouse button is released.

this is a helper for backends.

peek directly into the current payload from anywhere. may return NULL. use ImGuiPayload::IsDataType() to test for the payload type.

valid after Render() and until the next call to NewFrame(). this is what you have to render.

you may use this when creating your own ImDrawList instances.

get current font

access the IO structure (mouse/keyboard/gamepad inputs, time, various configuration options/flags)

main viewport. same as GetPlatformIO().MainViewport == GetPlatformIO().Viewports[0].

platform/renderer functions, for backend to setup + viewports list.

No source comment. See imgui.h for more info.

get viewport currently associated to the current window.

  • ImGui.ListBox(label, current_item, myfn, data, items_count, height_in_items = -1)
  • ImGui.LoadIniSettingsFromMemory(ini_data)
  • ImGui.PlotHistogram(label, myfn, data, values_count, values_offset = 0, overlay_text = NULL, scale_min = FLT_MAX, scale_max = FLT_MAX, graph_size = ImVec2(0, 0))
  • ImGui.PlotLines(label, myfn, data, values_count, values_offset = 0, overlay_text = NULL, scale_min = FLT_MAX, scale_max = FLT_MAX, graph_size = ImVec2(0, 0))
  • ImGui.PushFont(font)
  • ImGui.RenderPlatformWindowsDefault(platform_render_arg = NULL, renderer_render_arg = NULL)
  • ImGui.SaveIniSettingsToMemory(out_ini_size = NULL)
  • ImGui.SetDragDropPayload(type, data, cond = 0)
  • ImGui.SetNextWindowClass(window_class)
  • ImGui.SetNextWindowSizeConstraints(size_min, size_max, custom_callback = NULL, custom_callback_data = NULL)
  • ImGui.SetStateStorage(storage)
  • ImGui.TableGetColumnFlags(column_n: number = -1)

return column flags so you can query their Enabled/Visible/Sorted/Hovered status flags. Pass -1 to use current column.

get latest sort specs for the table (NULL if not sorting).

ImDrawList

Supported methods (39)

  • ImDrawList:PushClipRect(clip_rect_min_x: number, clip_rect_min_y: number, clip_rect_max_x: number, clip_rect_max_y: number, intersect_with_current_clip_rect: boolean = false)

Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling)

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

  • ImDrawList:AddLine(p1_x: number, p1_y: number, p2_x: number, p2_y: number, col: number, thickness: number = 1)

No source comment. See imgui.h for more info.

  • ImDrawList:AddRect(p_min_x: number, p_min_y: number, p_max_x: number, p_max_y: number, col: number, rounding: number = 0, rounding_corners: ImDrawCornerFlags = ImDrawCornerFlags_All, thickness: number = 1)

a: upper-left, b: lower-right (== upper-left + size), rounding_corners_flags: 4 bits corresponding to which corner to round

  • ImDrawList:AddRectFilled(p_min_x: number, p_min_y: number, p_max_x: number, p_max_y: number, col: number, rounding: number = 0, rounding_corners: ImDrawCornerFlags = ImDrawCornerFlags_All)

a: upper-left, b: lower-right (== upper-left + size)

  • ImDrawList:AddRectFilledMultiColor(p_min_x: number, p_min_y: number, p_max_x: number, p_max_y: number, col_upr_left: number, col_upr_right: number, col_bot_right: number, col_bot_left: number)

No source comment. See imgui.h for more info.

  • ImDrawList:AddQuad(p1_x: number, p1_y: number, p2_x: number, p2_y: number, p3_x: number, p3_y: number, p4_x: number, p4_y: number, col: number, thickness: number = 1)

No source comment. See imgui.h for more info.

  • ImDrawList:AddQuadFilled(p1_x: number, p1_y: number, p2_x: number, p2_y: number, p3_x: number, p3_y: number, p4_x: number, p4_y: number, col: number)

No source comment. See imgui.h for more info.

  • ImDrawList:AddTriangle(p1_x: number, p1_y: number, p2_x: number, p2_y: number, p3_x: number, p3_y: number, col: number, thickness: number = 1)

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

  • ImDrawList:AddCircle(center_x: number, center_y: number, radius: number, col: number, num_segments: number = 0, thickness: number = 1)

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

  • ImDrawList:AddNgon(center_x: number, center_y: number, radius: number, col: number, num_segments: number, thickness: number = 1)

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

  • ImDrawList:AddText(pos_x: number, pos_y: number, col: number, text_begin: string, text_end: string = nil)

No source comment. See imgui.h for more info.

  • ImDrawList:AddBezierCubic(p1_x: number, p1_y: number, p2_x: number, p2_y: number, p3_x: number, p3_y: number, p4_x: number, p4_y: number, col: number, thickness: number, num_segments: number = 0)

Cubic Bezier (4 control points)

  • ImDrawList:AddBezierQuadratic(p1_x: number, p1_y: number, p2_x: number, p2_y: number, p3_x: number, p3_y: number, col: number, thickness: number, num_segments: number = 0)

Quadratic Bezier (3 control points)

  • ImDrawList:AddImage(user_texture_id: Image, p_min_x: number, p_min_y: number, p_max_x: number, p_max_y: number, uv_min_x: number = 0, uv_min_y: number = 0, uv_max_x: number = 1, uv_max_y: number = 1, col: number = IM_COL32_WHITE)

No source comment. See imgui.h for more info.

  • ImDrawList:AddImageQuad(user_texture_id: Image, p1_x: number, p1_y: number, p2_x: number, p2_y: number, p3_x: number, p3_y: number, p4_x: number, p4_y: number, uv1_x: number = 0, uv1_y: number = 0, uv2_x: number = 1, uv2_y: number = 0, uv3_x: number = 1, uv3_y: number = 1, uv4_x: number = 0, uv4_y: number = 1, col: number = IM_COL32_WHITE)

No source comment. See imgui.h for more info.

  • ImDrawList:AddImageRounded(user_texture_id: Image, p_min_x: number, p_min_y: number, p_max_x: number, p_max_y: number, uv_min_x: number, uv_min_y: number, uv_max_x: number, uv_max_y: number, col: number, rounding: number, rounding_corners: ImDrawCornerFlags = ImDrawCornerFlags_All)

No source comment. See imgui.h for more info.

  • ImDrawList:PathArcTo(center_x: number, center_y: number, radius: number, a_min: number, a_max: number, num_segments: number = 10)

No source comment. See imgui.h for more info.

  • ImDrawList:PathArcToFast(center_x: number, center_y: number, radius: number, a_min_of_12: number, a_max_of_12: number)

Use precomputed angles for a 12 steps circle

Cubic Bezier (4 control points)

Quadratic Bezier (3 control points)

  • ImDrawList:PathRect(rect_min_x: number, rect_min_y: number, rect_max_x: number, rect_max_y: number, rounding: number = 0, rounding_corners: ImDrawCornerFlags = ImDrawCornerFlags_All)

No source comment. See imgui.h for more info.

This is useful if you need to forcefully create a new draw call (to allow for dependent rendering / blending). Otherwise primitives are merged into the same draw-call as much as possible

Create a clone of the CmdBuffer/IdxBuffer/VtxBuffer.

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

Axis aligned rectangle (composed of two triangles)

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

No source comment. See imgui.h for more info.

Unsupported methods (3)

  • ImGui.AddCallback(callback, callback_data)
  • ImGui.AddConvexPolyFilled(points, num_points, col)
  • ImGui.AddPolyline(points, num_points, col, closed, thickness)