ImGuiWindow:SliderInt Asynchronous

Add a numeric field for a whole-number setting such as a count or limit. Kawaii clamps a submitted number to the range and floors the resulting value.

Syntax
Luau
ImGuiWindow:SliderInt(
    label: string,
    value: number,
    minimum: number,
    maximum: number,
    callback: (number) -> ()
) -> 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
labelstringLabel beside the numeric field.
valuenumberInitial integer.
minimumnumberInteger lower bound.
maximumnumberInteger upper bound.
callback(number) -> ()Function receiving the submitted value.

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.

The initial value and both bounds must be integers. The control is an editable numeric field in this build.

Example

Example
Luau
local window = imgui.create("Example controls")
window:SliderInt("Items per page", 10, 1, 50, function(value)
    print("Items:", value)
end)
Kawaii documentation