Immediate-mode windows and callback-driven controls.
Available functions
imgui.create
Creates a tracked ImGui window record and returns an ImGuiWindow object. The title argument defaults to “REAL_IM_UI” when omitted or nil. The title must be unique among currently tracked ImGui windows; creating another tracked window with the same title raises a Lua error.
imgui.setvsync
Updates the ImGui renderer’s vertical-synchronization preference. The current presentation path stores this preference but does not apply it.
ImGuiWindow.Button
Appends a button element to an ImGuiWindow and stores the callback. When the rendered button is clicked, the callback is queued and later invoked without arguments. The method returns the same ImGuiWindow object.
ImGuiWindow.Checkbox
Appends a checkbox element to an ImGuiWindow. The callback is invoked with the new boolean value when the checkbox changes, and the method returns the same ImGuiWindow object.
ImGuiWindow.CollapsingHeader
Appends a collapsing header start marker, immediately calls the content callback with the same ImGuiWindow object so it can append nested elements, then appends a header end marker. During rendering, nested elements are skipped while the header is collapsed. Callback errors are caught and not returned by this method.
ImGuiWindow.ColorPicker
Appends a RGBA color editor to an ImGuiWindow and stores the callback. Missing or nil color components default to 1.0. When the rendered editor changes, the callback is queued and later invoked with red, green, blue, and alpha. The method returns the same ImGuiWindow object.
ImGuiWindow.destroy
Destroys an ImGuiWindow. If the object still points to a window, the method removes that window from Real’s tracked ImGui window list, unreferences stored element callbacks, deletes the window record, and sets the Instance reference to nil. Calling destroy again on the same object returns without doing anything.
ImGuiWindow.InputText
Appends a single-line ImGui InputText element to an ImGuiWindow and stores the callback. The initial text is read with optional string handling and copied into the element’s fixed 256-byte text buffer. When the rendered input changes, the callback is queued and later invoked with the current string. The method returns the same ImGuiWindow object.
ImGuiWindow.SameLine
Adds a layout marker so the next rendered item can continue on the same row.
ImGuiWindow.Separator
Adds a separator line to the window.
ImGuiWindow.SliderFloat
Adds a floating-point slider to the window. The label, value, minimum, and maximum arguments are required. When the user changes the slider, the callback receives the updated numeric value.
ImGuiWindow.SliderInt
Adds an integer slider to the window. The label, value, minimum, and maximum arguments are required. When the user changes the slider, the callback receives the updated integer value.
ImGuiWindow.Text
Adds non-interactive text to the window. The text argument must be a string.