Author Topic: Depth issues using colliders  (Read 8101 times)

frarees

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 22
    • View Profile
Depth issues using colliders
« on: March 05, 2013, 06:28:55 AM »
Hi,

This is the scenario we would like to have:
  • The interface has several buttons
  • When clicking one of the buttons, a pop-up window appears. This window covers 75% of the screen.
  • The rest of the screen should be shaded and the user should not be allowed to interact with the previous buttons until the pop-up window is closed.

The way we try to solve this situation is:
  • When the pop-up window appears, we enable a GameObject to mask everything but the pop-up window itself
  • This GameObject has a UIStretch (to cover the whole screen), a UISprite (to provide it with a transparent grey colour) and a BoxCollider (to nullify the user interaction with the rest of the scenery)
  • The depth of the elements in the screen is lower than this "mask". The depth of the "mask" is lower than that of the pop-up window (and its elements)

The problems we've encountered is:
  • The "mask" works with only some of the the elements in the background: when we click on each button, some of them react, some of them don't (even though all of them have the same depth). All of them should masked. What works fine is: in this situation, the buttons in the pop-up screen react when clicked
  • If we change the BoxCollider's Z coordinate, the mask makes more buttons in the background not-clickable, but (again) not all of them (I insist, even though they all have the same depth). The problem here is that the BoxCollider also masks the buttons on the pop-up window (these have higher value in depth than the mask, so they should be OVER it)

We're a bit lost here with how NGUI manages the Z coordinate through the "depth" control, and how a BoxCollider in this structure works.

Can anyone shed a bit of light so that we end up having a "normal" user interface and a mask that disables the "clicks" on those controls when a pop-up window is active?

Thank you.

frarees

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 22
    • View Profile
Re: Depth issues using colliders
« Reply #1 on: March 05, 2013, 09:46:05 AM »
Shame on us. Reading the FAQ, we found a way to make it work.