LuaSTG-x Core API
|
Classes | |
class | ColorTextEdit |
class | ImDrawList |
class | ImFont |
class | ImFontAtlas |
class | ImFontAtlasCustomRect |
class | ImFontConfig |
class | ImFontGlyph |
class | ImGuiIO |
class | ImGuiStyle |
class | ImGuiViewport |
class | style |
accept contents of a given type. If ImGuiDragDropFlags_AcceptBeforeDelivery is set you can peek into the payload before the mouse button is released.
type | string |
flags | number |
path | string |
size | number |
config | table |
ranges | number |
static function 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)
square button with an arrow shape
str_id | string |
dir | number |
Windows
Passing 'bool* p_open != NULL' shows a window-closing widget in the upper-right corner of the window,
which clicking will set the boolean to false when clicked.
Begin() return false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting
anything to the window. Always call a matching End() for each Begin() call, regardless of its return value!
(this is due to legacy reason and is inconsistent with most other functions such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc.
where the EndXXX call should only be called if the corresponding BeginXXX function returned true.)
name | string |
open | boolean optional, nullable |
flags | number optional ImGuiWindowFlags |
Child Windows
BeginChild() returns false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting anything to the window.
Always call a matching EndChild() for each BeginChild() call, regardless of its return value (this is due to legacy reason and is inconsistent with most other functions such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding BeginXXX function returned true.)
id | string |
size | ImVec2 optional |
border | number optional |
flags | number optional ImGuiWindowFlags |
helper to create a child window / scrolling region that looks like a normal widget frame
id | number |
size | ImVec2 |
flags | number |
label | string |
preview_value | string |
flags | number |
static function beginDragDropSource | ( | ) |
call when the current item is active. If this return true, you can call SetDragDropPayload() + EndDragDropSource()
static function beginDragDropTarget | ( | ) |
call after submitting an item that may receive a payload. If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget()
static function beginGroup | ( | ) |
lock horizontal starting position
static function beginMainMenuBar | ( | ) |
create and append to a full screen menu-bar.
create a sub-menu entry. only call EndMenu() if this returns true!
label | string |
enabled | boolean |
static function beginMenuBar | ( | ) |
append to menu-bar of current window (requires ImGuiWindowFlags_MenuBar flag set on parent window).
return true if the popup is open, and you can start outputting to it.
str_id | string |
flags | number |
static function beginPopupContextItem | ( | ) |
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!
static function beginPopupContextVoid | ( | ) |
open+begin popup when clicked in void (where there are no windows).
static function beginPopupContextWindow | ( | ) |
open+begin popup when clicked on current window.
return true if the modal is open, and you can start outputting to it.
name | string |
open | boolean optional, nullable |
flags | number optional |
create and append into a TabBar
str_id | string |
flags | number |
create a Tab. Returns true if the Tab is selected.
name | string |
open | boolean optional, nullable |
flags | number optional |
static function beginTooltip | ( | ) |
begin/append a tooltip window. to create full-featured tooltip (with any kind of items).
static function bullet | ( | ) |
draw a small circle and keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses
static function calcItemWidth | ( | ) |
width of item given pushed settings and current cursor position
calculate coarse clipping for large list of evenly sized items. Prefer using the ImGuiListClipper higher-level helper if you can.
items_count | number |
items_height | number |
static function calcTextSize | ( | local | text, |
local | text_end, | ||
local | hide_text_after_double_hash, | ||
local | wrap_width | ||
) |
text | string |
text_end | string |
hide_text_after_double_hash | boolean |
wrap_width | number |
static function captureKeyboardFromApp | ( | ) |
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.
static function captureMouseFromApp | ( | ) |
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.
label | string |
v | boolean |
label | string |
flags | number |
flags_value | number |
static function clear | ( | ) |
static function closeCurrentPopup | ( | ) |
manually close the popup we have begin-ed into.
if returning 'true' the header is open. doesn't indent nor push on ID stack. user doesn't have to call TreePop().
when 'open' is given, display an additional small close button on upper right of the header
label | string |
open | boolean |
flags | number |
label | string |
color | number[] |
flags | number |
label | string |
color | number[] |
flags | number |
label | string |
color | number[] |
flags | number |
label | string |
color | number[] |
flags | number |
ref_color | number[] |
static function columns | ( | ) |
static function combo | ( | local | label, |
local | current_item, | ||
local | items, | ||
local | popup_max_height_in_items | ||
) |
combo
label | string |
current_item | number |
items | string[] |
popup_max_height_in_items | number |
static function create | ( | ) |
static function createLayer | ( | ) |
static function debugCheckVersionAndDataLayout | ( | local | version_str, |
local | sz_io, | ||
local | sz_style, | ||
local | sz_vec2, | ||
local | sz_vec4, | ||
local | sz_drawvert, | ||
local | sz_drawidx | ||
) |
version_str | string |
sz_io | number |
sz_style | number |
sz_vec2 | number |
sz_vec4 | number |
sz_drawvert | number |
sz_drawidx | number |
static function destroyPlatformWindows | ( | ) |
call DestroyWindow platform functions for all viewports. call from back-end Shutdown() if you need to close platform windows before imgui shutdown. otherwise will be called by DestroyContext().
id | number |
size | ImVec2 |
flags | number |
static function dockSpaceOverViewport | ( | ) |
static function dragFloat | ( | local | label, |
local | value, | ||
local | v_speed, | ||
local | v_min, | ||
local | v_max, | ||
local | format, | ||
local | power | ||
) |
label | string |
value | number |
v_speed | number |
v_min | number |
v_max | number |
format | string |
power | number |
static function dragFloatN | ( | local | label, |
local | array, | ||
local | v_speed, | ||
local | v_min, | ||
local | v_max, | ||
local | format, | ||
local | power | ||
) |
label | string |
array | number[] |
v_speed | number |
v_min | number |
v_max | number |
format | string |
power | number |
static function dragInt | ( | local | label, |
local | value, | ||
local | v_speed, | ||
local | v_min, | ||
local | v_max, | ||
local | format, | ||
local | power | ||
) |
label | string |
value | number |
v_speed | number |
v_min | number |
v_max | number |
format | string |
power | number |
static function dragIntN | ( | local | label, |
local | array, | ||
local | v_speed, | ||
local | v_min, | ||
local | v_max, | ||
local | format, | ||
local | power | ||
) |
label | string |
array | number[] |
v_speed | number |
v_min | number |
v_max | number |
format | string |
power | number |
add a dummy item of given size. unlike InvisibleButton(), Dummy() won't take the mouse click or be navigable into.
size | ImVec2 |
static function endChild | ( | ) |
static function endChildFrame | ( | ) |
always call EndChildFrame() regardless of BeginChildFrame() return values (which indicates a collapsed/clipped window)
static function endCombo | ( | ) |
only call EndCombo() if BeginCombo() returns true!
static function endDragDropSource | ( | ) |
only call EndDragDropSource() if BeginDragDropSource() returns true!
static function endDragDropTarget | ( | ) |
only call EndDragDropTarget() if BeginDragDropTarget() returns true!
static function endFrame | ( | ) |
static function endGroup | ( | ) |
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.)
static function endMainMenuBar | ( | ) |
only call EndMainMenuBar() if BeginMainMenuBar() returns true!
static function endMenu | ( | ) |
only call EndMenu() if BeginMenu() returns true!
static function endMenuBar | ( | ) |
only call EndMenuBar() if BeginMenuBar() returns true!
static function endPopup | ( | ) |
only call EndPopup() if BeginPopupXXX() returns true!
static function endTabBar | ( | ) |
only call EndTabBar() if BeginTabBar() returns true!
static function endTabItem | ( | ) |
only call EndTabItem() if BeginTabItem() returns true!
static function endToLua | ( | ) |
static function endTooltip | ( | ) |
static function get | ( | ) |
get background draw list for the given viewport. this draw list will be the first rendering one. Useful to quickly draw shapes/text behind dear imgui contents.
viewport | imgui.ImGuiViewport |
static function getClipboardText | ( | ) |
static function getColumnIndex | ( | ) |
get current column index
static function getColumnOffset | ( | ) |
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
static function getColumnsCount | ( | ) |
Tab Bars, Tabs
static function getColumnWidth | ( | ) |
get column width (in pixels). pass -1 to use current column
static function getContentRegionMax | ( | ) |
current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates
static function getCursorPos | ( | ) |
cursor position in window coordinates (relative to window position)
static function getCursorPosX | ( | ) |
(some functions are using window-relative coordinates, such as: GetCursorPos, GetCursorStartPos, GetContentRegionMax, GetWindowContentRegion* etc.
static function getCursorPosY | ( | ) |
other functions such as GetCursorScreenPos or everything in ImDrawList::
static function getCursorScreenPos | ( | ) |
cursor position in absolute screen coordinates [0..io.DisplaySize] (useful to work with ImDrawList API)
static function getDragDropPayload | ( | ) |
peek directly into the current payload from anywhere. may return NULL. use ImGuiPayload::IsDataType() to test for the payload type.
static function getFont | ( | ) |
get current font
static function getFontSize | ( | ) |
get current font size (= height in pixels) of current font with current scale applied
static function getFontTexUvWhitePixel | ( | ) |
get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API
get foreground draw list for the given viewport. this draw list will be the last rendered one. Useful to quickly draw shapes/text over dear imgui contents.
viewport | imgui.ImGuiViewport |
static function getFrameCount | ( | ) |
get global imgui frame count. incremented by 1 every frame.
static function getFrameHeight | ( | ) |
~ FontSize + style.FramePadding.y * 2
static function getFrameHeightWithSpacing | ( | ) |
~ FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets)
Widgets: Text
str_id_begin | string |
str_id_end | string |
static function getIO | ( | ) |
access the IO structure (mouse/keyboard/gamepad inputs, time, various configuration options/flags)
static function getItemRectMax | ( | ) |
get lower-right bounding rectangle of the last item (screen space)
static function getItemRectMin | ( | ) |
get upper-left bounding rectangle of the last item (screen space)
map ImGuiKey_* values into user's key index. == io.KeyMap[key]
imgui_key | number |
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
key_index | number |
repeat_delay | number |
rate | number |
static function getMainViewport | ( | ) |
main viewport. same as GetPlatformIO().MainViewport == GetPlatformIO().Viewports[0].
static function getMouseCursor | ( | ) |
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
static function getMouseDragDelta | ( | ) |
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.
static function getMousePos | ( | ) |
shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
static function getMousePosOnOpeningCurrentPopup | ( | ) |
retrieve backup of mouse position at the time of opening popup we have BeginPopup() into
static function getScrollMaxX | ( | ) |
get maximum scrolling amount ~~ ContentSize.X - WindowSize.X
static function getScrollMaxY | ( | ) |
get maximum scrolling amount ~~ ContentSize.Y - WindowSize.Y
static function getScrollX | ( | ) |
get scrolling amount [0..GetScrollMaxX()]
static function getScrollY | ( | ) |
get scrolling amount [0..GetScrollMaxY()]
static function getStyle | ( | ) |
access the Style structure (colors, sizes). Always use PushStyleCol(), PushStyleVar() to modify style mid-frame.
get a string corresponding to the enum value (for display, saving, etc.).
idx | number |
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.
idx | number |
static function getTextLineHeight | ( | ) |
~ FontSize
static function getTextLineHeightWithSpacing | ( | ) |
~ FontSize + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of text)
static function getTime | ( | ) |
get global imgui time. incremented by io.DeltaTime every frame.
static function getTreeNodeToLabelSpacing | ( | ) |
horizontal distance preceding label when using TreeNode*() or Bullet() == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode
static function getVersion | ( | ) |
get the compiled version string e.g. "1.23" (essentially the compiled value for IMGUI_VERSION)
static function getWindowContentRegionMax | ( | ) |
content boundaries max (roughly (0,0)+Size-Scroll) where Size can be override with SetNextWindowContentSize(), in window coordinates
static function getWindowContentRegionMin | ( | ) |
content boundaries min (roughly (0,0)-Scroll), in window coordinates
static function getWindowContentRegionWidth | ( | ) |
static function getWindowDockID | ( | ) |
static function getWindowDpiScale | ( | ) |
get DPI scale currently associated to the current window's viewport.
static function getWindowDrawList | ( | ) |
get draw list associated to the current window, to append your own drawing primitives
static function getWindowHeight | ( | ) |
get current window height (shortcut for GetWindowSize().y) Prefer using SetNextXXX functions (before Begin) rather that SetXXX functions (after Begin).
static function getWindowPos | ( | ) |
get current window position in screen space (useful if you want to do your own drawing via the DrawList API)
static function getWindowViewport | ( | ) |
get viewport currently associated to the current window.
static function getWindowWidth | ( | ) |
get current window width (shortcut for GetWindowSize().x)
static function hide | ( | ) |
static function indent | ( | ) |
move content position toward the right, by style.IndentSpacing or indent_w if != 0
static function inputFloat | ( | local | label, |
local | v, | ||
local | step, | ||
local | step_fase, | ||
local | format, | ||
local | flags | ||
) |
label | string |
v | number |
step | number |
step_fase | number |
format | string |
flags | number |
static function inputFloatN | ( | local | label, |
local | v, | ||
local | step, | ||
local | step_fase, | ||
local | format, | ||
local | flags | ||
) |
label | string |
v | number[] |
step | number |
step_fase | number |
format | string |
flags | number |
label | string |
v | number |
step | number |
step_fast | number |
flags | number |
label | string |
v | number[] |
step | number |
step_fase | number |
flags | number |
inputText
label | string |
str | string |
flags | number |
inputTextWithHint
label | string |
hint | string |
str | string |
flags | number |
button behavior without the visuals, frequently useful to build custom behaviors using the public api (along with IsItemActive, IsItemHovered, etc.)
str_id | string |
size | ImVec2 |
static function isAnyItemActive | ( | ) |
is any item active?
static function isAnyItemFocused | ( | ) |
is any item focused?
static function isAnyItemHovered | ( | ) |
is any item hovered?
static function isAnyMouseDown | ( | ) |
is any mouse button held
static function isItemActivated | ( | ) |
was the last item just made active (item was previously inactive).
static function isItemActive | ( | ) |
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)
static function isItemClicked | ( | ) |
is the last item clicked? (e.g. button/node just clicked on) == IsMouseClicked(mouse_button) && IsItemHovered()
static function isItemDeactivated | ( | ) |
was the last item just made inactive (item was previously active). Useful for Undo/Redo patterns with widgets that requires continuous editing.
static function isItemDeactivatedAfterEdit | ( | ) |
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).
static function isItemEdited | ( | ) |
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.
static function isItemFocused | ( | ) |
is the last item focused for keyboard/gamepad navigation?
static function isItemHovered | ( | ) |
is the last item hovered? (and usable, aka not blocked by a popup, etc.). See ImGuiHoveredFlags for more options.
static function isItemToggledOpen | ( | ) |
was the last item open state toggled? set by TreeNode().
static function isItemVisible | ( | ) |
is the last item visible? (items may be out of sight because of clipping/scrolling)
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[]!
user_key_index | number |
was key pressed (went from !Down to Down). if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate
user_key_index | number |
repeat_ | boolean |
was key released (went from Down to !Down)..
user_key_index | number |
did mouse button clicked (went from !Down to Down) (0=left, 1=right, 2=middle)
button | number |
repeat_ | boolean |
did mouse button double-clicked. a double-click returns false in IsMouseClicked(). uses io.MouseDoubleClickTime.
button | number |
is mouse button held (0=left, 1=right, 2=middle)
button | number |
is mouse dragging? (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold)
button | number |
lock_threshold | number |
by convention we use (-FLT_MAX,-FLT_MAX) to denote that there is no mouse
mouse_pos | ImVec2 optional |
did mouse button released (went from Down to !Down)
button | number |
return true if the popup is open.
str_id | string |
flags | number |
static function isVisible | ( | ) |
static function isWindowAppearing | ( | ) |
static function isWindowCollapsed | ( | ) |
static function isWindowDocked | ( | ) |
is current window docked into another window?
static function isWindowFocused | ( | ) |
is current window focused? or its root/child, depending on flags. see flags for options.
static function isWindowHovered | ( | ) |
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!
display text+label aligned the same way as value+label widgets
label | string |
fmt | string |
label | string |
current_item | number |
items | string[] |
height_in_items | number |
static function listBoxFooter | ( | ) |
terminate the scrolling region. only call ListBoxFooter() if ListBoxHeader() returned true!
label | string |
items_count | number |
height_in_items | number |
call after CreateContext() and before the first call to NewFrame(). NewFrame() automatically calls LoadIniSettingsFromDisk(io.IniFilename).
ini_filename | string |
call after CreateContext() and before the first call to NewFrame() to provide .ini data from your own data source.
ini_data | string |
ini_size | number |
static function logButtons | ( | ) |
helper to display buttons for logging to tty/file/clipboard
static function logFinish | ( | ) |
stop logging (close file, etc.)
pass text data straight to log (without being displayed)
fmt | string |
static function logToClipboard | ( | ) |
start logging to OS clipboard
static function logToFile | ( | ) |
start logging to file
static function logToTTY | ( | ) |
start logging to tty (stdout)
return true when activated. shortcuts are displayed for convenience but not processed by ImGui at the moment
label | string |
shortcut | string optional, nullable |
selected | boolean optional |
enabled | boolean optional |
static function newFrame | ( | ) |
start a new Dear ImGui frame, you can submit any command from this point until Render()/EndFrame().
static function newLine | ( | ) |
undo a SameLine() or force a new line when in an horizontal-layout context.
static function nextColumn | ( | ) |
next column, defaults to current row or next row if the current row is finished
static function off | ( | ) |
call to mark popup as open (don't call every frame!).
str_id | string |
popup_flags | number |
static function openPopupContextItem | ( | ) |
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)
static function plotHistogram | ( | local | label, |
local | values, | ||
local | values_count, | ||
local | values_offset, | ||
local | overlay_text, | ||
local | scale_min, | ||
local | scale_max, | ||
local | graph_size, | ||
local | stride | ||
) |
label | string |
values | number[] |
values_count | number optional |
values_offset | number optional |
overlay_text | string optional, nullable |
scale_min | number optional |
scale_max | number optional |
graph_size | ImVec2 optional |
stride | number optional |
static function plotLines | ( | local | label, |
local | values, | ||
local | values_count, | ||
local | values_offset, | ||
local | overlay_text, | ||
local | scale_min, | ||
local | scale_max, | ||
local | graph_size, | ||
local | stride | ||
) |
label | string |
values | number[] |
values_count | number optional |
values_offset | number optional |
overlay_text | string optional, nullable |
scale_min | number optional |
scale_max | number optional |
graph_size | ImVec2 optional |
stride | number optional |
static function popAllowKeyboardFocus | ( | ) |
static function popButtonRepeat | ( | ) |
Cursor / Layout
static function popClipRect | ( | ) |
static function popFont | ( | ) |
static function popID | ( | ) |
pop from the ID stack.
static function popItemWidth | ( | ) |
static function popTextWrapPos | ( | ) |
fraction | number |
size_arg | ImVec2 |
overlay | string |
allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets
allow_keyboard_focus | boolean |
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.
repeat_ | boolean |
use NULL as a shortcut to push default font
font | imgui.ImFont |
push string into the ID stack (will hash string).
push integer into the ID stack (will hash integer).
id | number|string |
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 -1.0f always align width to the right side). 0.0f = default to ~2/3 of windows width,
item_width | number |
idx | number ImGuiCol |
color | ImVec4|number |
idx | number ImGuiStyleVar |
value | number|ImVec2 |
static function pushTextWrapPos | ( | ) |
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
use with e.g. if (RadioButton("one", my_value==1)) { my_value = 1; }
label | string |
active | boolean |
label | string |
v | number |
v_button | number |
static function render | ( | ) |
ends the Dear ImGui frame, finalize the draw data. You can get call GetDrawData() to obtain it and run your rendering function (up to v1.60, this used to call io.RenderDrawListsFn(). Nowadays, we allow and prefer calling your render function yourself.)
static function renderPlatformWindowsDefault | ( | ) |
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.
static function resetMouseDragDelta | ( | ) |
static function sameLine | ( | ) |
call between widgets or groups to layout them horizontally. X position given in window coordinates.
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).
ini_filename | string |
static function saveIniSettingsToMemory | ( | ) |
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.
"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
label | string |
selected | boolean |
flags | number |
size | ImVec2 |
static function separator | ( | ) |
separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator.
label | cc.Label |
col | number|ImVec4|boolean |
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.
flags | number |
set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column
column_index | number |
offset_x | number |
set column width (in pixels). pass -1 to use current column
column_index | number |
width | number |
are using the main, absolute coordinate system.
local_pos | ImVec2 |
GetWindowPos() + GetCursorPos() == GetCursorScreenPos() etc.)
local_x | number |
cursor position in absolute screen coordinates [0..io.DisplaySize]
pos | ImVec2 |
type is a user defined string of maximum 32 characters. Strings starting with '_' are reserved for dear imgui internal types.
type | string |
value | any |
flags | number |
static function setItemAllowOverlap | ( | ) |
allow last item to be overlapped by a subsequent item. sometimes useful with invisible buttons, selectables, etc. to catch unused area.
static function setItemDefaultFocus | ( | ) |
make last item the default focused item of a window.
static function setKeyboardFocusHere | ( | ) |
focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget. Use -1 to access previous widget.
index | number |
font | imgui.ImFont |
seperator | boolean |
scale | number optional |
f | fun(text:string,link:string,isImage:boolean) |
set desired cursor type
cursor_type | number |
set next TreeNode/CollapsingHeader open state.
is_open | boolean |
cond | number |
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 -1.0f always align width to the right side)
item_width | number |
set next window background color alpha. helper to easily modify ImGuiCol_WindowBg/ChildBg/PopupBg. you may also use ImGuiWindowFlags_NoBackground.
alpha | number |
set next window collapsed state. call before Begin()
collapsed | boolean |
cond | number |
set next window dock id (FIXME-DOCK)
dock_id | number |
cond | number |
static function setNextWindowFocus | ( | ) |
set next window to be focused / front-most. call before Begin()
set next window viewport
viewport_id | number |
adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position.
local_x | number |
center_x_ratio | number |
adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position.
local_y | number |
center_y_ratio | number |
static function setScrollHereX | ( | ) |
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.
static function setScrollHereY | ( | ) |
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.
set scrolling amount [0..GetScrollMaxX()]
scroll_x | number |
set scrolling amount [0..GetScrollMaxY()]
scroll_y | number |
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.
tab_or_docked_window_label | string |
set a text-only tooltip, typically use with ImGui::IsItemHovered(). override any previous call to SetTooltip().
fmt | string |
set named window collapsed state
name | string |
collapsed | boolean |
cond | number |
set named window to be focused / front-most. use NULL to remove focus.
name | string |
set font scale. Adjust IO.FontGlobalScale if you want to scale all windows
scale | number |
set named window position.
name | string |
pos | ImVec2 |
cond | number |
set named window size. set axis to 0.0f to force an auto-fit on this axis.
name | string |
size | ImVec2 |
cond | number |
static function show | ( | ) |
add font selector block (not a window), essentially a combo listing the loaded fonts.
label | string |
add style selector block (not a window), essentially a combo listing the default styles.
label | string |
static function showUserGuide | ( | ) |
add basic help/info block (not a window): how to manipulate ImGui as a end-user (mouse/keyboard controls).
static function shutdown | ( | ) |
static function sliderAngle | ( | local | label, |
local | v_rad, | ||
local | v_deg_min, | ||
local | v_deg_max, | ||
local | format | ||
) |
label | string |
v_rad | number |
v_deg_min | number |
v_deg_max | number |
format | string |
static function sliderFloat | ( | local | label, |
local | value, | ||
local | v_min, | ||
local | v_max, | ||
local | format, | ||
local | power | ||
) |
label | string |
value | number |
v_min | number |
v_max | number |
format | string |
power | number |
static function sliderFloatN | ( | local | label, |
local | array, | ||
local | v_min, | ||
local | v_max, | ||
local | format, | ||
local | power | ||
) |
label | string |
array | number[] |
v_min | number |
v_max | number |
format | string |
power | number |
label | string |
value | number |
v_min | number |
v_max | number |
format | string |
static function sliderIntN | ( | local | label, |
local | array, | ||
local | v_min, | ||
local | v_max, | ||
local | format, | ||
local | power | ||
) |
label | string |
array | number[] |
v_min | number |
v_max | number |
format | string |
button with FramePadding=(0,0) to easily embed within text
label | string |
static function spacing | ( | ) |
add vertical spacing.
static function styleColorsClassic | ( | ) |
classic imgui style
static function styleColorsDark | ( | ) |
new, recommended style (default)
static function styleColorsLight | ( | ) |
best used with borders and a custom, thicker font
shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt); PopStyleColor();
col | ImVec4 |
fmt | string |
shortcut for PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_TextDisabled]); Text(fmt); PopStyleColor();
fmt | string |
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.
text | string |
text_end | string |
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().
fmt | string |
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().
str_id | string |
fmt | string |
str_id | string |
flags | number |
fmt | string |
static function treePop | ( | ) |
~ Unindent()+PopId()
static function unindent | ( | ) |
move content position back to the left, by style.IndentSpacing or indent_w if != 0
static function updatePlatformWindows | ( | ) |
call in main loop. will call CreateWindow/ResizeWindow/etc. platform functions for each secondary viewport, and DestroyWindow for each inactive viewport.
static function vSliderFloat | ( | local | label, |
local | size, | ||
local | value, | ||
local | v_min, | ||
local | v_max, | ||
local | format, | ||
local | power | ||
) |
label | string |
size | ImVec2 |
value | number |
v_min | number |
v_max | number |
format | string |
power | number |
static function vSliderInt | ( | local | label, |
local | size, | ||
local | value, | ||
local | v_min, | ||
local | v_max, | ||
local | format | ||
) |
label | string |
size | ImVec2 |
value | number |
v_min | number |
v_max | number |
format | string |