Syntax
ImGuiWindow.InputText(window: ImGuiWindow, label: string, text?: string, onChange: function): ImGuiWindowArguments
| Name | Type | Description |
|---|---|---|
window | ImGuiWindow | Window returned by imgui.create. |
label | string | Text displayed beside the input. |
text? | string | Initial text; defaults to an empty string. |
onChange | function | Callback receiving the current string whenever the text changes. |
Returns
| Name | Type | Description |
|---|---|---|
window | ImGuiWindow | The same window handle, allowing chained method calls. |
Description
Appends a single-line text input and reports edited text through a callback.
Call it with 4 parameter(s): window, label, text, onChange. The argument table explains which values are required and which ones only refine the behavior.
It returns window (ImGuiWindow). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Example call with placeholder values.
local result = ImGuiWindow.InputText(nil, "example", "example", function() end)
print(result)Types
ImGuiWindow
Handle returned by imgui.create. Control-building methods return the same handle so calls can be chained.
Button (label: string, onClick: () -> ()) -> ImGuiWindow Appends a button and invokes the callback after a click.Checkbox (label: string, checked: boolean, onChange: (boolean) -> ()) -> ImGuiWindow Appends a checkbox initialized to the provided state.CollapsingHeader (label: string, content: (ImGuiWindow) -> ()) -> ImGuiWindow Groups controls appended by the content callback beneath a collapsing header.ColorPicker (label: string, red: number?, green: number?, blue: number?, alpha: number?, onChange: (number, number, number, number) -> ()) -> ImGuiWindow Appends an RGBA editor; omitted color components default to 1.0.InputText (label: string, text: string?, onChange: (string) -> ()) -> ImGuiWindow Appends a single-line text input; omitted initial text defaults to an empty string.SameLine () -> ImGuiWindow Places the next control on the same line.Separator () -> ImGuiWindow Appends a horizontal separator.SliderFloat (label: string, value: number, minimum: number, maximum: number, onChange: (number) -> ()) -> ImGuiWindow Appends a floating-point slider.SliderInt (label: string, value: integer, minimum: integer, maximum: integer, onChange: (number) -> ()) -> ImGuiWindow Appends an integer slider.Text (text: string) -> ImGuiWindow Appends non-interactive text.destroy () -> () Removes the window and releases its registered callbacks.