Author Topic: NGUI slider / tooltip quick questions  (Read 8009 times)

primus88

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 50
    • View Profile
NGUI slider / tooltip quick questions
« on: August 31, 2013, 02:53:16 PM »
Hello guys,

I have two questions as I couldn't find a way to implement this :

1. I have a slider. How can I implement a method where if I click anywhere on the slider it modifies to that position ? So you are able to change the slider value either by clicking anywhere on it or by dragging the nob of the slider.
2. How can I make the tooltip appear faster (even instant) ? I know how to alter the transition time, but how about the actual time when the tooltip begins to show from the moment you hover with mouse pointer over the trigger.

Thank you.

LightSky

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 2
  • Posts: 56
    • View Profile
Re: NGUI slider / tooltip quick questions
« Reply #1 on: August 31, 2013, 07:19:35 PM »
I haven't tinkered with slider at all so I can't really say, however you can change the Tooltip settings via the UI Camera in the inspector.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: NGUI slider / tooltip quick questions
« Reply #2 on: August 31, 2013, 08:24:50 PM »
Measure the click's relative position on the collider and translate into slider values between 0-1.

Doesn't it do this default? I'm sure I've seen it in the examples.

LightSky

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 2
  • Posts: 56
    • View Profile
Re: NGUI slider / tooltip quick questions
« Reply #3 on: September 01, 2013, 12:47:32 AM »
Doesn't it do this default? I'm sure I've seen it in the examples.

Ya, just tried it in the example scene and it works fine off the bat with the click's relative position.

primus88

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 50
    • View Profile
Re: NGUI slider / tooltip quick questions
« Reply #4 on: September 01, 2013, 04:55:19 AM »
That is the UIScrollBar, I have the UISlider.

Anyone knows how to have the same functionality for the slider ?

primus88

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 50
    • View Profile
Re: NGUI slider / tooltip quick questions
« Reply #5 on: September 01, 2013, 09:52:05 AM »
Found the problem.
For the camera GUI the event receiver was 'GUI' layer set for me, while the slider had 'default' layer. Changing the layer to 'GUI' solved it.

Thanks guys. Now I have solutions for both issues.