ImGui
imgui.ImGui (Class)
Static Members
createContext(?sharedFontAtlas: cpp.Star = null): cpp.Star
| Name |
Type |
Default |
sharedFontAtlas |
cpp.Star |
null |
destroyContext(?ctx: cpp.Star = null): Void
NULL = destroy current context
getCurrentContext(): cpp.Star
setCurrentContext(ctx: cpp.Star): Void
access the ImGuiIO structure (mouse/keyboard/gamepad inputs, time, various configuration options/flags)
access the ImGuiPlatformIO structure (mostly hooks/functions to connect to platform/renderer and OS Clipboard, IME etc.)
access the Style structure (colors, sizes). Always use PushStyleColor(), PushStyleVar() to modify style mid-frame!
start a new Dear ImGui frame, you can submit any command from this point until Render()/EndFrame().
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().
valid after Render() and until the next call to NewFrame(). Call ImGui_ImplXXXX_RenderDrawData() function in your Renderer Backend to render.
Implied p_open = NULL
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 an 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
isWindowAppearing(): Bool
isWindowCollapsed(): Bool
isWindowFocused(?flags: Int = 0): Bool
is current window focused? or its root/child, depending on flags. see flags for options.
| Name |
Type |
Default |
flags |
Int |
0 |
isWindowHovered(?flags: Int = 0): Bool
is current window hovered and hoverable (e.g. not blocked by a popup/modal)? See ImGuiHoveredFlags_ for options. IMPORTANT: If you are trying to check whether your mouse should be dispatched to Dear ImGui or to your underlying app, you should not use this function! Use the 'io.WantCaptureMouse' boolean for that! Refer to FAQ entry "How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?" for details.
| Name |
Type |
Default |
flags |
Int |
0 |
get draw list associated to the current window, to append your own drawing primitives
getWindowDpiScale(): Float
get DPI scale currently associated to the current window's viewport.
get current window position in screen space (IT IS UNLIKELY YOU EVER NEED TO USE THIS. Consider always using GetCursorScreenPos() and GetContentRegionAvail() instead)
get current window size (IT IS UNLIKELY YOU EVER NEED TO USE THIS. Consider always using GetCursorScreenPos() and GetContentRegionAvail() instead)
get current window width (IT IS UNLIKELY YOU EVER NEED TO USE THIS). Shortcut for GetWindowSize().x.
get current window height (IT IS UNLIKELY YOU EVER NEED TO USE THIS). Shortcut for GetWindowSize().y.
get viewport currently associated to the current window.
set next window position. call before Begin(). use pivot=(0.5f,0.5f) to center on given point, etc.
Implied pivot = ImVec2(0, 0)
set next window size. set axis to 0.0f to force an auto-fit on this axis. call before Begin()
set next window size limits. use 0.0f or FLT_MAX if you don't want limits. Use -1 for both min and max of same axis to preserve current size (which itself is a constraint). Use callback to apply non-trivial programmatic constraints.
setNextWindowContentSize(size: ImVec2): Void
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()
setNextWindowCollapsed(collapsed: Bool, ?cond: Int = 0): Void
set next window collapsed state. call before Begin()
| Name |
Type |
Default |
collapsed |
Bool |
|
cond |
Int |
0 |
setNextWindowFocus(): Void
set next window to be focused / top-most. call before Begin()
set next window scrolling value (use < 0.0f to not affect a given axis).
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
(not recommended) set current window position - call within Begin()/End(). prefer using SetNextWindowPos(), as this may incur tearing and side-effects.
(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.
setWindowCollapsed(collapsed: Bool, ?cond: Int = 0): Void
(not recommended) set current window collapsed state. prefer using SetNextWindowCollapsed().
| Name |
Type |
Default |
collapsed |
Bool |
|
cond |
Int |
0 |
(not recommended) set current window to be focused / top-most. prefer using SetNextWindowFocus().
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.
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.
| Name |
Type |
Default |
centerXRatio |
Float |
0.5 |
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.
| Name |
Type |
Default |
centerYRatio |
Float |
0.5 |
adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position.
| Name |
Type |
Default |
localX |
Float |
|
centerXRatio |
Float |
0.5 |
adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position.
| Name |
Type |
Default |
localY |
Float |
|
centerYRatio |
Float |
0.5 |
Use NULL as a shortcut to keep current font. Use 0.0f to keep current size.
get current font
get current scaled font size (= height in pixels). AFTER global scale factors applied. IMPORTANT DO NOT PASS THIS VALUE TO PushFont()! Use ImGui::GetStyle().FontSizeBase to get value before global scale factors.
get current font bound at current size // == GetFont()->GetFontBaked(GetFontSize())
modify a style color. always use this if you modify the style after NewFrame().
popStyleColorEx(?count: Int = 1): Void
| Name |
Type |
Default |
count |
Int |
1 |
Implied count = 1
modify a style float variable. always use this if you modify the style after NewFrame()!
modify a style ImVec2 variable. "
modify X component of a style ImVec2 variable. "
modify Y component of a style ImVec2 variable. "
popStyleVarEx(?count: Int = 1): Void
| Name |
Type |
Default |
count |
Int |
1 |
Implied count = 1
modify specified shared item flag, e.g. PushItemFlag(ImGuiItemFlags_NoTabStop, true)
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).
| Name |
Type |
itemWidth |
Float |
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)
| Name |
Type |
itemWidth |
Float |
width of item given pushed settings and current cursor position. NOT necessarily the width of last item unlike most 'Item' functions.
pushTextWrapPos(?wrapLocalPosX: Float = 0.0): Void
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
| Name |
Type |
Default |
wrapLocalPosX |
Float |
0.0 |
getFontTexUvWhitePixel(): ImVec2
get UV coordinate for a white pixel, useful to draw custom shapes via the ImDrawList API
retrieve given style color with style alpha applied and optional extra alpha multiplier, packed as a 32-bit value suitable for ImDrawList
| Name |
Type |
Default |
idx |
Int |
|
alphaMul |
Float |
1.0 |
Implied alpha_mul = 1.0f
retrieve given color with style alpha applied, packed as a 32-bit value suitable for ImDrawList
retrieve given color with style alpha applied, packed as a 32-bit value suitable for ImDrawList
Implied alpha_mul = 1.0f
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.
cursor position, absolute coordinates. THIS IS YOUR BEST FRIEND (prefer using this rather than GetCursorPos(), also more useful to work with ImDrawList API).
cursor position, absolute coordinates. THIS IS YOUR BEST FRIEND.
getContentRegionAvail(): ImVec2
available space from current position. THIS IS YOUR BEST FRIEND.
[window-local] cursor position in window-local coordinates. This is not your best friend.
[window-local] "
[window-local] "
[window-local] "
[window-local] "
[window-local] "
[window-local] initial cursor position, in window-local coordinates. Call GetCursorScreenPos() after Begin() to get the absolute coordinates version.
separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator.
sameLineEx(?offsetFromStartX: Float = 0.0, ?spacing: Float = -1.0): Void
call between widgets or groups to layout them horizontally. X position given in window coordinates.
| Name |
Type |
Default |
offsetFromStartX |
Float |
0.0 |
spacing |
Float |
-1.0 |
Implied offset_from_start_x = 0.0f, spacing = -1.0f
undo a SameLine() or force a new line when in a 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
| Name |
Type |
Default |
indentW |
Float |
0.0 |
Implied indent_w = 0.0f
move content position back to the left, by indent_w, or style.IndentSpacing if indent_w <= 0
| Name |
Type |
Default |
indentW |
Float |
0.0 |
Implied indent_w = 0.0f
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.)
alignTextToFramePadding(): Void
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)
getTextLineHeight(): Float
~ FontSize
getTextLineHeightWithSpacing(): Float
~ FontSize + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of text)
~ FontSize + style.FramePadding.y * 2
getFrameHeightWithSpacing(): Float
~ FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets)
push string into the ID stack (will hash string).
push string into the ID stack (will hash string).
push pointer into the ID stack (will hash pointer).
push integer into the ID stack (will hash integer).
pop from the ID stack.
calculate unique ID (hash of whole ID stack + given parameter). e.g. if you want to query into ImGuiStorage yourself
text(text: String, ?textEnd: String = null): Void
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.
Implied text_end = NULL
textColored(col: ImVec4, text: String): Void
shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor();
textDisabled(text: String): Void
shortcut for PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_TextDisabled]); Text(fmt, ...); PopStyleColor();
textWrapped(text: String): Void
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().
labelText(label: String, text: String): Void
display text+label aligned the same way as value+label widgets
bulletText(text: String): Void
shortcut for Bullet()+Text()
separatorText(label: String): Void
currently: formatted text with a horizontal line
button
Implied size = ImVec2(0, 0)
button with (FramePadding.y == 0) to easily embed within text
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
use with e.g. if (RadioButton("one", my_value==1)) { my_value = 1; }
draw a small circle + keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses
textLink(label: String): Bool
hyperlink text button, return true when clicked
textLinkOpenURLEx(label: String, ?url: String = null): Bool
hyperlink text button, automatically open file/url when clicked
textLinkOpenURL(label: String): Bool
Implied url = NULL
Implied uv0 = ImVec2(0, 0), uv1 = ImVec2(1, 1)
Implied uv0 = ImVec2(0, 0), uv1 = ImVec2(1, 1), bg_col = ImVec4(0, 0, 0, 0), tint_col = ImVec4(1, 1, 1, 1)
Implied uv0 = ImVec2(0, 0), uv1 = ImVec2(1, 1), bg_col = ImVec4(0, 0, 0, 0), tint_col = ImVec4(1, 1, 1, 1)
only call EndCombo() if BeginCombo() returns true!
Implied popup_max_height_in_items = -1
Implied popup_max_height_in_items = -1
Implied v_speed = 1.0f, v_min = 0.0f, v_max = 0.0f, format = "%.3f", flags = 0
Implied v_speed = 1.0f, v_min = 0.0f, v_max = 0.0f, format = "%.3f", flags = 0
Implied v_speed = 1.0f, v_min = 0.0f, v_max = 0.0f, format = "%.3f", flags = 0
Implied v_speed = 1.0f, v_min = 0, v_max = 0, format = "%d", flags = 0
Implied v_speed = 1.0f, v_min = 0, v_max = 0, format = "%d", flags = 0
Implied v_speed = 1.0f, v_min = 0, v_max = 0, format = "%d", flags = 0
Implied v_speed = 1.0f, p_min = NULL, p_max = NULL, format = NULL, flags = 0
Implied v_speed = 1.0f, p_min = NULL, p_max = NULL, format = NULL, flags = 0
Implied format = "%.3f", flags = 0
Implied format = "%.3f", flags = 0
Implied format = "%.3f", flags = 0
Implied format = "%d", flags = 0
Implied format = "%d", flags = 0
Implied format = "%d", flags = 0
Implied format = NULL, flags = 0
Implied format = NULL, flags = 0
Implied format = NULL, flags = 0
Implied format = "%.3f", flags = 0
Implied format = "%.3f", flags = 0
Implied format = "%.3f", flags = 0
Implied p_step = NULL, p_step_fast = NULL, format = NULL, flags = 0
Implied p_step = NULL, p_step_fast = NULL, format = NULL, flags = 0
display a color square/button, hover for details, return true when pressed.
Implied size = ImVec2(0, 0)
setColorEditOptions(flags: Int): Void
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 decorrelate 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().
"
~ Indent()+PushID(). Already called by TreeNode() when returning true, but you can call TreePush/TreePop yourself if desired.
"
~ Unindent()+PopID()
getTreeNodeToLabelSpacing(): Float
horizontal distance preceding label when using TreeNode*() or Bullet() == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode
if returning 'true' the header is open. doesn't indent nor push on ID stack. user doesn't have to call TreePop().
set next TreeNode/CollapsingHeader open state.
| Name |
Type |
Default |
isOpen |
Bool |
|
cond |
Int |
0 |
set id to use for open/close storage (default to same as item id).
retrieve tree node open/close state.
"bool selected" carry the selection state (read-only). Selectable() is clicked is returns true 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
Implied selected = false, flags = 0, size = ImVec2(0, 0)
beginMultiSelectEx(flags: Int, ?selectionSize: Int = -1, ?itemsCount: Int = -1): cpp.Star
| Name |
Type |
Default |
flags |
Int |
|
selectionSize |
Int |
-1 |
itemsCount |
Int |
-1 |
Implied selection_size = -1, items_count = -1
isItemToggledSelection(): Bool
Was the last item selection state toggled? Useful if you need the per-item information before reaching EndMultiSelect(). We only returns toggle event in order to handle clipping correctly.
open a framed scrolling region
only call EndListBox() if BeginListBox() returned true!
Implied height_in_items = -1
Implied values_offset = 0, overlay_text = NULL, scale_min = FLT_MAX, scale_max = FLT_MAX, graph_size = ImVec2(0, 0), stride = sizeof(float)
Implied values_offset = 0, overlay_text = NULL, scale_min = FLT_MAX, scale_max = FLT_MAX, graph_size = ImVec2(0, 0)
Implied values_offset = 0, overlay_text = NULL, scale_min = FLT_MAX, scale_max = FLT_MAX, graph_size = ImVec2(0, 0), stride = sizeof(float)
Implied values_offset = 0, overlay_text = NULL, scale_min = FLT_MAX, scale_max = FLT_MAX, graph_size = ImVec2(0, 0)
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!
Implied enabled = true
only call EndMenu() if BeginMenu() returns true!
return true when activated.
Implied shortcut = NULL, selected = false, enabled = true
begin/append a tooltip window.
only call EndTooltip() if BeginTooltip()/BeginItemTooltip() returns true!
set a text-only tooltip. Often used after a ImGui::IsItemHovered() check. Override any previous call to SetTooltip().
begin/append a tooltip window if preceding item was hovered.
set a text-only tooltip if preceding item was hovered. override any previous call to SetTooltip().
return true if the popup 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!).
| Name |
Type |
Default |
strId |
String |
|
popupFlags |
Int |
0 |
id overload to facilitate calling from nested stacks
helper to open popup when clicked on last item. Default to ImGuiPopupFlags_MouseButtonRight == 1. (note: actually triggers on the mouse released event to be consistent with popup behaviors)
| Name |
Type |
Default |
strId |
String |
null |
popupFlags |
Int |
0 |
manually close the popup we have begin-ed into.
open+begin popup when clicked on last item. Use str_id==NULL to associate the popup to previous item. 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!
| Name |
Type |
Default |
strId |
String |
null |
popupFlags |
Int |
0 |
Implied str_id = NULL, popup_flags = 0
open+begin popup when clicked on current window.
| Name |
Type |
Default |
strId |
String |
null |
popupFlags |
Int |
0 |
Implied str_id = NULL, popup_flags = 0
open+begin popup when clicked in void (where there are no windows).
| Name |
Type |
Default |
strId |
String |
null |
popupFlags |
Int |
0 |
Implied str_id = NULL, popup_flags = 0
return true if the popup is open.
Implied outer_size = ImVec2(0.0f, 0.0f), inner_width = 0.0f
only call EndTable() if BeginTable() returns true!
tableNextRowEx(?rowFlags: Int = 0, ?minRowHeight: Float = 0.0): Void
append into the first cell of a new row. 'min_row_height' include the minimum top and bottom padding aka CellPadding.y * 2.0f.
| Name |
Type |
Default |
rowFlags |
Int |
0 |
minRowHeight |
Float |
0.0 |
Implied row_flags = 0, min_row_height = 0.0f
append into the next column (or first column of next row if currently in last column). Return true when column is visible.
tableSetColumnIndex(columnN: Int): Bool
append into the specified column. Return true when column is visible.
Implied init_width_or_weight = 0.0f, user_id = 0
lock columns/rows so they stay visible when scrolled.
submit one header cell manually (rarely used)
submit a row with headers cells based on data provided to TableSetupColumn() + submit context menu
submit a row with angled headers for every column with the ImGuiTableColumnFlags_AngledHeader flag. MUST BE FIRST ROW.
get latest sort specs for the table (NULL if not sorting). Lifetime: don't hold on this pointer over multiple frames or past any subsequent call to BeginTable().
tableGetColumnCount(): Int
return number of columns (value passed to BeginTable)
tableGetColumnIndex(): Int
return current column index.
return current row index (header rows are accounted for)
tableGetColumnName(?columnN: Int = -1): String
return "" if column didn't have a name declared by TableSetupColumn(). Pass -1 to use current column.
| Name |
Type |
Default |
columnN |
Int |
-1 |
tableGetColumnFlags(?columnN: Int = -1): Int
return column flags so you can query their Enabled/Visible/Sorted/Hovered status flags. Pass -1 to use current column.
| Name |
Type |
Default |
columnN |
Int |
-1 |
change user accessible enabled/disabled state of a column. Set to false to hide the column. User can use the context menu to change this themselves (right-click in headers, or right-click in columns body with ImGuiTableFlags_ContextMenuInBody)
tableGetHoveredColumn(): Int
return hovered column. return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered. Can also use (TableGetColumnFlags() & ImGuiTableColumnFlags_IsHovered) instead.
change the color of a cell, row, or column. See ImGuiTableBgTarget_ flags for details.
| Name |
Type |
Default |
target |
Int |
|
color |
ImU32 |
|
columnN |
Int |
-1 |
Implied count = 1, id = NULL, borders = true
next column, defaults to current row or next row if the current row is finished
get current column index
getColumnWidth(?columnIndex: Int = -1): Float
get column width (in pixels). pass -1 to use current column
| Name |
Type |
Default |
columnIndex |
Int |
-1 |
set column width (in pixels). pass -1 to use current column
getColumnOffset(?columnIndex: Int = -1): Float
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
| Name |
Type |
Default |
columnIndex |
Int |
-1 |
set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column
create and append into a TabBar
only call EndTabBar() if BeginTabBar() returns true!
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.
setTabItemClosed(tabOrDockedWindowLabel: String): Void
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.
| Name |
Type |
tabOrDockedWindowLabel |
String |
Implied size = ImVec2(0, 0), flags = 0, window_class = NULL
dockSpaceOverViewport(): UInt
Implied dockspace_id = 0, viewport = NULL, flags = 0, window_class = NULL
set next window dock id
set next window class (control docking compatibility + provide hints to platform backend via custom viewport flags and platform parent/child relationship)
get dock id of current window, or 0 if not associated to any docking node.
is current window docked into another window?
logToTTY(?autoOpenDepth: Int = -1): Void
start logging to tty (stdout)
| Name |
Type |
Default |
autoOpenDepth |
Int |
-1 |
logToFile(?autoOpenDepth: Int = -1, ?filename: String = null): Void
start logging to file
| Name |
Type |
Default |
autoOpenDepth |
Int |
-1 |
filename |
String |
null |
logToClipboard(?autoOpenDepth: Int = -1): Void
start logging to OS clipboard
| Name |
Type |
Default |
autoOpenDepth |
Int |
-1 |
stop logging (close file, etc.)
helper to display buttons for logging to tty/file/clipboard
logText(text: String): Void
pass text data straight to log (without being displayed)
beginDragDropSource(?flags: Int = 0): Bool
call after submitting an item which may be dragged. when this return true, you can call SetDragDropPayload() + EndDragDropSource()
| Name |
Type |
Default |
flags |
Int |
0 |
type is a user defined string of maximum 32 characters. Strings starting with '_' are reserved for dear imgui internal types. Data is copied and held by imgui. Return true when payload has been accepted.
endDragDropSource(): Void
only call EndDragDropSource() if BeginDragDropSource() returns true!
beginDragDropTarget(): Bool
call after submitting an item that may receive a payload. If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget()
accept contents of a given type. If ImGuiDragDropFlags_AcceptBeforeDelivery is set you can peek into the payload before the mouse button is released.
endDragDropTarget(): Void
only call EndDragDropTarget() if BeginDragDropTarget() returns true!
peek directly into the current payload from anywhere. returns NULL when drag and drop is finished or inactive. use ImGuiPayload::IsDataType() to test for the payload type.
beginDisabled(?disabled: Bool = true): Void
| Name |
Type |
Default |
disabled |
Bool |
true |
| Name |
Type |
clipRectMin |
ImVec2 |
clipRectMax |
ImVec2 |
intersectWithCurrentClipRect |
Bool |
setItemDefaultFocus(): Void
make last item the default focused item of a newly appearing window.
setKeyboardFocusHereEx(?offset: Int = 0): Void
focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget. Use -1 to access previous widget.
| Name |
Type |
Default |
offset |
Int |
0 |
setKeyboardFocusHere(): Void
Implied offset = 0
setNavCursorVisible(visible: Bool): Void
alter visibility of keyboard/gamepad cursor. by default: show when using an arrow key, hide when clicking with mouse.
setNextItemAllowOverlap(): Void
allow next item to be overlapped by a subsequent item. Typically useful with InvisibleButton(), Selectable(), TreeNode() covering an area where subsequent items may need to be added. Note that both Selectable() and TreeNode() have dedicated flags doing this.
isItemHovered(?flags: Int = 0): Bool
is the last item hovered? (and usable, aka not blocked by a popup, etc.). See ImGuiHoveredFlags for more options.
| Name |
Type |
Default |
flags |
Int |
0 |
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?
isItemClickedEx(?mouseButton: Int = 0): Bool
is the last item hovered and mouse clicked on? () == IsMouseClicked(mouse_button) && IsItemHovered()Important. () this is NOT equivalent to the behavior of e.g. Button(). Read comments in function definition.
| Name |
Type |
Default |
mouseButton |
Int |
0 |
Implied mouse_button = 0
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).
isItemDeactivated(): Bool
was the last item just made inactive (item was previously active). Useful for Undo/Redo patterns with widgets that require continuous editing.
isItemDeactivatedAfterEdit(): Bool
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 require 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).
isItemToggledOpen(): Bool
was the last item open state toggled? set by TreeNode().
is any item hovered?
is any item active?
is any item focused?
get ID of last item (~~ often same ImGui::GetID(label) beforehand)
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
get generic flags of last item
getMainViewport(): cpp.Star
return primary/default viewport. This can never be NULL.
get background draw list for the given viewport or 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.
| Name |
Type |
Default |
viewport |
cpp.Star |
null |
Implied viewport = NULL
get foreground draw list for the given viewport or viewport associated to the current window. this draw list will be the top-most rendered one. Useful to quickly draw shapes/text over dear imgui contents.
| Name |
Type |
Default |
viewport |
cpp.Star |
null |
Implied viewport = NULL
test if rectangle (of given size, starting from cursor position) is visible / not clipped.
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.
you may use this when creating your own ImDrawList instances.
get a string corresponding to the enum value (for display, saving, etc.).
replace current window storage with our own (if you want to manipulate it yourself, typically clear subsection of it)
calcTextSizeEx(text: String, ?textEnd: String = null, ?hideTextAfterDoubleHash: Bool = false, ?wrapWidth: Float = -1.0): ImVec2
| Name |
Type |
Default |
text |
String |
|
textEnd |
String |
null |
hideTextAfterDoubleHash |
Bool |
false |
wrapWidth |
Float |
-1.0 |
calcTextSize(text: String): ImVec2
Implied text_end = NULL, hide_text_after_double_hash = false, wrap_width = -1.0f
is key being held.
was key pressed (went from !Down to Down)? Repeat rate uses io.KeyRepeatDelay / KeyRepeatRate.
| Name |
Type |
Default |
key |
Int |
|
repeat |
Bool |
true |
Implied repeat = true
was key released (went from Down to !Down)?
was key chord (mods + key) pressed, e.g. you can pass 'ImGuiMod_Ctrl | ImGuiKey_S' as a key-chord. This doesn't do any routing or focus check, please consider using Shortcut() function instead.
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
[DEBUG] returns English name of the key. Those names are provided for debugging purpose and are not meant to be saved persistently nor compared.
setNextFrameWantCaptureKeyboard(wantCaptureKeyboard: Bool): Void
Override io.WantCaptureKeyboard flag next frame (said flag is left for your application to handle, typically when true it instructs your app to ignore inputs). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard"; after the next NewFrame() call.
| Name |
Type |
wantCaptureKeyboard |
Bool |
Set key owner to last item ID if it is hovered or active. Return true when ownership has been set. Roughly equivalent to 'if (TestKeyOwner(key, GetItemID()) && (IsItemHovered() || IsItemActive())) { SetKeyOwner(key, GetItemID());'.
is mouse button held?
isMouseClickedEx(button: Int, ?repeat: Bool = false): Bool
did mouse button clicked? (went from !Down to Down). Same as GetMouseClickedCount() == 1.
| Name |
Type |
Default |
button |
Int |
|
repeat |
Bool |
false |
Implied repeat = false
did mouse button released? (went from Down to !Down)
isMouseDoubleClicked(button: Int): Bool
did mouse button double-clicked? Same as GetMouseClickedCount() == 2. (note that a double-click will also report IsMouseClicked() == true)
delayed mouse release (use very sparingly!). Generally used with 'delay >= io.MouseDoubleClickTime' + combined with a 'io.MouseClickedLastCount==1' test. This is a very rarely used UI idiom, but some apps use this: e.g. MS Explorer single click on an icon to rename.
getMouseClickedCount(button: Int): Int
return the number of successive mouse-clicks at the time where a click happen (otherwise 0).
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.
Implied clip = true
by convention we use (-FLT_MAX,-FLT_MAX) to denote that there is no mouse available
| Name |
Type |
Default |
mousePos |
cpp.Star |
null |
[WILL OBSOLETE] is any mouse button held? This was designed for backends, but prefer having backend maintain a mask of held mouse buttons, because upcoming input queue system will make this invalid.
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)
isMouseDragging(button: Int, ?lockThreshold: Float = -1.0): Bool
is mouse dragging? (uses io.MouseDraggingThreshold if lock_threshold < 0.0f)
| Name |
Type |
Default |
button |
Int |
|
lockThreshold |
Float |
-1.0 |
getMouseDragDelta(?button: Int = 0, ?lockThreshold: Float = -1.0): ImVec2
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 (uses io.MouseDraggingThreshold if lock_threshold < 0.0f)
| Name |
Type |
Default |
button |
Int |
0 |
lockThreshold |
Float |
-1.0 |
resetMouseDragDeltaEx(?button: Int = 0): Void
| Name |
Type |
Default |
button |
Int |
0 |
resetMouseDragDelta(): Void
Implied button = 0
get desired mouse cursor shape. Important: 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
setMouseCursor(cursorType: Int): Void
set desired mouse cursor shape
setNextFrameWantCaptureMouse(wantCaptureMouse: Bool): Void
Override io.WantCaptureMouse flag next frame (said flag is left for your application to handle, typical when true it instructs your app to ignore inputs). This is equivalent to setting "io.WantCaptureMouse = want_capture_mouse;" after the next NewFrame() call.
| Name |
Type |
wantCaptureMouse |
Bool |
getClipboardText(): String
setClipboardText(text: String): Void
loadIniSettingsFromDisk(iniFilename: String): Void
call after CreateContext() and before the first call to NewFrame(). NewFrame() automatically calls LoadIniSettingsFromDisk(io.IniFilename).
loadIniSettingsFromMemory(iniData: String, ?iniSize: Int = 0): Void
call after CreateContext() and before the first call to NewFrame() to provide .ini data from your own data source.
| Name |
Type |
Default |
iniData |
String |
|
iniSize |
Int |
0 |
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).
return a zero-terminated string with the .ini data which you can save by your own mean. call when io.WantSaveIniSettings is set, then save data by your own mean and clear io.WantSaveIniSettings.
| Name |
Type |
Default |
outIniSize |
cpp.Star |
null |
debugTextEncoding(text: String): Void
debugFlashStyleColor(idx: Int): Void
debugStartItemPicker(): Void
debugCheckVersionAndDataLayout(versionStr: String, szIo: Int, szStyle: Int, szVec2: Int, szVec4: Int, szDrawvert: Int, szDrawidx: Int): Bool
This is called by IMGUI_CHECKVERSION() macro.
Call via IMGUI_DEBUG_LOG() for maximum stripping in caller code!
call in main loop. will call CreateWindow/ResizeWindow/etc. platform functions for each secondary viewport, and DestroyWindow for each inactive viewport.
call in main loop. will call RenderWindow/SwapBuffers platform functions for each secondary viewport which doesn't have the ImGuiViewportFlags_Minimized flag set. May be reimplemented by user for custom rendering needs.
Implied platform_render_arg = NULL, renderer_render_arg = NULL
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().
this is a helper for backends.
this is a helper for backends. the type platform_handle is decided by the backend (e.g. HWND, MyWindow*, GLFWwindow* etc.)
Construct a zero-size ImVector<> (of any type). This is primarily useful when calling ImFontGlyphRangesBuilder_BuildRanges()
Destruct an ImVector<> (of any type). Important: Frees the vector memory but does not call destructors on contained objects (if they have them)
create Demo window. demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application!
| Name |
Type |
Default |
pOpen |
Dynamic |
(optional) |
create Metrics/Debugger window. display Dear ImGui internals: windows, draw commands, various internal state, etc.
| Name |
Type |
Default |
pOpen |
Dynamic |
(optional) |
create Debug Log window. display a simplified log of important dear imgui events.
| Name |
Type |
Default |
pOpen |
Dynamic |
(optional) |
create Stack Tool window. hover items with mouse to query information about the source of their unique ID.
| Name |
Type |
Default |
pOpen |
Dynamic |
(optional) |
create About window. display Dear ImGui version, credits and build/system information.
| Name |
Type |
Default |
pOpen |
Dynamic |
(optional) |
shortcut to handle the above pattern when value is an integer
Separate items with \0 within a string, end item-list with \0\0. e.g. "One\0Two\0Three\0"
Implied popup_max_height_in_items = -1
If v_min >= v_max we have no bound
Implied v_speed = 1.0f, v_min = 0.0f, v_max = 0.0f, format = "%.3f", flags = 0
Implied v_speed = 1.0f, v_min = 0.0f, v_max = 0.0f, format = "%.3f", format_max = NULL, flags = 0
If v_min >= v_max we have no bound
Implied v_speed = 1.0f, v_min = 0, v_max = 0, format = "%d", flags = 0
Implied v_speed = 1.0f, v_min = 0, v_max = 0, format = "%d", format_max = NULL, flags = 0
adjust format to decorate the value with a prefix or a suffix for in-slider labels or unit display.
Implied format = "%.3f", flags = 0
Implied v_degrees_min = -360.0f, v_degrees_max = +360.0f, format = "%.0f deg", flags = 0
Implied format = "%d", flags = 0
Implied format = "%.3f", flags = 0
Implied format = "%d", flags = 0
Implied callback = NULL, user_data = NULL
Implied size = ImVec2(0, 0), flags = 0, callback = NULL, user_data = NULL
Implied callback = NULL, user_data = NULL
Implied step = 0.0f, step_fast = 0.0f, format = "%.3f", flags = 0
Implied step = 1, step_fast = 100, flags = 0
Implied step = 0.0, step_fast = 0.0, format = "%.6f", flags = 0
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.
"bool* p_selected" point to the selection state (read-write), as a convenient helper.
Implied size = ImVec2(0, 0)
return true when activated + toggle (*p_selected) if p_selected != NULL
return true if the modal is open, and you can start outputting to it.
create a Tab. Returns true if the Tab is selected.
| Name |
Parameters |
:cppInclude |
"linc_imgui.h" |