imgui_add_widget
Add any of 80+ ImGui widget types—buttons, sliders, inputs, color pickers, trees, tables, menus, and more—to a target window in real-time, enabling AI agents to visually build and iterate on game UIs.
Instructions
Add a widget to an ImGui window. Supports 80+ widget types including buttons, text, inputs, sliders, drags, color pickers, combos, trees, tables, menus, popups, plots, containers, and tooltips.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Unique widget identifier | |
| dir | No | Direction for arrow_button (0=left, 1=right, 2=up, 3=down) | |
| max | No | Maximum value for float sliders/drag | |
| min | No | Minimum value for float sliders/drag | |
| hint | No | Hint/placeholder text for input_text_with_hint | |
| open | No | Open state for tree_node/collapsing_header/popup | |
| rows | No | Row data for table widget (array of arrays of strings) | |
| size | No | Size [w, h] for dummy, button, child_window, invisible_button | |
| step | No | Step increment for input widgets | |
| text | No | Initial text for input widgets | |
| color | No | RGBA color [r,g,b,a] each 0.0-1.0 | |
| flags | No | ImGui flags for the widget (e.g. checkbox_flags, tree_node_ex) | |
| items | No | Items for combo/listbox/menu | |
| label | No | Widget label/display text | |
| speed | No | Speed/sensitivity for drag widgets | |
| value | No | Float value (sliders, progress, drag, single-component) | |
| format | No | Format string for sliders/drag (e.g. '%.2f', '%d') | |
| values | No | Array of floats for multi-component widgets (float2/3/4, drag_range2) or plot data | |
| window | Yes | Target window id | |
| checked | No | Checkbox/radio button state | |
| columns | No | Number of columns for table widget | |
| content | No | Text content (for text widgets) | |
| enabled | No | Whether widget is enabled/interactable | |
| headers | No | Column headers for table widget | |
| int_max | No | Maximum for int sliders/drag | |
| int_min | No | Minimum for int sliders/drag | |
| overlay | No | Overlay text for progress_bar | |
| tooltip | No | Tooltip text shown on hover | |
| children | No | Nested child widgets (for tree_node, collapsing_header, menu, tab_item, group, child_window) | |
| selected | No | Selected index for combo/listbox/selectable | |
| shortcut | No | Keyboard shortcut string for menu_item (e.g. 'Ctrl+S') | |
| int_value | No | Integer value (int sliders, drag, single-component) | |
| step_fast | No | Fast step increment for input widgets (ctrl+click) | |
| int_values | No | Array of ints for multi-component int widgets (int2/3/4) | |
| widget_type | Yes | Type of widget to create |