IMGUI Lua API Reference
Constants are accessed via imgui.constant.<Group>.<Name>.
Functions are called directly as imgui.<FunctionName>(...).
Constants
WindowFlags
| Flag | Description |
|---|---|
NoTitleBar |
Disable title-bar |
NoResize |
Disable user resizing with the lower-right grip |
NoMove |
Disable user moving the window |
NoScrollbar |
Disable scrollbars (window can still scroll with mouse or programmatically) |
NoScrollWithMouse |
Disable user vertically scrolling with mouse wheel. On child window, mouse wheel will be forwarded to the parent unless NoScrollbar is also set. |
NoCollapse |
Disable user collapsing window by double-clicking on it |
AlwaysAutoResize |
Resize every window to its content every frame |
NoSavedSettings |
Never load/save settings in .ini file |
NoInputs |
Disable catching mouse or keyboard inputs, hovering test with pass through |
MenuBar |
Has a menu-bar |
HorizontalScrollbar |
Allow horizontal scrollbar to appear (off by default). You may use SetNextWindowContentSize(ImVec2(width,0.0f)) prior to calling Begin() to specify width. |
NoFocusOnAppearing |
Disable taking focus when transitioning from hidden to visible state |
NoBringToFrontOnFocus |
Disable bringing window to front when taking focus (e.g. clicking on it or programmatically giving it focus) |
AlwaysVerticalScrollbar |
Always show vertical scrollbar (even if ContentSize.y < Size.y) |
AlwaysHorizontalScrollbar |
Always show horizontal scrollbar (even if ContentSize.x < Size.x) |
AlwaysUseWindowPadding |
Ensure child windows without border uses style.WindowPadding (ignored by default for non-bordered child windows, because more convenient) |
ResizeFromAnySide |
[BETA] Enable resize from any corners and borders. Your back-end needs to honor the different values of io.MouseCursor set by imgui. |
NoNavInputs |
No gamepad/keyboard navigation within the window |
NoNavFocus |
No focusing toward this window with gamepad/keyboard navigation (e.g. skipped by CTRL+TAB) |
NoNav |
Combination of NoNavInputs and NoNavFocus |
NavFlattened |
[BETA] Allow gamepad/keyboard navigation to cross over parent border to this child (only use on child that have no scrolling!) |
ChildWindow |
For internal use by BeginChild() |
Tooltip |
For internal use by BeginTooltip() |
Popup |
For internal use by BeginPopup() |
Modal |
For internal use by BeginPopupModal() |
ChildMenu |
For internal use by BeginMenu() |
InputTextFlags
| Flag | Description |
|---|---|
CharsDecimal |
Allow 0123456789.+-*/ |
CharsHexadecimal |
Allow 0123456789ABCDEFabcdef |
CharsUppercase |
Turn a..z into A..Z |
CharsNoBlank |
Filter out spaces, tabs |
AutoSelectAll |
Select entire text when first taking mouse focus |
EnterReturnsTrue |
Return 'true' when Enter is pressed (as opposed to when the value was modified) |
CallbackCompletion |
Call user function on pressing TAB (for completion handling) |
CallbackHistory |
Call user function on pressing Up/Down arrows (for history handling) |
CallbackAlways |
Call user function every time. User code may query cursor position, modify text buffer. |
CallbackCharFilter |
Call user function to filter character. Modify data->EventChar to replace/filter input, or return 1 to discard character. |
AllowTabInput |
Pressing TAB inputs a '\t' character into the text field |
CtrlEnterForNewLine |
In multi-line mode, unfocus with Enter, add new line with Ctrl+Enter (default is opposite: unfocus with Ctrl+Enter, add line with Enter) |
NoHorizontalScroll |
Disable following the cursor horizontally |
AlwaysInsertMode |
Insert mode |
ReadOnly |
Read-only mode |
Password |
Password mode, display all characters as '*' |
NoUndoRedo |
Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID(). |
CharsScientific |
Allow 0123456789.+-*/eE (Scientific notation input) |
Multiline |
For internal use by InputTextMultiline() |
TreeNodeFlags
| Flag | Description |
|---|---|
Selected |
Draw as selected |
Framed |
Full colored frame (e.g. for CollapsingHeader) |
AllowItemOverlap |
Hit testing to allow subsequent widgets to overlap this one |
NoTreePushOnOpen |
Don't do a TreePush() when open (e.g. for CollapsingHeader) — no extra indent nor pushing on ID stack |
NoAutoOpenOnLog |
Don't automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes) |
DefaultOpen |
Default node to be open |
OpenOnDoubleClick |
Need double-click to open node |
OpenOnArrow |
Only open when clicking on the arrow part. If OpenOnDoubleClick is also set, single-click arrow or double-click all box to open. |
Leaf |
No collapsing, no arrow (use as a convenience for leaf nodes) |
Bullet |
Display a bullet instead of arrow |
FramePadding |
Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding(). |
NavLeftJumpsBackHere |
(WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop) |
CollapsingHeader |
Combination of Framed and NoAutoOpenOnLog |
SelectableFlags
| Flag | Description |
|---|---|
DontClosePopups |
Clicking this don't close parent popup window |
SpanAllColumns |
Selectable frame can span all columns (text will still fit in current column) |
AllowDoubleClick |
Generate press events on double clicks too |
ComboFlags
| Flag | Description |
|---|---|
PopupAlignLeft |
Align the popup toward the left by default |
HeightSmall |
Max ~4 items visible. Tip: If you want your combo popup to be a specific size you can use SetNextWindowSizeConstraints() prior to calling BeginCombo() |
HeightRegular |
Max ~8 items visible (default) |
HeightLarge |
Max ~20 items visible |
HeightLargest |
As many fitting items as possible |
NoArrowButton |
Display on the preview box without the square arrow button |
NoPreview |
Display only a square arrow button |
FocusedFlags
| Flag | Description |
|---|---|
ChildWindows |
IsWindowFocused(): Return true if any children of the window is focused |
RootWindow |
IsWindowFocused(): Test from root window (top most parent of the current hierarchy) |
AnyWindow |
IsWindowFocused(): Return true if any window is focused |
RootAndChildWindows |
Combination of RootWindow and ChildWindows |
HoveredFlags
| Flag | Description |
|---|---|
Default |
Return true if directly over the item/window, not obstructed by another window, not obstructed by an active popup or modal blocking inputs under them |
ChildWindows |
IsWindowHovered() only: Return true if any children of the window is hovered |
RootWindow |
IsWindowHovered() only: Test from root window (top most parent of the current hierarchy) |
AnyWindow |
IsWindowHovered() only: Return true if any window is hovered |
AllowWhenBlockedByPopup |
Return true even if a popup window is normally blocking access to this item/window |
AllowWhenBlockedByActiveItem |
Return true even if an active item is blocking access to this item/window. Useful for Drag and Drop patterns. |
AllowWhenOverlapped |
Return true even if the position is overlapped by another window |
RectOnly |
Combination of AllowWhenBlockedByPopup, AllowWhenBlockedByActiveItem, and AllowWhenOverlapped |
RootAndChildWindows |
Combination of RootWindow and ChildWindows |
DragDropFlags
| Flag | Description |
|---|---|
SourceNoPreviewTooltip |
By default, a successful call to BeginDragDropSource opens a tooltip so you can display a preview or description of the source contents. This flag disables this behavior. |
SourceNoDisableHover |
By default, when dragging we clear data so that IsItemHovered() will return true, to avoid subsequent user code submitting tooltips. This flag disables this behavior so you can still call IsItemHovered() on the source item. |
SourceNoHoldToOpenOthers |
Disable the behavior that allows to open tree nodes and collapsing headers by holding over them while dragging a source item. |
SourceAllowNullID |
Allow items such as Text(), Image() that have no unique identifier to be used as drag source, by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear imgui ecosystem and so we made it explicit. |
SourceExtern |
External source (from outside of imgui), won't attempt to read current item/window info. Will always return true. Only one Extern source can be active simultaneously. |
AcceptBeforeDelivery |
AcceptDragDropPayload() will return true even before the mouse button is released. You can then call IsDelivery() to test if the payload needs to be delivered. |
AcceptNoDrawDefaultRect |
Do not draw the default highlight rectangle when hovering over target. |
AcceptPeekOnly |
Combination of AcceptBeforeDelivery and AcceptNoDrawDefaultRect. For peeking ahead and inspecting the payload before delivery. |
Dir
| Value | Description |
|---|---|
None |
-1 |
Left |
0 |
Right |
1 |
Up |
2 |
Down |
3 |
COUNT |
Key
Tab LeftArrow RightArrow UpArrow DownArrow PageUp PageDown Home End Insert Delete Backspace Space Enter Escape A C V X Y Z COUNT
Note:
AthroughZare used for text-edit shortcuts — CTRL+A: select all, CTRL+C: copy, CTRL+V: paste, CTRL+X: cut, CTRL+Y: redo, CTRL+Z: undo.
NavInput
Activate Cancel Input Menu DpadLeft DpadRight DpadUp DpadDown LStickLeft LStickRight LStickUp LStickDown FocusPrev FocusNext TweakSlow TweakFast COUNT
ConfigFlags
| Flag | Description |
|---|---|
NavEnableKeyboard |
Master keyboard navigation enable flag. NewFrame() will automatically fill io.NavInputs[] based on io.KeysDown[]. |
NavEnableGamepad |
Master gamepad navigation enable flag. This is mostly to instruct your imgui back-end to fill io.NavInputs[]. Back-end also needs to set BackendFlags.HasGamepad. |
NavEnableSetMousePos |
Instruct navigation to move the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is awkward. Will update io.MousePos and set io.WantSetMousePos=true. If enabled you MUST honor io.WantSetMousePos requests in your binding, otherwise ImGui will react as if the mouse is jumping around back and forth. |
NavNoCaptureKeyboard |
Instruct navigation to not set the io.WantCaptureKeyboard flag when io.NavActive is set. |
NoMouse |
Instruct imgui to clear mouse position/buttons in NewFrame(). This allows ignoring the mouse information back-end. |
NoMouseCursorChange |
Instruct back-end to not alter mouse cursor shape and visibility. |
IsSRGB |
Application is SRGB-aware. |
IsTouchScreen |
Application is using a touch screen instead of a mouse. |
BackendFlags
| Flag | Description |
|---|---|
HasGamepad |
Back-end supports and has a connected gamepad. |
HasMouseCursors |
Back-end supports reading GetMouseCursor() to change the OS cursor shape. |
HasSetMousePos |
Back-end supports io.WantSetMousePos requests to reposition the OS mouse position (only used if ConfigFlags.NavEnableSetMousePos is set). |
Col
Text TextDisabled WindowBg ChildBg PopupBg Border BorderShadow FrameBg FrameBgHovered FrameBgActive TitleBg TitleBgActive TitleBgCollapsed MenuBarBg ScrollbarBg ScrollbarGrab ScrollbarGrabHovered ScrollbarGrabActive CheckMark SliderGrab SliderGrabActive Button ButtonHovered ButtonActive Header HeaderHovered HeaderActive Separator SeparatorHovered SeparatorActive ResizeGrip ResizeGripHovered ResizeGripActive PlotLines PlotLinesHovered PlotHistogram PlotHistogramHovered TextSelectedBg ModalWindowDarkening DragDropTarget NavHighlight NavWindowingHighlight COUNT
StyleVar
| Var | Type |
|---|---|
Alpha |
float |
WindowPadding |
ImVec2 |
WindowRounding |
float |
WindowBorderSize |
float |
WindowMinSize |
ImVec2 |
WindowTitleAlign |
ImVec2 |
ChildRounding |
float |
ChildBorderSize |
float |
PopupRounding |
float |
PopupBorderSize |
float |
FramePadding |
ImVec2 |
FrameRounding |
float |
FrameBorderSize |
float |
ItemSpacing |
ImVec2 |
ItemInnerSpacing |
ImVec2 |
IndentSpacing |
float |
ScrollbarSize |
float |
ScrollbarRounding |
float |
GrabMinSize |
float |
GrabRounding |
float |
ButtonTextAlign |
ImVec2 |
COUNT |
ColorEditFlags
Display Options
| Flag | Description |
|---|---|
NoAlpha |
ColorEdit, ColorPicker, ColorButton: ignore Alpha component (read 3 components from the input pointer) |
NoPicker |
ColorEdit: disable picker when clicking on colored square |
NoOptions |
ColorEdit: disable toggling options menu when right-clicking on inputs/small preview |
NoSmallPreview |
ColorEdit, ColorPicker: disable colored square preview next to the inputs (e.g. to show only the inputs) |
NoInputs |
ColorEdit, ColorPicker: disable inputs sliders/text widgets (e.g. to show only the small preview colored square) |
NoTooltip |
ColorEdit, ColorPicker, ColorButton: disable tooltip when hovering the preview |
NoLabel |
ColorEdit, ColorPicker: disable display of inline text label (the label is still forwarded to the tooltip and picker) |
NoSidePreview |
ColorPicker: disable bigger color preview on right side of the picker, use small colored square preview instead |
AlphaBar |
ColorEdit, ColorPicker: show vertical alpha bar/gradient in picker |
AlphaPreview |
ColorEdit, ColorPicker, ColorButton: display preview as a transparent color over a checkerboard, instead of opaque |
AlphaPreviewHalf |
ColorEdit, ColorPicker, ColorButton: display half opaque / half checkerboard, instead of opaque |
HDR |
(WIP) ColorEdit: currently only disables 0.0f..1.0f limits in RGBA edition (note: you probably want to use the Float flag as well) |
Input Format
| Flag | Description |
|---|---|
RGB |
ColorEdit: choose one among RGB/HSV/HEX. ColorPicker: choose any combination using RGB/HSV/HEX. |
HSV |
ColorEdit: choose one among RGB/HSV/HEX. ColorPicker: choose any combination using RGB/HSV/HEX. |
HEX |
ColorEdit: choose one among RGB/HSV/HEX. ColorPicker: choose any combination using RGB/HSV/HEX. |
Data Type
| Flag | Description |
|---|---|
Uint8 |
ColorEdit, ColorPicker, ColorButton: display values formatted as 0..255 |
Float |
ColorEdit, ColorPicker, ColorButton: display values formatted as 0.0f..1.0f floats instead of 0..255 integers. No round-trip of value via integers. |
Picker Mode
| Flag | Description |
|---|---|
PickerHueBar |
ColorPicker: bar for Hue, rectangle for Sat/Value |
PickerHueWheel |
ColorPicker: wheel for Hue, triangle for Sat/Value |
MouseCursor
None Arrow TextInput ResizeAll ResizeNS ResizeEW ResizeNESW ResizeNWSE COUNT
Cond
| Value | Description |
|---|---|
Always |
Set the variable |
Once |
Set the variable once per runtime session (only the first call will succeed) |
FirstUseEver |
Set the variable if the object/window has no persistently saved data (no entry in .ini file) |
Appearing |
Set the variable if the object/window is appearing after being hidden/inactive (or the first time) |
Draw List
Render-level drawing operations. Prefer using higher-level imgui.PushClipRect() for logic; use DrawList for custom low-level rendering.
| Function | Description |
|---|---|
imgui.DrawList_PushClipRect(ImVec2 clip_rect_min, ImVec2 clip_rect_max, bool intersect_with_current_clip_rect = false) |
Render-level scissoring. Passed down to your render function but not used for CPU-side coarse clipping. |
imgui.DrawList_PushClipRectFullScreen() |
|
imgui.DrawList_PopClipRect() |
|
imgui.DrawList_PushTextureID(ImTextureID texture_id) |
|
imgui.DrawList_PopTextureID() |
|
imgui.DrawList_AddLine(const ImVec2& a, const ImVec2& b, ImU32 col, float thickness = 1.0f) |
|
imgui.DrawList_AddRect(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners_flags = ImDrawCornerFlags_All, float thickness = 1.0f) |
a: upper-left, b: lower-right. rounding_corners_flags: 4-bits corresponding to which corner to round. |
imgui.DrawList_AddRectFilled(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners_flags = ImDrawCornerFlags_All) |
a: upper-left, b: lower-right |
imgui.DrawList_AddRectFilledMultiColor(const ImVec2& a, const ImVec2& b, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left) |
|
imgui.DrawList_AddQuad(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, ImU32 col, float thickness = 1.0f) |
|
imgui.DrawList_AddQuadFilled(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, ImU32 col) |
|
imgui.DrawList_AddTriangle(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col, float thickness = 1.0f) |
|
imgui.DrawList_AddTriangleFilled(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col) |
|
imgui.DrawList_AddCircle(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12, float thickness = 1.0f) |
|
imgui.DrawList_AddCircleFilled(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12) |
|
imgui.DrawList_AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL) |
|
imgui.DrawList_AddText(const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f, const ImVec4* cpu_fine_clip_rect = NULL) |
|
imgui.DrawList_AddImage(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a = ImVec2 0 0, const ImVec2& uv_b = ImVec2 1 1, ImU32 col = 0xFFFFFFFF) |
|
imgui.DrawList_AddImageQuad(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a = ImVec2 0 0, const ImVec2& uv_b = ImVec2 1 0, const ImVec2& uv_c = ImVec2 1 1, const ImVec2& uv_d = ImVec2 0 1, ImU32 col = 0xFFFFFFFF) |
|
imgui.DrawList_AddImageRounded(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col, float rounding, int rounding_corners = ImDrawCornerFlags_All) |
|
imgui.DrawList_AddPolyline(const ImVec2* points, const int num_points, ImU32 col, bool closed, float thickness) |
|
imgui.DrawList_AddConvexPolyFilled(const ImVec2* points, const int num_points, ImU32 col) |
|
imgui.DrawList_AddBezierCurve(const ImVec2& pos0, const ImVec2& cp0, const ImVec2& cp1, const ImVec2& pos1, ImU32 col, float thickness, int num_segments = 0) |
|
imgui.DrawList_PathArcTo(const ImVec2& centre, float radius, float a_min, float a_max, int num_segments = 10) |
|
imgui.DrawList_PathArcToFast(const ImVec2& centre, float radius, int a_min_of_12, int a_max_of_12) |
Use precomputed angles for a 12-step circle |
imgui.DrawList_PathBezierCurveTo(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, int num_segments = 0) |
|
imgui.DrawList_PathRect(const ImVec2& rect_min, const ImVec2& rect_max, float rounding = 0.0f, int rounding_corners_flags = ImDrawCornerFlags_All) |
|
imgui.DrawList_ChannelsSplit(int channels_count) |
|
imgui.DrawList_ChannelsMerge() |
|
imgui.DrawList_ChannelsSetCurrent(int channel_index) |
|
imgui.DrawList_AddCallback(ImDrawCallback callback, void* callback_data) |
Your rendering function must check for 'UserCallback' in ImDrawCmd and call the function instead of rendering triangles. |
imgui.DrawList_AddDrawCmd() |
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. |
imgui.DrawList_Clear() |
|
imgui.DrawList_ClearFreeMemory() |
|
imgui.DrawList_PrimReserve(int idx_count, int vtx_count) |
|
imgui.DrawList_PrimRect(const ImVec2& a, const ImVec2& b, ImU32 col) |
Axis aligned rectangle (composed of two triangles) |
imgui.DrawList_PrimRectUV(const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col) |
|
imgui.DrawList_PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a, const ImVec2& uv_b, const ImVec2& uv_c, const ImVec2& uv_d, ImU32 col) |
|
imgui.DrawList_UpdateClipRect() |
|
imgui.DrawList_UpdateTextureID() |
Functions
Demo and Debug
| Function | Description |
|---|---|
imgui.ShowDemoWindow(bool* p_open = NULL) |
Create demo/test window. Demonstrates most ImGui features. Call this to learn about the library! Try to make it always available in your application! |
imgui.ShowMetricsWindow(bool* p_open = NULL) |
Create metrics window. Displays ImGui internals: draw commands (with individual draw calls and vertices), window list, basic internal state, etc. |
imgui.ShowStyleSelector(const char* label) |
Add style selector block (not a window), essentially a combo listing the default styles. |
imgui.ShowFontSelector(const char* label) |
Add font selector block (not a window), essentially a combo listing the loaded fonts. |
imgui.ShowUserGuide() |
Add basic help/info block (not a window): how to manipulate ImGui as an end-user (mouse/keyboard controls). |
imgui.GetVersion() |
Get a version string e.g. "1.23" |
Window Management
| Function | Description |
|---|---|
imgui.Begin(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0) |
|
imgui.End() |
|
imgui.BeginChild(const char* str_id, const ImVec2& size = ImVec2 0 0, bool border = false, ImGuiWindowFlags flags = 0) |
Begin a scrolling region. size==0.0f: use remaining window size, size<0.0f: use remaining window size minus abs(size), size>0.0f: fixed size. Each axis can use a different mode, e.g. ImVec2 0 400. |
imgui.BeginChild(ImGuiID id, const ImVec2& size = ImVec2 0 0, bool border = false, ImGuiWindowFlags flags = 0) |
|
imgui.EndChild() |
|
imgui.IsWindowAppearing() |
|
imgui.IsWindowCollapsed() |
Window Properties
| Function | Description |
|---|---|
imgui.GetWindowPos() |
Get current window position in screen space (useful if you want to do your own drawing via the DrawList API) |
imgui.GetWindowSize() |
Get current window size |
imgui.GetWindowWidth() |
Get current window width (shortcut for GetWindowSize().x) |
imgui.GetWindowHeight() |
Get current window height (shortcut for GetWindowSize().y) |
imgui.GetContentRegionMax() |
Current content boundaries (typically window boundaries including scrolling, or current column boundaries), in window coordinates |
imgui.GetContentRegionAvail() |
== GetContentRegionMax() - GetCursorPos() |
imgui.GetContentRegionAvailWidth() |
|
imgui.GetWindowContentRegionMin() |
Content boundaries min (roughly (0,0)-Scroll), in window coordinates |
imgui.GetWindowContentRegionMax() |
Content boundaries max (roughly (0,0)+Size-Scroll) where Size can be overridden with SetNextWindowContentSize(), in window coordinates |
imgui.GetWindowContentRegionWidth() |
|
imgui.SetNextWindowPos(const ImVec2& pos, ImGuiCond cond = 0, const ImVec2& pivot = ImVec2 0 0) |
Set next window position. Call before Begin(). Use pivot=(0.5f,0.5f) to center on given point, etc. |
imgui.SetNextWindowSize(const ImVec2& size, ImGuiCond cond = 0) |
Set next window size. Set axis to 0.0f to force an auto-fit on this axis. Call before Begin(). |
imgui.SetNextWindowContentSize(const ImVec2& size) |
Set next window content size (enforces the range of scrollbars). Not including window decorations (title bar, menu bar, etc.). Set an axis to 0.0f to leave it automatic. Call before Begin(). |
imgui.SetNextWindowCollapsed(bool collapsed, ImGuiCond cond = 0) |
Set next window collapsed state. Call before Begin(). |
imgui.SetNextWindowFocus() |
Set next window to be focused / front-most. Call before Begin(). |
imgui.SetNextWindowBgAlpha(float alpha) |
Set next window background color alpha. Helper to easily modify ImGuiCol_WindowBg/ChildBg/PopupBg. |
imgui.SetWindowPos(const ImVec2& pos, ImGuiCond cond = 0) |
(Not recommended) Set current window position — call within Begin()/End(). Prefer using SetNextWindowPos(), as this may incur tearing and side-effects. |
imgui.SetWindowSize(const ImVec2& size, ImGuiCond cond = 0) |
(Not recommended) Set current window size — call within Begin()/End(). Set to ImVec2 0 0 to force an auto-fit. Prefer using SetNextWindowSize(), as this may incur tearing and minor side-effects. |
imgui.SetWindowCollapsed(bool collapsed, ImGuiCond cond = 0) |
(Not recommended) Set current window collapsed state. Prefer using SetNextWindowCollapsed(). |
imgui.SetWindowFocus() |
(Not recommended) Set current window to be focused / front-most. Prefer using SetNextWindowFocus(). |
imgui.SetWindowFontScale(float scale) |
Set font scale. Adjust IO.FontGlobalScale if you want to scale all windows. |
imgui.SetWindowPos(const char* name, const ImVec2& pos, ImGuiCond cond = 0) |
Set named window position. |
imgui.SetWindowSize(const char* name, const ImVec2& size, ImGuiCond cond = 0) |
Set named window size. Set axis to 0.0f to force an auto-fit on this axis. |
imgui.SetWindowCollapsed(const char* name, bool collapsed, ImGuiCond cond = 0) |
Set named window collapsed state. |
imgui.SetWindowFocus(const char* name) |
Set named window to be focused / front-most. Use NULL to remove focus. |
Scrolling
| Function | Description |
|---|---|
imgui.GetScrollX() |
Get scrolling amount [0..GetScrollMaxX()] |
imgui.GetScrollY() |
Get scrolling amount [0..GetScrollMaxY()] |
imgui.GetScrollMaxX() |
Get maximum scrolling amount ~~ ContentSize.X - WindowSize.X |
imgui.GetScrollMaxY() |
Get maximum scrolling amount ~~ ContentSize.Y - WindowSize.Y |
imgui.SetScrollX(float scroll_x) |
Set scrolling amount [0..GetScrollMaxX()] |
imgui.SetScrollY(float scroll_y) |
Set scrolling amount [0..GetScrollMaxY()] |
imgui.SetScrollHere(float center_y_ratio = 0.5f) |
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. |
imgui.SetScrollFromPosY(float pos_y, float center_y_ratio = 0.5f) |
Adjust scrolling amount to make given position valid. Use GetCursorPos() or GetCursorStartPos()+offset to get valid positions. |
Fonts and Style
| Function | Description |
|---|---|
imgui.PushFont(ImFont* font) |
Use NULL as a shortcut to push default font (unsupported!!) |
imgui.PopFont() |
|
imgui.PushStyleColor(ImGuiCol idx, ImU32 col) |
|
imgui.PushStyleColor(ImGuiCol idx, const ImVec4& col) |
|
imgui.PopStyleColor(int count = 1) |
|
imgui.PushStyleVar(ImGuiStyleVar idx, float val) |
|
imgui.PushStyleVar(ImGuiStyleVar idx, const ImVec2& val) |
|
imgui.PopStyleVar(int count = 1) |
|
imgui.GetFontSize() |
Get current font size (= height in pixels) of current font with current scale applied |
imgui.GetFontTexUvWhitePixel() |
Get UV coordinate for a white pixel, useful to draw custom shapes via the ImDrawList API |
imgui.GetColorU32(ImGuiCol idx, float alpha_mul = 1.0f) |
Retrieve given style color with style alpha applied and optional extra alpha multiplier |
imgui.GetColorU32(const ImVec4& col) |
Retrieve given color with style alpha applied |
imgui.GetColorU32(ImU32 col) |
Retrieve given color with style alpha applied |
Layout
| Function | Description |
|---|---|
imgui.PushItemWidth(float item_width) |
Width of items for the common item+label case, in pixels. 0.0f = default to ~2/3 of window width, >0.0f: width in pixels, <0.0f: align xx pixels to the right of window (so -1.0f always aligns to the right side). |
imgui.PopItemWidth() |
|
imgui.CalcItemWidth() |
Width of item given pushed settings and current cursor position |
imgui.PushTextWrapPos(float wrap_pos_x = 0.0f) |
Word-wrapping 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. |
imgui.PopTextWrapPos() |
|
imgui.PushAllowKeyboardFocus(bool allow_keyboard_focus) |
Allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets. |
imgui.PopAllowKeyboardFocus() |
|
imgui.PushButtonRepeat(bool repeat) |
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. |
imgui.PopButtonRepeat() |
|
imgui.Separator() |
Separator, generally horizontal. Inside a menu bar or in horizontal layout mode, this becomes a vertical separator. |
imgui.SameLine(float pos_x = 0.0f, float spacing_w = -1.0f) |
Call between widgets or groups to layout them horizontally. |
imgui.NewLine() |
Undo a SameLine() |
imgui.Spacing() |
Add vertical spacing |
imgui.Dummy(const ImVec2& size) |
Add a dummy item of given size |
imgui.Indent(float indent_w = 0.0f) |
Move content position toward the right, by style.IndentSpacing or indent_w if != 0 |
imgui.Unindent(float indent_w = 0.0f) |
Move content position back to the left, by style.IndentSpacing or indent_w if != 0 |
imgui.BeginGroup() |
Lock horizontal starting position + capture group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.) |
imgui.EndGroup() |
Cursor
| Function | Description |
|---|---|
imgui.GetCursorPos() |
Cursor position is relative to window position |
imgui.GetCursorPosX() |
|
imgui.GetCursorPosY() |
|
imgui.SetCursorPos(const ImVec2& local_pos) |
|
imgui.SetCursorPosX(float x) |
|
imgui.SetCursorPosY(float y) |
|
imgui.GetCursorStartPos() |
Initial cursor position |
imgui.GetCursorScreenPos() |
Cursor position in absolute screen coordinates [0..io.DisplaySize] (useful to work with ImDrawList API) |
imgui.SetCursorScreenPos(const ImVec2& screen_pos) |
Cursor position in absolute screen coordinates [0..io.DisplaySize] |
imgui.AlignTextToFramePadding() |
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) |
imgui.GetTextLineHeight() |
~ FontSize |
imgui.GetTextLineHeightWithSpacing() |
~ FontSize + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of text) |
imgui.GetFrameHeight() |
~ FontSize + style.FramePadding.y * 2 |
imgui.GetFrameHeightWithSpacing() |
~ FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets) |
ID Stack
| Function | Description |
|---|---|
imgui.PushID(const char* str_id) |
Push identifier into the ID stack. IDs are hash of the entire stack! |
imgui.PushID(const char* str_id_begin, const char* str_id_end) |
|
imgui.PushID(int int_id) |
|
imgui.PopID() |
|
imgui.GetID(const char* str_id) |
Calculate unique ID (hash of whole ID stack + given parameter). e.g. if you want to query into ImGuiStorage yourself. |
imgui.GetID(const char* str_id_begin, const char* str_id_end) |
Widgets — Text
| Function | Description |
|---|---|
imgui.TextUnformatted(const char* text, const char* text_end = NULL) |
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. |
Widgets — Buttons and Selectables
| Function | Description |
|---|---|
imgui.Button(const char* label, const ImVec2& size = ImVec2 0 0) |
Button |
imgui.SmallButton(const char* label) |
Button with FramePadding=(0,0) to easily embed within text |
imgui.InvisibleButton(const char* str_id, const ImVec2& size) |
Button behavior without the visuals, useful to build custom behaviors using the public api (along with IsItemActive, IsItemHovered, etc.) |
imgui.Checkbox(const char* label, bool* v) |
|
imgui.CheckboxFlags(const char* label, unsigned int* flags, unsigned int flags_value) |
|
imgui.RadioButton(const char* label, bool active) |
|
imgui.RadioButton(const char* label, int* v, int v_button) |
|
imgui.Selectable(const char* label, bool selected = false, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2 0 0) |
"bool selected" carries the selection state (read-only). Selectable() returns true when clicked so you can modify your selection state. size.x==0.0: use remaining width, size.x>0.0: specify width. size.y==0.0: use label height, size.y>0.0: specify height. |
imgui.Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2 0 0) |
"bool* p_selected" points to the selection state (read-write), as a convenient helper. |
Widgets — Images
| Function | Description |
|---|---|
imgui.Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2 0 0, const ImVec2& uv1 = ImVec2 1 1, const ImVec4& tint_col = ImVec4 1 1 1 1, const ImVec4& border_col = ImVec4 0 0 0 0) |
|
imgui.ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2 0 0, const ImVec2& uv1 = ImVec2 1 1, int frame_padding = -1, const ImVec4& bg_col = ImVec4 0 0 0 0, const ImVec4& tint_col = ImVec4 1 1 1 1) |
<0 frame_padding uses default frame padding settings. 0 for no padding. |
Widgets — Data Display
| Function | Description |
|---|---|
imgui.PlotLines(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2 0 0, int stride = sizeof(float)) |
|
imgui.PlotHistogram(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2 0 0, int stride = sizeof(float)) |
|
imgui.ProgressBar(float fraction, const ImVec2& size_arg = ImVec2 -1 0, const char* overlay = NULL) |
|
imgui.Bullet() |
Draw a small circle and keep the cursor on the same line. Advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses. |
imgui.Value(const char* prefix, bool b) |
|
imgui.Value(const char* prefix, int v) |
|
imgui.Value(const char* prefix, unsigned int v) |
|
imgui.Value(const char* prefix, float v, const char* float_format = NULL) |
Widgets — Input Fields
| Function | Description |
|---|---|
imgui.InputFloat(const char* label, float* v, float step = 0.0f, float step_fast = 0.0f, const char* format = "%.3f", ImGuiInputTextFlags extra_flags = 0) |
|
imgui.InputInt(const char* label, int* v, int step = 1, int step_fast = 100, ImGuiInputTextFlags extra_flags = 0) |
Widgets — Drags
| Function | Description |
|---|---|
imgui.DragFloat(const char* label, float* v, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", float power = 1.0f) |
If v_min >= v_max there is no bound. |
imgui.DragFloatRange2(const char* label, float* v_current_min, float* v_current_max, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", const char* format_max = NULL, float power = 1.0f) |
|
imgui.DragInt(const char* label, int* v, float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* format = "%.0f") |
If v_min >= v_max there is no bound. |
imgui.DragIntRange2(const char* label, int* v_current_min, int* v_current_max, float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* format = "%.0f", const char* format_max = NULL) |
Widgets — Sliders
| Function | Description |
|---|---|
imgui.SliderFloat(const char* label, float* v, float v_min, float v_max, const char* format = "%.3f", float power = 1.0f) |
Adjust format to decorate the value with a prefix or suffix for in-slider labels or unit display. Use power!=1.0 for logarithmic sliders. |
imgui.SliderAngle(const char* label, float* v_rad, float v_degrees_min = -360.0f, float v_degrees_max = +360.0f) |
|
imgui.SliderInt(const char* label, int* v, int v_min, int v_max, const char* format = "%.0f") |
|
imgui.VSliderFloat(const char* label, const ImVec2& size, float* v, float v_min, float v_max, const char* format = "%.3f", float power = 1.0f) |
|
imgui.VSliderInt(const char* label, const ImVec2& size, int* v, int v_min, int v_max, const char* format = "%.0f") |
Widgets — Combo
| Function | Description |
|---|---|
imgui.BeginCombo(const char* label, const char* preview_value, ImGuiComboFlags flags = 0) |
|
imgui.EndCombo() |
Only call EndCombo() if BeginCombo() returns true! |
imgui.Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int popup_max_height_in_items = -1) |
Separate items with \0 within a string, end item-list with \0\0. e.g. "One\0Two\0Three\0" |
Trees and Lists
| Function | Description |
|---|---|
imgui.TreeNode(const char* label) |
If returning 'true' the node is open and the tree id is pushed into the id stack. User is responsible for calling TreePop(). |
imgui.TreePush(const char* str_id) |
~ Indent()+PushId(). Already called by TreeNode() when returning true, but you can call Push/Pop yourself for layout purposes. |
imgui.TreePop() |
~ Unindent()+PopId() |
imgui.TreeAdvanceToLabelPos() |
Advance cursor x position by GetTreeNodeToLabelSpacing() |
imgui.GetTreeNodeToLabelSpacing() |
Horizontal distance preceding label when using TreeNode() or Bullet() == (g.FontSize + style.FramePadding.x2) for a regular unframed TreeNode |
imgui.SetNextTreeNodeOpen(bool is_open, ImGuiCond cond = 0) |
Set next TreeNode/CollapsingHeader open state. |
imgui.ListBoxHeader(const char* label, const ImVec2& size = ImVec2 0 0) |
Use if you want to reimplement ListBox() with custom data or interactions. If the function returns true, you can output elements then call ListBoxFooter() afterwards. |
imgui.ListBoxHeader(const char* label, int items_count, int height_in_items = -1) |
|
imgui.ListBoxFooter() |
Terminate the scrolling region. Only call ListBoxFooter() if ListBoxHeader() returned true! |
Tooltips
| Function | Description |
|---|---|
imgui.BeginTooltip() |
Begin/append a tooltip window. To create full-featured tooltip (with any kind of contents). |
imgui.EndTooltip() |
Menus
| Function | Description |
|---|---|
imgui.BeginMainMenuBar() |
Create and append to a full screen menu-bar. |
imgui.EndMainMenuBar() |
Only call EndMainMenuBar() if BeginMainMenuBar() returns true! |
imgui.BeginMenuBar() |
Append to menu-bar of current window (requires MenuBar flag set on parent window). |
imgui.EndMenuBar() |
Only call EndMenuBar() if BeginMenuBar() returns true! |
imgui.BeginMenu(const char* label, bool enabled = true) |
Create a sub-menu entry. Only call EndMenu() if this returns true! |
imgui.EndMenu() |
Only call EndMenu() if BeginMenu() returns true! |
imgui.MenuItem(const char* label, const char* shortcut = NULL, bool selected = false, bool enabled = true) |
Return true when activated. Shortcuts are displayed for convenience but not processed by ImGui at the moment. |
imgui.MenuItem(const char* label, const char* shortcut, bool* p_selected, bool enabled = true) |
Return true when activated + toggle (*p_selected) if p_selected != NULL |
Popups
| Function | Description |
|---|---|
imgui.OpenPopup(const char* str_id) |
Call to mark popup as open (don't call every frame!). Popups are closed when user clicks outside, or if CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. Popup identifiers are relative to the current ID-stack. |
imgui.BeginPopup(const char* str_id, ImGuiWindowFlags flags = 0) |
Return true if the popup is open, and you can start outputting to it. Only call EndPopup() if BeginPopup() returns true! |
imgui.BeginPopupContextItem(const char* str_id = NULL, int mouse_button = 1) |
Helper to open and begin popup when clicked on last item. If you want to use that on a non-interactive item such as Text() you need to pass in an explicit ID here. |
imgui.BeginPopupContextWindow(const char* str_id = NULL, int mouse_button = 1, bool also_over_items = true) |
Helper to open and begin popup when clicked on current window. |
imgui.BeginPopupContextVoid(const char* str_id = NULL, int mouse_button = 1) |
Helper to open and begin popup when clicked in void (where there are no imgui windows). |
imgui.BeginPopupModal(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0) |
Modal dialog (regular window with title bar, blocks interactions behind the modal window, can't close the modal window by clicking outside). |
imgui.EndPopup() |
Only call EndPopup() if BeginPopupXXX() returns true! |
imgui.OpenPopupOnItemClick(const char* str_id = NULL, int mouse_button = 1) |
Helper to open popup when clicked on last item. Return true when just opened. |
imgui.IsPopupOpen(const char* str_id) |
Return true if the popup is open. |
imgui.CloseCurrentPopup() |
Close the popup we have begun into. Clicking on a MenuItem or Selectable automatically closes the current popup. |
Columns
| Function | Description |
|---|---|
imgui.Columns(int count = 1, const char* id = NULL, bool border = true) |
|
imgui.NextColumn() |
Next column, defaults to current row or next row if the current row is finished. |
imgui.GetColumnIndex() |
Get current column index. |
imgui.GetColumnWidth(int column_index = -1) |
Get column width (in pixels). Pass -1 to use current column. |
imgui.SetColumnWidth(int column_index, float width) |
Set column width (in pixels). Pass -1 to use current column. |
imgui.GetColumnOffset(int column_index = -1) |
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. |
imgui.SetColumnOffset(int column_index, float offset_x) |
Set position of column line (in pixels, from the left side of the contents region). Pass -1 to use current column. |
Logging
| Function | Description |
|---|---|
imgui.LogToTTY(int max_depth = -1) |
Start logging to tty. |
imgui.LogToFile(int max_depth = -1, const char* filename = NULL) |
Start logging to file. |
imgui.LogToClipboard(int max_depth = -1) |
Start logging to OS clipboard. |
imgui.LogFinish() |
Stop logging (close file, etc.) |
imgui.LogButtons() |
Helper to display buttons for logging to tty/file/clipboard. |
Drag and Drop
| Function | Description |
|---|---|
imgui.EndDragDropSource() |
Only call EndDragDropSource() if BeginDragDropSource() returns true! |
imgui.BeginDragDropTarget() |
Call after submitting an item that may receive an item. If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget(). |
imgui.EndDragDropTarget() |
Only call EndDragDropTarget() if BeginDragDropTarget() returns true! |
Clipping
| Function | Description |
|---|---|
imgui.PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect) |
|
imgui.PopClipRect() |
Focus and Navigation
| Function | Description |
|---|---|
imgui.SetItemDefaultFocus() |
Make last item the default focused item of a window. Please use instead of "if (IsWindowAppearing()) SetScrollHere()" to signify "default item". |
imgui.SetKeyboardFocusHere(int offset = 0) |
Focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget. Use -1 to access previous widget. |
Item and Widget Utilities
| Function | Description |
|---|---|
imgui.IsItemHovered(ImGuiHoveredFlags flags = 0) |
Is the last item hovered? (and usable, aka not blocked by a popup, etc.). See HoveredFlags for more options. |
imgui.IsItemActive() |
Is the last item active? (e.g. button being held, text field being edited — items that don't interact will always return false) |
imgui.IsItemFocused() |
Is the last item focused for keyboard/gamepad navigation? |
imgui.IsItemClicked(int mouse_button = 0) |
Is the last item clicked? (e.g. button/node just clicked on) |
imgui.IsItemVisible() |
Is the last item visible? (aka not out of sight due to clipping/scrolling) |
imgui.IsAnyItemHovered() |
|
imgui.IsAnyItemActive() |
|
imgui.IsAnyItemFocused() |
|
imgui.GetItemRectMin() |
Get bounding rectangle of last item, in screen space |
imgui.GetItemRectMax() |
|
imgui.GetItemRectSize() |
Get size of last item, in screen space |
imgui.SetItemAllowOverlap() |
Allow last item to be overlapped by a subsequent item. Sometimes useful with invisible buttons, selectables, etc. to catch unused area. |
imgui.IsRectVisible(const ImVec2& size) |
Test if rectangle (of given size, starting from cursor position) is visible / not clipped. |
imgui.IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max) |
Test if rectangle (in screen space) is visible / not clipped. To perform coarse clipping on user's side. |
Keyboard and Mouse Input
| Function | Description |
|---|---|
imgui.IsKeyDown(int user_key_index) |
Is key being held. == io.KeysDown[user_key_index]. Note that imgui doesn't know the semantic of each entry of io.KeysDown[]. Use your own indices/enums according to how your backend/engine stored them into io.KeysDown[]! |
imgui.IsKeyPressed(int user_key_index, bool repeat = true) |
Was key pressed (went from !Down to Down). If repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate. |
imgui.IsKeyReleased(int user_key_index) |
Was key released (went from Down to !Down). |
imgui.IsMouseDown(int button) |
Is mouse button held. |
imgui.IsAnyMouseDown() |
Is any mouse button held. |
imgui.IsMouseClicked(int button, bool repeat = false) |
Did mouse button click (went from !Down to Down). |
imgui.IsMouseDoubleClicked(int button) |
Did mouse button double-click. A double-click returns false in IsMouseClicked(). Uses io.MouseDoubleClickTime. |
imgui.IsMouseReleased(int button) |
Did mouse button release (went from Down to !Down). |
imgui.IsMouseDragging(int button = 0, float lock_threshold = -1.0f) |
Is mouse dragging. If lock_threshold < -1.0f uses io.MouseDraggingThreshold. |
imgui.IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip = true) |
Is mouse hovering given bounding rect (in screen space). Clipped by current clipping settings. Disregarding of consideration of focus/window ordering/blocked by a popup. |
imgui.GetMousePos() |
Shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls. |
imgui.GetMousePosOnOpeningCurrentPopup() |
Retrieve backup of mouse position at the time of opening popup we have BeginPopup() into. |
imgui.GetMouseDragDelta(int button = 0, float lock_threshold = -1.0f) |
Dragging amount since clicking. If lock_threshold < -1.0f uses io.MouseDraggingThreshold. |
imgui.ResetMouseDragDelta(int button = 0) |
|
imgui.SetMouseCursor(ImGuiMouseCursor type) |
Set desired cursor type. |
imgui.CaptureKeyboardFromApp(bool capture = true) |
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. |
imgui.CaptureMouseFromApp(bool capture = true) |
Manually override io.WantCaptureMouse flag next frame (said flag is entirely left for your application to handle). |
Clipboard
| Function | Description |
|---|---|
imgui.GetClipboardText() |
|
imgui.SetClipboardText(const char* text) |
Utilities
| Function | Description |
|---|---|
imgui.GetTime() |
|
imgui.GetStyleColorName(ImGuiCol idx) |
|
imgui.CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f) |
|
imgui.CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end) |
Calculate coarse clipping for large list of evenly sized items. Prefer using the ImGuiListClipper higher-level helper if you can. |
imgui.BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags flags = 0) |
Helper to create a child window / scrolling region that looks like a normal widget frame. |
imgui.EndChildFrame() |
Always call EndChildFrame() regardless of BeginChildFrame() return values (which indicates a collapsed/clipped window). |
imgui.ColorConvertFloat4ToU32(const ImVec4& in) |
Settings
| Function | Description |
|---|---|
imgui.LoadIniSettingsFromDisk(const char* ini_filename) |
Call after CreateContext() and before the first call to NewFrame(). NewFrame() automatically calls LoadIniSettingsFromDisk(io.IniFilename). |
imgui.SaveIniSettingsToDisk(const char* ini_filename) |