Skip to content
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.

Preview

Methods

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.

Calls

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.

Example

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)

Sushi-3.1 🍣

Documentation
Class Reference
Best Practices

Feedback
Post an issue

Clone this wiki locally