Author Topic: Hide panel when mouse exit unerlaying panel  (Read 2040 times)

Linus

  • Guest
Hide panel when mouse exit unerlaying panel
« on: July 25, 2012, 02:49:58 AM »
Does anyone have a suggestion on how to best solve this case:

I have 3 panels

A panel has some boxes, when clicked a panel with a popup list shows up in front of this panel
When the mouse leave the area, I wish to hide the popup panel.

I tried to use OnMouseExit() on the underlaying panel. But this will trigger when mouse enters the popup panel as well. As it should.

How would you guys solve this case?

Thank you for your time

EDIT: I am also looking for a way to close/hide the panel if the user clicks anywhere but the popup list
« Last Edit: July 25, 2012, 06:08:58 AM by Linus »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Hide panel when mouse exit unerlaying panel
« Reply #1 on: July 25, 2012, 07:29:26 AM »
OnMouseExit() is a Unity function. You need to use an NGUI one.

OnSelect(false) will be sent to the panel when you click on something else (which is how I hide the popup list). OnHover(false) will be sent when the mouse hovers away.