Currently Roblox does not offer a proper ‘Slider’ object for Gui’s. The closest we have to a slider is a ScrollingFrame, but you’re often better off programming your own slider if you don’t want your slider to be attached to a frame; getting the position of the scrollbar itself is a bit awkward because you have to read the CanvasPosition property and using a Scrolling Frame is just a hacky substitute in general. Programming your own slider isn’t a good solution either though. Especially the boundaries can be a real pain to program. I therefore request a new Gui element: a Slider.
A slider has many use cases. If you want to make your own music player you might want to use a slider to change the volume of a song. A slider can also have multiple uses in character creators. You can use a slider to rotate the character model you’re making or you can use it to quickly change the color of your character’s hair.
I think a ‘Slider’ object would be a great addition for beginning developer as it allows them to be more creative with UI development, but a slider would also prevent a lot of headaches among the more experienced developers; although it’s a simple feature on paper, it’s not something you want to make yourself.
As much as I like the idea I doubt it will be implemented because it’s not too difficult to create your own. IIRC the last time I made one it was an ImageButton and I detected when the player clicked and held their mouse and how far they moved it in either the x or y direction depending on which way the slider went.
If we go by the argument that it’s easy to create your own, then we might as well not have had TextButtons in the first place; you can just use a TextLabel instead and use a MouseEnter and MouseLeave event to check if the mouse is within the box and then use UserInputService to check when you click. Easy right?
In all seriousness though, given that we already have a ScrollingFrame this feature shouldn’t be hard to implement. Most of the code has already been written. Sliders can still be really useful for the examples I mentioned above. Most RPGs on Roblox have some kind of character creator system so they could benefit from this. Other games can also use this to easily change music volume instead of a toggle which either enables or disables music. Roblox is also a platform for all ages. More than half the people on this forum would be able to program something like this, yes, but there are so many beginners who could really use simple features like these. Just because you can make it yourself doesn’t mean it shouldn’t be added. And the fact that we already have ScrollingFrames makes it even more odd that we don’t just have a regular Slider object yet.
I’m pretty sure there’s a module script out there which might be sponsored by roblox and provides a function for creating a slider object as well as some other objects (drop down lists, etc.).
I think for the time being, I would prefer they stick to that and don’t add API bloat. We have the basic building blocks to create all GUI elements. I understand the draw for a slider object, but I think having a built in type for it might be overkill.
Also, if anyone knows of the module script I’m talking about, do me a favor and link it. I couldn’t tell you anything about it except that it has the GUI elements that you see on roblox’s GUIs.
The biggest problem with these more specific UI elements is style. By creating a default UI element with higher-level functionality, you get locked into a style that may not be fitting for your game. For instance, is the slider animated? Are there margins/padding between parts of it? Labels? Just look at the amount of configuration available on Java’s JSlider object.
I personally think that items of higher functionality should be designed by the user.
I have a lot of use for this but don’t want to make a thread for it, so here’s a bump. The make your own approach isn’t nearly as intuitive as being able to just place a bar in and have properties to change the slider image and having an easy number to reference in scripts. Sure I could make my own, but what about newer users that don’t have the scripting experience to be able to make one of these. With sound being more and more important in game development, being able to easily place sliders so users can change level of sound with such bars would be nice.