Author Topic: Slider with positive and negative values  (Read 4143 times)

cfj

  • Guest
Slider with positive and negative values
« on: May 15, 2012, 09:43:32 AM »
In Unity's gui, it is pretty easy to create a slider that handles positive and negative values.  It seems like the UISlider.sliderValue in NGUI is always between 0 and 1.  Is it possible to create a slider that handles positive and negative values with NGUI?

loopyllama

  • Guest
Re: Slider with positive and negative values
« Reply #1 on: May 15, 2012, 09:58:00 AM »
why don't you just remap the values in your code when you read them.
float NegativeOneToOne = sliderValue * 2.0F - 1.0F; // make 0 to 1 slider value mapped to -1 to 1