ImGuiWindow:InputText Asynchronous

Add a short text field for a name, label, or similar setting. The callback receives the field’s contents when the person leaves the input.

Syntax
Luau
ImGuiWindow:InputText(
    label: string,
    text: string?,
    callback: (string) -> ()
) -> ImGuiWindow

Parameters

Call this method with a ImGuiWindow receiver. The colon supplies self implicitly; a dot call must pass the receiver explicitly.

Function parameters
ParameterTypeDescription
labelstringField label.
textstring?Optional starting text; nil starts empty.
callback(string) -> ()Function receiving the submitted string.

Returns

ImGuiWindow

The same ImGuiWindow handle, so more controls can be added with another method call.

Usage notes

The callback runs when the user interacts with the control. Its return value is ignored.

Initial and submitted text are limited to 255 bytes. Use another API for multiline documents.

Example

Example
Luau
local window = imgui.create("Example controls")
window:InputText("Preset name", "My preset", function(text)
    print("Name:", text)
end)
Kawaii documentation