Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: cfj on May 15, 2012, 09:43:32 AM

Title: Slider with positive and negative values
Post by: cfj 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?
Title: Re: Slider with positive and negative values
Post by: loopyllama 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