Main Menu

Sliders

Started by starkhorn, 03 June 2015, 04:50:22

starkhorn

Hi,

I was playing with sliders and I'm trying to understand how they work. Now with scrollbar there is a method called setArrowScrollAmount which controls how big you can scroll up/down the scrollbar. I was looking for something similiar with the slider but there isn't any such method.

Basically what I am trying to achieve is to have a slider which only allows 4 or 5 positions. So you have the first position which is far left. Then if you try to move the slider button right, it will go to the next position which is say 50 pixels to the right etc. So it isn't a smooth movement, but a jump along the slider.

Unsure if this is feasible with a slider or if there is another widget that I should look into instead?

texus

setArrowScrollAmount will just set the amount of values to move when pressing the arrows or while scrolling. Setting this to a higher number will just make the thumb jump even more.

Smooth thumb movement was possible with neither scrollbar nor slider, so I decided to stop delaying it and just implement it right away. You can download the lastest version from the master branch on github and compile it yourself. Or if you don't want to compile it yourself you could ignore the issue and wait a month or so and then download tgui 0.6.9.