Author Topic: 3.5 Slider issues  (Read 1505 times)

NineTails

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
3.5 Slider issues
« on: March 19, 2014, 11:52:27 AM »
I'm having an issue getting my around the new slider in 3.5.

I've set up my slider so I can move it up and down but now I want to dynamically alter the slider so that it's length is equal to the length of one of my lists. How ever I know the slider only works on scale of 0-1.

How can I make it so the length of my slider is equal to that of a list with X amount inside it?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3.5 Slider issues
« Reply #1 on: March 20, 2014, 01:33:35 AM »
UISlider.value is always in 0-1 range, yes. What does it have to do with the length though? Slider length is defined by the size of the widget -- its width and its height. Not scale.

NineTails

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: 3.5 Slider issues
« Reply #2 on: March 20, 2014, 04:57:58 AM »
Ah ok.

My question still stands though. Is there a way I can set the width of this to equal my list length? I need to the two to sink,.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3.5 Slider issues
« Reply #3 on: March 20, 2014, 12:35:44 PM »
widget.width = Mathf.RoundToInt(scrollViewPanel.finalClipRegion.z);