-
-
Notifications
You must be signed in to change notification settings - Fork 8
Slider
João Cardoso edited this page Dec 5, 2019
·
5 revisions
Slider is a slider class which inherits from Labeled and OptionsSliderTemplate. Uses a DarkEdit internally.
Name | Description |
---|---|
SetPattern (pattern) | Sets the format used to display the slider's value, where "%s" is the current value. |
GetPattern | Returns the format string being used to display the slider's value. |
SetRange (min, max [,minText] [,maxText]) | Sets the slider's minimum and maximum values. |
GetRange | Returns the slider's minimum and maximum values. |
Name | Description |
---|---|
OnValue (value), OnInput (value) | Fired when the slider's value is changed by the user. Passes the new value. |
OnUpdate | Fired after OnValue and OnInput when user interaction is complete. |
local slider = LibStub('Sushi-3.1').Slider()
slider:SetLabel('Depth')
slider:SetRange(0, 100, 'Low', 'High')
slider:SetPattern('%s%') -- show values in percentage
slider:SetCall('OnValue', function(slider, value)
if value > 80 then
print("That's deep!")
elseif value > 30 then
print("You're going down.")
else
print("Scared of the bottom, heh?")
end
end)
This is the Sushi-3.1 wiki. Wiki Home