Locking Slider Controls
by David Taylor · in Torque Game Builder · 09/04/2006 (6:52 pm) · 2 replies
I'm not sure if 'locking' was necessarily the correct term, but here is what I want to be able to to do.
I have a GuiSliderCtrl called PlayerStrength. When I slide the bar left and right, it assigns the value of the slider, (between 1 and 10), to the player's strength. Simple, right?
But what I want to do is have the only available options for numerical choices being whole numbers. (That is, 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10.) Presently, it will take anything, such as 3.0882 and 6.3235. I'd like the slider to have 'notches' where the only valid options are...so dragging the scroller would mean it would fall into one of these fixed positions, as opposed to finding any position along the line.
Does anyone understand what I'm trying to get at? It's surprisingly difficult to explain.
I have a GuiSliderCtrl called PlayerStrength. When I slide the bar left and right, it assigns the value of the slider, (between 1 and 10), to the player's strength. Simple, right?
But what I want to do is have the only available options for numerical choices being whole numbers. (That is, 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10.) Presently, it will take anything, such as 3.0882 and 6.3235. I'd like the slider to have 'notches' where the only valid options are...so dragging the scroller would mean it would fall into one of these fixed positions, as opposed to finding any position along the line.
Does anyone understand what I'm trying to get at? It's surprisingly difficult to explain.
About the author
#2
http://www.garagegames.com/mg/forums/result.thread.php?qt=50418
09/07/2006 (10:14 pm)
Thanks, Don. That did the trick, albeit not by default. I've decided to try using clusters of radio buttons instead, because I prefer the look, but that has brought it's own problems, lol.http://www.garagegames.com/mg/forums/result.thread.php?qt=50418
Torque Owner Don Schaper
XIX Software