GUI that goes beyond the camera view?

I have a few questions related to camera and GUI management and game resolution:

  • Is it not possible to just shift the view of the camera - not what the camera sees, but the position at which the camera’s view is seen on screen? Using the “Normalized View Port Rectangle” X and Y coordinates does something like that, but it also makes the camera view smaller if I try to just adjust the position of the screen, so it’s not exactly the same thing.
  • Do GUI elements always need to be seen by a camera? In a situation where the camera view isn’t supposed to cover the whole screen (not even below the GUI stuff), how do you implement the GUI? With multiple cameras somehow? Well, that can be done, if the GUI is just a certain percentage of the screen on one side, but what if it should be a more neatly shaped image? This could be the case eg. when having a splitscreen operation with some common GUI stuff shared by the two screens.
  • When I publish and view the game in an HTML page, why does the screen show a different area compared to what I have in the editor’s game view, even though I have set the game view to “web”? I had adjusted the GUI to fit the “web” game view, but in the publish page the GUI element was smaller than the game view (at least on the x axis).

For the second question I had the idea that perhaps if I put a camera in front, let it see the GUI in front but put a low Clipping planes value for far so it didn’t see anything else and put the background alpha to 0, it could show the camera view behind the GUI camera. But that didn’t work out either.

UnityGUI can only be in the topmost layer. You cannot put it behind the 3D stuff. Think of it as a layer having nothing in common with 3D.

For rendering the GUI in 3D, you’ll have to browse the Asset Store packages and pick one that fits for your project.

About the WebPlayer resolution - it is defined in the web player template.

Thanks for the reply. You seem to have misunderstood my problem though. I’m not trying to put the GUI behind 3D stuff. The question in short is: why is the GUI dependent on camera views? In other words: why does the GUI need to be rendered by a camera?

And to further elaborate this comes down to two specific problems:

  • How to have a camera that only spans part of the screen, so that the GUI would cover the rest? Just putting the GUI on top of the camera isn’t the same thing when using perspective view.
  • How to have a GUI that is on top of two cameras?

The first question is what I have a need for now, but I’m curious about the second one too.

You can have multiple cameras rendering to different parts of the screen (works with Unity free). Just tweak the properties of the camera component (I guess pixelRect is the one).

GUI layer is always on top of cameras and is working in screen coordinates (pixels with origin in the top-left of the screen).

I am afraid you still didn’t pay attention to what my actual problem here is. I know that I can have several cameras showing different parts of the world in different parts of the screen. I mentioned that in my first post.

That is what I would assume, but unfortunately it really doesn’t seem to be so!

Maybe this picture will clarify:
1203673--48411--$kamerat.jpg

There are two cameras here, one on the right in the middle and one in low left corner. The black thing you can slightly see through in the left downmost corner is the GUI element seen within the low left camera. But the GUI is ONLY shown within the camera views, and even there the way in which it is shown depends on the View Port Rect settings (the current settings exclude the GUI from the upper camera). Why?! :face_with_spiral_eyes: Since GUI is always on top of everything, why isn’t it on top of the cameras?

1203673--48410--$kamerat.png

Ha! Interesting problem!

My guess would be that your GUI is a transparent grey-ish image, and since the screen background is also grey, he could be visible only when being displayed over something non-grey (like your “bricks” image).

Try changing the background color of the screen to something else, or the color of your GUI element. Or write some text into your GUI box.

I changed the GUI into an image of a plant. It doesn’t make difference - it’s only shown within the camera view. Besides, like I mentioned, it doesn’t even cover a constant ratio of the camera view, so that’s already a proof that the GUI element is always depending on the camera.