Author Topic: UISlider 20 steps limitation  (Read 4847 times)

Samuraisa

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
UISlider 20 steps limitation
« on: April 18, 2014, 12:12:25 PM »
I'm setting slider.numberOfSteps parameter via code. And it behaves like this:
If gameObject.activeSelf == false when I set "numberOfSteps" parameter all works fine and I'll get so many steps as I need.
Else numberOfSteps automatically stricted to 20 steps.
I dono this is a bug or a feature? )

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UISlider 20 steps limitation
« Reply #1 on: April 18, 2014, 04:41:38 PM »
Why use steps at all if you need so many? If you need a value from 1 to 50, for example, you can always just do it after the fact:
  1. int myValue = Mathf.RoundToInt(slider.value * 50f);

Samuraisa

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: UISlider 20 steps limitation
« Reply #2 on: April 20, 2014, 08:38:46 PM »
Strange answer ) For visual purposes? Or what for they are exist at all?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UISlider 20 steps limitation
« Reply #3 on: April 22, 2014, 04:11:41 AM »
Steps are there to be very obvious -- like if you had a slider for difficulty -- Easy, Medium, and Hard -- 3 levels, clearly distinguishable. If you need as many as 50, there is little point in making them obvious like that as it would be near impossible to tell anyway. So instead it makes sense to adjust the value, not the slider.

Samuraisa

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: UISlider 20 steps limitation
« Reply #4 on: April 23, 2014, 01:52:36 AM »
Concrete example:
Amount/quantity selector for inventory things. For example I want drop some of my items with this amount/quantity selection, but player have "some_item_1 x3" and "some_item_2 x50". So, for x3 I must use the "obvious" technique and for x50 "unobvious" if slider width is enougth to see all 50 steps?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UISlider 20 steps limitation
« Reply #5 on: April 23, 2014, 05:42:22 AM »
Yes. That's what I would do. Past a certain threshold steps don't make sense anymore.