Author Topic: Camera in UI Root 3D putting Example 4 into my 2d Game...  (Read 3517 times)

codejoy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Camera in UI Root 3D putting Example 4 into my 2d Game...
« on: February 24, 2015, 03:33:39 PM »
I am confused I guess by the camera that is part of the UI Root 3D?  In the Example for, this looked great, I loved how the menu flew in and out, and I created even a test scene in the NGUI examples that let me bring up that window when escape was pressed (As if it was a pause menu).  I guess I had thought the Camera in that UI Root 3D that is part of all the NGUI stuff would "take over" when the Root was active.  After I got the window working and running how I wanted it from example 4 I saved it off as a prefab and copied it all to my main game project.

Though when adding it to the scene, it does not take up the whole screen and looks odd, not like it should...attached graphics in hope of figuring out what I am missing or doing wrong.


I want the window to show up like it does in pauseMenuUp.png, alas it shows up (when enabled or when it will be paused) like it does in ingame.png, I was hoping the camera in the UI Root(3d) would take over and it would look like pauseMenuUp does.

Attached are the various settings I have it is pretty much unchanged from Example 4, just trying to put it into my game that is 2d with a perspective camera of its own.

« Last Edit: February 24, 2015, 03:39:37 PM by codejoy »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Camera in UI Root 3D putting Example 4 into my 2d Game...
« Reply #1 on: February 27, 2015, 04:33:20 AM »
Check your layers, clear flags and camera's depth.

UI camera should only see the UI layer, while your game camera should not see the UI layer.

Your UI camera should have a higher depth than your game camera.

Your UI camera should have its clear flags set to "Depth".