Haydenmango Posted July 30, 2019 Share Posted July 30, 2019 I created an audio options menu that has sliders for different sound sources. The problem is the sliders range seems to be 0-9 and I want it to be 0-10. I looked in the documentation, these forums, and through the slider script but can't figure out how to change the range. Is there anyway to change the slider range? Quote Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
Josh Posted August 1, 2019 Share Posted August 1, 2019 local window = Window:Create() local context = Context:Create(window) local gui = GUI:Create(context) local base = gui:GetBase() base:SetScript("Scripts/GUI/Panel.lua") x=20 y=20 local sep=30 widget = Widget:Slider(x,y,300,20,base) y=y+sep widget = Widget:Slider(x,y,300,20,base) widget:SetStyle(SLIDER_TRACKBAR) widget:SetRange(1,20) y=y+sep while true do if window:Closed() then return end if window:KeyHit(Key.Escape) then return end while EventQueue:Peek() do local event = EventQueue:Wait() if event.id == Event.WidgetAction then System:Print("WidgetAction") elseif event.id == Event.WidgetSelect then System:Print("WidgetSelect") end end context:Sync() end 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Haydenmango Posted August 2, 2019 Author Share Posted August 2, 2019 Oh, nice! Didn't know widget:SetRange() was a thing. Just tested it out with my gui and it's working perfectly. Would be cool to add that command under one or more of the sliders you make in the documentation example. Thanks Josh! Quote Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.