Author Topic: UISlider max step is 20!  (Read 3378 times)

Lotti

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 47
    • View Profile
UISlider max step is 20!
« on: January 07, 2015, 12:38:20 PM »
Why there is a limit on steps variable? and why is capped to 20?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UISlider max step is 20!
« Reply #1 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

Lotti

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 47
    • View Profile
Re: UISlider max step is 20!
« Reply #2 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 :)

play_edu

  • Newbie
  • *
  • Thank You
  • -Given: 10
  • -Receive: 0
  • Posts: 21
    • View Profile
Re: UISlider max step is 20!
« Reply #3 on: February 11, 2015, 05:58:36 AM »
I want 25 step pleases help how to Do This.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: UISlider max step is 20!
« Reply #4 on: February 11, 2015, 07:32:16 AM »
  1. int numberOfSteps = 25;
  2. slider.value = Mathf.Round(slider.value * numberOfSteps ) / numberOfSteps;
  3.  

play_edu

  • Newbie
  • *
  • Thank You
  • -Given: 10
  • -Receive: 0
  • Posts: 21
    • View Profile
Re: UISlider max step is 20!
« Reply #5 on: February 11, 2015, 08:21:18 AM »
Thanks For Help. Can you give more help about. Becoz I'm Not a programmer. :-[

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UISlider max step is 20!
« Reply #6 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.