Imgui Text Input Widgets
Hand-written imgui text-entry widgets (Lua only). Each returns (changed, new_text): changed is true on the frame the text was edited, and new_text is the current buffer contents (echoed back unchanged when no imgui frame is active). Lua holds the canonical string between frames; pass it back in on the next call.
InputText
function
imgui.InputText(label, current_text, [max_len=256], [flags=0]) returns changed, new_text
-- returns boolean -> assign to local/var
local my_result = InputText(
label, -- string
current_text, -- string
max_len, -- int
flags -- int
)
InputTextWithHint
function
imgui.InputTextWithHint(label, hint, current_text, [max_len=256], [flags=0]) returns changed, new_text
-- returns boolean -> assign to local/var
local my_result = InputTextWithHint(
label, -- string
hint, -- string
current_text, -- string
max_len, -- int
flags -- int
)
InputTextMultiline
function
imgui.InputTextMultiline(label, current_text, [max_len=4096], [width=0], [height=0], [flags=0]) returns changed, new_text
-- returns boolean -> assign to local/var
local my_result = InputTextMultiline(
label, -- string
current_text, -- string
max_len, -- int
width, -- float
height, -- float
flags -- int
)