Author Topic: How to always display one layer in front of any other layer  (Read 3058 times)

stingman

  • Guest
How to always display one layer in front of any other layer
« on: February 05, 2013, 12:07:52 AM »
Hello, so I have a Camera that displays all of the HUD in the layer "UI." 

I have another layer labeled "Pause."  This layer becomes active on Android when "OnApplicationPause" is triggered to be true, aka when the player resumes the app from a paused state (after receiving a phone call, re-opening from the menu bar etc).  I need everything displayed in the "Pause" layer to cover up anything visible in the UI layer (aka visibly display the pause layer in front of all other layers).  Currently the pause layer does display but it's set at the same visible level as the UI layer, so both of the layers show up together.  This is because the camera displaying the UI layer was already active when the application entered it's paused state, as it should be.  And of course the camera I'm using to display the "Pause" layer will ONLY see what is in the "Pause" layer, so this is not an error on my end, I'm simply trying to adjust the visibility of layers.

In short, does anyone have a solution to ensure the pause layer will always be shown in front of all other layers?

Thanks!
« Last Edit: February 05, 2013, 12:09:25 AM by stingman »

lime-green.at

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 60
    • View Profile
Re: How to always display one layer in front of any other layer
« Reply #1 on: February 05, 2013, 02:47:32 AM »
Do you want it to look something like that..


.. or is your pause menu filling the hole screen area?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to always display one layer in front of any other layer
« Reply #2 on: February 05, 2013, 09:57:02 AM »
You don't need multiple layers for that. Just create a new panel for your pause menu and bring it forward on the Z (-negative).