ApiUiSlider
Class Description
Section titled “Class Description”Inherits from ApiUiBaseControl
Wraps a HSliderBar so scripts can read and change its value and react to changes.
Properties
Section titled “Properties”Type: int
Gets or sets the slider’s current value. Values outside MinValue/MaxValue are clamped.
MinValue
Section titled “MinValue”Type: int
Gets or sets the slider’s minimum value.
MaxValue
Section titled “MaxValue”Type: int
Gets or sets the slider’s maximum value.
No fields found.
No enums found.
Methods
Section titled “Methods”GetValue
Section titled “GetValue”Gets the slider’s current value. Used in python API
Return Type: int - The current value
SetValue
Section titled “SetValue”(value)
Sets the slider’s current value. Values outside MinValue/MaxValue are clamped.
Used in python API
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
value | int | ❌ No | The new value |
Return Type: ApiUiSlider - Returns this control so methods can be chained.
OnValueChanged
Section titled “OnValueChanged”(onValueChanged)
Add an onValueChanged callback to this slider, invoked whenever the value changes.
The callback function receives the new value as its only argument.
Example:
def on_change(value): API.SysMsg(f"Slider is now {value}")
slider = API.Gumps.CreateGumpSlider(200, 0, 100, 50)slider.OnValueChanged(on_change)
while True: API.ProcessCallbacks()Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
onValueChanged | object | ❌ No | The callback function that receives the new value |
Return Type: ApiUiSlider - Returns this control so methods can be chained.