Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Lotti on January 07, 2015, 12:38:20 PM

Title: UISlider max step is 20!
Post by: Lotti on January 07, 2015, 12:38:20 PM
Why there is a limit on steps variable? and why is capped to 20?
Title: Re: UISlider max step is 20!
Post by: ArenMook on January 07, 2015, 01:08:17 PM
If you find yourself needing more, considering you really need a limit to begin with. Why not use a slider that doesn't have steps, and simply cap the returned value like so: int stepValue = Mathf.RoundToInt(slider.value * 50); <-- 50 steps
Title: Re: UISlider max step is 20!
Post by: Lotti on January 08, 2015, 04:13:44 AM
well i was just needing 26 steps, but finally i transformed 0 - 1 value to 0 - 25 array index.
Thank you :)
Title: Re: UISlider max step is 20!
Post by: play_edu on February 11, 2015, 05:58:36 AM
I want 25 step pleases help how to Do This.
Title: Re: UISlider max step is 20!
Post by: Nicki on February 11, 2015, 07:32:16 AM
  1. int numberOfSteps = 25;
  2. slider.value = Mathf.Round(slider.value * numberOfSteps ) / numberOfSteps;
  3.  
Title: Re: UISlider max step is 20!
Post by: play_edu on February 11, 2015, 08:21:18 AM
Thanks For Help. Can you give more help about. Becoz I'm Not a programmer. :-[
Title: Re: UISlider max step is 20!
Post by: ArenMook on February 11, 2015, 09:36:38 PM
Anything custom requires programming. You can't avoid it. I posted an example of how to have it be 50 steps earlier in the thread, and Nicki just gave you a different example. Both are just one line. If you can't do it, then stick to what you can get done without coding and don't use steps at all.