Author Topic: Min Max Slider  (Read 2722 times)

nathanqueija

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Min Max Slider
« on: December 04, 2014, 11:28:50 AM »
Hey Guys,

Do you know if it's possible to develop a dual slider with min and max values with NGUI? Do you have any examples?

Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Min Max Slider
« Reply #1 on: December 05, 2014, 12:49:33 AM »
Input field on one side, slider in the middle, input field on the other side.

Slider can remain 0 to 1. In your code that uses this value, simply do a Mathf.Lerp(firstInputValue, secondInputValue, slider.value);

nathanqueija

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: Min Max Slider
« Reply #2 on: December 05, 2014, 11:49:46 AM »
Hey ArenMook,

Thanks for the response. But actually I'd like to have two thumbs to control the min and max range value.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Min Max Slider
« Reply #3 on: December 05, 2014, 04:12:49 PM »
For that you will need to create a custom widget. NGUI's slider isn't meant to have two.

poolts

  • Newbie
  • *
  • Thank You
  • -Given: 6
  • -Receive: 0
  • Posts: 33
    • View Profile
Re: Min Max Slider
« Reply #4 on: December 05, 2014, 08:43:00 PM »
I developed this exact thing recently. If I remember when I get back home on Monday I can share it here.

Budde88

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Min Max Slider
« Reply #5 on: December 13, 2016, 10:40:33 AM »
Any chance you can share?

It's more convenient to have the ability to select the values you'd like,
they have this option with the native Unity sliders, but I'm an NGUI fan.