Author Topic: preventing events from propagating to obscured panel?  (Read 3579 times)

Alan Gray

  • Guest
preventing events from propagating to obscured panel?
« on: May 10, 2012, 05:40:56 PM »
I have a panel that pops up on top of another panel. Mouse events are still getting generated for the panel "underneath". I've tried a couple of newb things without success: I tried to put a collider on the pop-up background Sprite, tried changing the depth of the two panels, and even tried to add an event-eater script to the pop-up background Sprite. And I searched the forum and didn't find anything.

What's the proper way to keep events from propagating through to an obscured panel?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: preventing events from propagating to obscured panel?
« Reply #1 on: May 10, 2012, 07:14:48 PM »
Generally you will want to have a collider that covers your entire window's background, with buttons sitting on top of it. Each "active" panel should also be offset on the transform's Z position so that it's in front of inactive ones.

Alan Gray

  • Guest
Re: preventing events from propagating to obscured panel?
« Reply #2 on: May 11, 2012, 04:20:23 PM »
It's working nicely now. My problem was a combination of some bad z values of the underlying widgets and a zero size collision box on the pop-up.  :-[
Thanks for the response. It let me know that I was on the right track.