Author Topic: Sliders, Progress Bars, and OnHover  (Read 1911 times)

honeybadger_jay

  • Guest
Sliders, Progress Bars, and OnHover
« on: September 03, 2013, 10:48:35 PM »
Hi ArenMook,

I am creating a slider in my GUI that measures %PCT completion for skill levels (just a bit of background). I want to add a feature that displays the XP values in a label on top of this slider during mouseover. I'm using NData so binding this visibility was easy with a Slider component. I used the OnHover NGUI function with NData to turn a visibility binding on and off.

This works perfectly except the slider value can still be manipulated by mouse.

I tried replacing the Slider components with a Progress Bar widget. This works fine to lock the slider value from mouse control, but it no longer recieves OnHover events. As far as I can tell, the Slider becomes a Progress Bar when you delete the box collider component (and vice versa). So when I went to attach a new box collider to the Progress Bar I found that it becomes a Slider again.

I'm stuck between a rock and a hard place. Fix one problem, you get the other. Is there a clean solution for this problem? I was thinking I could create some sort of zombie such as a transparent Slider that does event recieving over top of my perfectly good progress bar. If I do want to make a Frankenstein, which NGUI components are compatible with OnHover that would be simplest? I tried it on the UILabel itself but NGUI kept inactivating the collider.

Thanks,
Jay




ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: Sliders, Progress Bars, and OnHover
« Reply #1 on: September 04, 2013, 02:58:15 AM »
> This works perfectly except the slider value can still be manipulated by mouse.

How about removing the Boxcollider from the object. Or adding a collider above that does nothing to mask out the input?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Sliders, Progress Bars, and OnHover
« Reply #2 on: September 04, 2013, 03:56:47 AM »
Yeah just remove the collider and it won't respond to events anymore.

Add a collider to a different object in the same place, and give that one your tooltip logic or whatever you were thinking of.