Difference between revisions of "ImGui.Core"
(5 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
This is the ImGui main class. | This is the ImGui main class. | ||
+ | '''note''': the extension ''.Core'' in the Wiki is for organisational purposes only. ''ImGui.Core'' is '''ImGui''' | ||
− | ''' | + | '''note''': the documentation is work in progress |
'''Widgets: Color Editor/Picker''' | '''Widgets: Color Editor/Picker''' | ||
* tip: the ColorEdit* functions have a little color square that can be left-clicked to open a picker, and right-clicked to open an option menu | * tip: the ColorEdit* functions have a little color square that can be left-clicked to open a picker, and right-clicked to open an option menu | ||
− | |||
'''Widgets: Input with Keyboard''' | '''Widgets: Input with Keyboard''' | ||
* If you want to use InputText() with std::string or any custom dynamic string type, see misc/cpp/imgui_stdlib.h and comments in imgui_demo.cpp. | * If you want to use InputText() with std::string or any custom dynamic string type, see misc/cpp/imgui_stdlib.h and comments in imgui_demo.cpp. | ||
* Most of the ImGuiInputTextFlags flags are only useful for InputText() and not for InputFloatX, InputIntX, InputDouble etc. | * Most of the ImGuiInputTextFlags flags are only useful for InputText() and not for InputFloatX, InputIntX, InputDouble etc. | ||
− | |||
'''Widgets: Regular Sliders''' | '''Widgets: Regular Sliders''' | ||
Line 25: | Line 24: | ||
If you get a warning converting a float to ImGuiSliderFlags, read https://github.com/ocornut/imgui/issues/3361 | If you get a warning converting a float to ImGuiSliderFlags, read https://github.com/ocornut/imgui/issues/3361 | ||
− | |||
'''Widgets: Drag Sliders''' | '''Widgets: Drag Sliders''' | ||
Line 44: | Line 42: | ||
[[ImGui.Core:arrowButton|ImGui:arrowButton]] ''displays an ImGui arrow button''<br/><!--GIDEROSMTD:ImGui:arrowButton(stringID, direction) displays an ImGui arrow button--> | [[ImGui.Core:arrowButton|ImGui:arrowButton]] ''displays an ImGui arrow button''<br/><!--GIDEROSMTD:ImGui:arrowButton(stringID, direction) displays an ImGui arrow button--> | ||
− | [[ImGui.Core:beginWindow|ImGui:beginWindow]] ''pushes Window to the stack and starts appending to it''<br/><!--GIDEROSMTD:ImGui:beginWindow(name, p_open, flags) pushes a Window to the stack and starts appending to it--> | + | [[ImGui.Core:beginDisabled|ImGui:beginDisabled]] ''starts a stack that can be disabled''<br/><!--GIDEROSMTD:ImGui:beginDisabled(disabledFlag) starts a stack that can be disabled--> |
+ | [[ImGui.Core:beginWindow|ImGui:beginWindow]] ''pushes a Window to the stack and starts appending to it''<br/><!--GIDEROSMTD:ImGui:beginWindow(name, p_open, flags) pushes a Window to the stack and starts appending to it--> | ||
+ | [[ImGui.Core:beginTabBar|ImGui:beginTabBar]] ''pushes a TabBar to the stack and starts appending to it''<br/><!--GIDEROSMTD:ImGui:beginTabBar(str_id [, ImGui.TabBarFlags = 0]) pushes a TabBar to the stack and starts appending to it--> | ||
[[ImGui.Core:beginTable|ImGui:beginTable]] ''pushes a Table to the stack and starts appending to it''<br/><!--GIDEROSMTD:ImGui:beginTable(str_id, column [, ImGui.TableFlags = 0, outer_w = 0, outer_h = 0, inner_width = 0]) pushes Table to the stack and starts appending to it--> | [[ImGui.Core:beginTable|ImGui:beginTable]] ''pushes a Table to the stack and starts appending to it''<br/><!--GIDEROSMTD:ImGui:beginTable(str_id, column [, ImGui.TableFlags = 0, outer_w = 0, outer_h = 0, inner_width = 0]) pushes Table to the stack and starts appending to it--> | ||
[[ImGui.Core:bullet|ImGui:bullet]] ''displays an ImGui bullet''<br/><!--GIDEROSMTD:ImGui:bullet() displays an ImGui bullet--> | [[ImGui.Core:bullet|ImGui:bullet]] ''displays an ImGui bullet''<br/><!--GIDEROSMTD:ImGui:bullet() displays an ImGui bullet--> | ||
Line 67: | Line 67: | ||
[[ImGui.Core:dragIntRange2|ImGui:dragIntRange2]] ''displays 2 ImGui drag int range sliders''<br/><!--GIDEROSMTD:ImGui:dragIntRange2(label, valueMin, valueMax, [incStep=1, min=0, max=0, formatMinString="%d", formatMaxString=formatMinString, ImGuiSliderFlags=0]) displays 2 ImGui drag int range sliders--> | [[ImGui.Core:dragIntRange2|ImGui:dragIntRange2]] ''displays 2 ImGui drag int range sliders''<br/><!--GIDEROSMTD:ImGui:dragIntRange2(label, valueMin, valueMax, [incStep=1, min=0, max=0, formatMinString="%d", formatMaxString=formatMinString, ImGuiSliderFlags=0]) displays 2 ImGui drag int range sliders--> | ||
[[ImGui.Core:dragScalar|ImGui:dragScalar]] ''displays an ImGui drag scalar slider''<br/><!--GIDEROSMTD:ImGui:dragScalar(label, ImGuiDataType, value, v_speed, [v_min=nil, v_max=nil, format=nil, ImGuiSliderFlags=0]) displays an ImGui drag scalar slider--> | [[ImGui.Core:dragScalar|ImGui:dragScalar]] ''displays an ImGui drag scalar slider''<br/><!--GIDEROSMTD:ImGui:dragScalar(label, ImGuiDataType, value, v_speed, [v_min=nil, v_max=nil, format=nil, ImGuiSliderFlags=0]) displays an ImGui drag scalar slider--> | ||
+ | [[ImGui.Core:endDisabled|ImGui:endDisabled]] ''ends a stack that can be disabled''<br/><!--GIDEROSMTD:ImGui:endDisabled() ends a stack that can be disabled--> | ||
[[ImGui.Core:endFrame|ImGui:endFrame]] ''ends an ImGui Frame''<br/><!--GIDEROSMTD:ImGui:endFrame() ends an ImGui Frame--> | [[ImGui.Core:endFrame|ImGui:endFrame]] ''ends an ImGui Frame''<br/><!--GIDEROSMTD:ImGui:endFrame() ends an ImGui Frame--> | ||
[[ImGui.Core:endTable|ImGui:endTable]] ''pops a Table from the stack''<br/><!--GIDEROSMTD:ImGui:endTable() pops a Table from the stack--> | [[ImGui.Core:endTable|ImGui:endTable]] ''pops a Table from the stack''<br/><!--GIDEROSMTD:ImGui:endTable() pops a Table from the stack--> | ||
Line 114: | Line 115: | ||
[[ImGui.Core:setDarkStyle|ImGui:setDarkStyle]] ''sets a dark color style''<br/><!--GIDEROSMTD:ImGui:setDarkStyle() sets a dark color style--> | [[ImGui.Core:setDarkStyle|ImGui:setDarkStyle]] ''sets a dark color style''<br/><!--GIDEROSMTD:ImGui:setDarkStyle() sets a dark color style--> | ||
[[ImGui.Core:setLightStyle|ImGui:setLightStyle]] ''sets a light color style''<br/><!--GIDEROSMTD:ImGui:setLightStyle() sets a light color style--> | [[ImGui.Core:setLightStyle|ImGui:setLightStyle]] ''sets a light color style''<br/><!--GIDEROSMTD:ImGui:setLightStyle() sets a light color style--> | ||
+ | |||
+ | [[ImGui.Core:setNextWindowPos|ImGui:setNextWindowPos]] ''sets next windows position''<br/><!--GIDEROSMTD:ImGui:setNextWindowPos(x,y) sets next windows position--> | ||
+ | [[ImGui.Core:setNextWindowSize|ImGui:setNextWindowSize]] ''sets next windows size''<br/><!--GIDEROSMTD:ImGui:setNextWindowSize(w,h) sets next windows size--> | ||
+ | [[ImGui.Core:setNextWindowSizeConstraints|ImGui:setNextWindowSizeConstraints]] ''sets next windows size constraints''<br/><!--GIDEROSMTD:ImGui:setNextWindowSizeConstraints(min_w,min_h,max_w,max_h [,resize_callback,user_data]) sets next windows size constraints--> | ||
+ | |||
+ | |||
[[ImGui.Core:showAboutWindow|ImGui:showAboutWindow]] ''adds an ImGui About window''<br/><!--GIDEROSMTD:ImGui:showAboutWindow() adds an ImGui About window, displaying ImGui version, credits and build/system information--> | [[ImGui.Core:showAboutWindow|ImGui:showAboutWindow]] ''adds an ImGui About window''<br/><!--GIDEROSMTD:ImGui:showAboutWindow() adds an ImGui About window, displaying ImGui version, credits and build/system information--> | ||
[[ImGui.Core:showDemoWindow|ImGui:showDemoWindow]] ''adds an ImGui demo window''<br/><!--GIDEROSMTD:ImGui:showDemoWindow() adds an ImGui demo window--> | [[ImGui.Core:showDemoWindow|ImGui:showDemoWindow]] ''adds an ImGui demo window''<br/><!--GIDEROSMTD:ImGui:showDemoWindow() adds an ImGui demo window--> | ||
Line 194: | Line 201: | ||
---- | ---- | ||
'''[[Dear ImGui]]''' | '''[[Dear ImGui]]''' | ||
+ | {{GIDEROS IMPORTANT LINKS}} |
Latest revision as of 07:52, 11 September 2024
Supported platforms:
Available since: Gideros 2020.9
Description
This is the ImGui main class.
note: the extension .Core in the Wiki is for organisational purposes only. ImGui.Core is ImGui
note: the documentation is work in progress
Widgets: Color Editor/Picker * tip: the ColorEdit* functions have a little color square that can be left-clicked to open a picker, and right-clicked to open an option menu
Widgets: Input with Keyboard * If you want to use InputText() with std::string or any custom dynamic string type, see misc/cpp/imgui_stdlib.h and comments in imgui_demo.cpp. * Most of the ImGuiInputTextFlags flags are only useful for InputText() and not for InputFloatX, InputIntX, InputDouble etc.
Widgets: Regular Sliders * CTRL+Click on any slider to turn them into an input box. Manually input values aren't clamped and can go off-bounds. * Adjust format string to decorate the value with a prefix, a suffix, or adapt the editing and display precision e.g. "%.3f" -> 1.234; "%5.2f secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc. * Format string may also be set to NULL or use the default format ("%f" or "%d"). If you get a warning converting a float to ImGuiSliderFlags, read https://github.com/ocornut/imgui/issues/3361
Widgets: Drag Sliders * CTRL+Click on any drag box to turn them into an input box. Manually input values aren't clamped and can go off-bounds. * For all the Float2/Float3/Float4/Int2/Int3/Int4 versions of every functions, note that a 'float v[X]' function argument is the same as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible. You can pass address of your first element out of a contiguous set, e.g. &myvector.x * Adjust format string to decorate the value with a prefix, a suffix, or adapt the editing and display precision e.g. "%.3f" -> 1.234; "%5.2f secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc. * Format string may also be set to NULL or use the default format ("%f" or "%d"). * Speed are per-pixel of mouse movement (v_speed=0.2f: mouse needs to move by 5 pixels to increase value by 1). For gamepad/keyboard navigation, minimum speed is Max(v_speed, minimum_step_at_given_precision). * Use v_min < v_max to clamp edits to given limits. Note that CTRL+Click manual input can override those limits. * Use v_max = FLT_MAX / INT_MAX etc to avoid clamping to a maximum, same with v_min = -FLT_MAX / INT_MIN to avoid clamping to a minimum. * We use the same sets of flags for DragXXX() and SliderXXX() functions as the features are the same and it makes it easier to swap them.
MethodsImGui.new initializes ImGui ImGui:arrowButton displays an ImGui arrow button ImGui:setColorEditOptions sets the color edit options flag ImGui:setDarkStyle sets a dark color style ImGui:setNextWindowPos sets next windows position
|
EventsImGui.KeyChar ConstantsImGui._VERSION Backend Flags ImGui.CONST.BackendFlags |