Author Topic: progress bar  (Read 2045 times)

sk1989

  • Guest
progress bar
« on: November 14, 2012, 02:17:13 PM »
Is there way for the progress bar to set it so that the foreground to start at certain slider value. instead of starting it from 0.

by me setting the sliderValue to 0.3 at initial.  I know that the progress shows me at 0.3 but what i am looking to do is to show a range in the progress bar which means i want the foreground to start filling at 0.3 and end filling at 0.7. is that possible ?

JRoch

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 140
    • View Profile
Re: progress bar
« Reply #1 on: November 14, 2012, 02:27:35 PM »
Track your "real" value independently, then re-base it to scale appropriately.

Deriving the value of the slider that has a range from 0f to 1f is:  0.3f + (slider_value * 0.4f)

Invert/complement if you want to set the value of the slider from an internal value in the range of 0.3f to 0.7f.
« Last Edit: November 14, 2012, 02:29:10 PM by JRoch »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: progress bar
« Reply #2 on: November 14, 2012, 04:16:21 PM »
Mathf.Lerp(0.3, 0.7, sliderValue);