Author Topic: Block Objects in the Background of a PopUp  (Read 1811 times)

Chaosgod_Espér

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 28
    • View Profile
Block Objects in the Background of a PopUp
« on: March 05, 2015, 05:21:29 AM »
hi there..

I created a Root UI Object, that contains ALL the GUI of my game as children. To switch UIs, i use SetActive(true/false) to their WindowBG Object. So my Hierarchy looks like this:

Now, i created a PopUop Infowindow.


This should stay in the foreground when activated. And all Buttons or GUI in the Background should be blocked. Therefor i added a background Blocker. This is just a simple Sprite with a black background made with alpha set to 50 (of 255). So the background gets a little bit darker.
The Sprite has a Box collider attached, to cover the whole area.
To make the Sprite been set on a higher level than all the other UIs, i set its depth to 900. The Infowindow has a depth of 1000.




Now, when i SetActive the InfoWindow, the Window itself activates the Background Blocker.

BUT - all other Buttons can be highlighted and pushed again.. as if the collider isn´t there..


What could be wrong.. As if i remember right, NGUI uses thr depth value for the collider system..

And for testing (as you can see on my inspector Screen), i pushed the Background Blocker´s Z position in front of all others (expect infoWindow)
Means:
  1. Camera > InfoWindow > Blocker > Others


any ideas?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Block Objects in the Background of a PopUp
« Reply #1 on: March 05, 2015, 10:12:01 PM »
You need to put the blocker on its own panel that has a higher depth than any other panel in the game.