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.
Luau
ImGuiWindow:SliderInt(
label: string,
value: number,
minimum: number,
maximum: number,
callback: (number) -> ()
) -> ImGuiWindowParameters
Call this method with a ImGuiWindow receiver. The colon supplies self implicitly; a dot call must pass the receiver explicitly.
| Parameter | Type | Description |
|---|---|---|
label | string | Label beside the numeric field. |
value | number | Initial integer. |
minimum | number | Integer lower bound. |
maximum | number | Integer upper bound. |
callback | (number) -> () | Function receiving the submitted value. |
Returns
ImGuiWindowThe 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
Luau
local window = imgui.create("Example controls")
window:SliderInt("Items per page", 10, 1, 50, function(value)
print("Items:", value)
end)