Skip to content

ApiUiSlider

Inherits from ApiUiBaseControl Wraps a HSliderBar so scripts can read and change its value and react to changes.

Type: int

Gets or sets the slider’s current value. Values outside MinValue/MaxValue are clamped.

Type: int

Gets or sets the slider’s minimum value.

Type: int

Gets or sets the slider’s maximum value.

No fields found.

No enums found.

Gets the slider’s current value. Used in python API

Return Type: int - The current value


(value) Sets the slider’s current value. Values outside MinValue/MaxValue are clamped. Used in python API

Parameters:

NameTypeOptionalDescription
valueint❌ NoThe new value

Return Type: ApiUiSlider - Returns this control so methods can be chained.


(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:

NameTypeOptionalDescription
onValueChangedobject❌ NoThe callback function that receives the new value

Return Type: ApiUiSlider - Returns this control so methods can be chained.