- Home /
Splitting the game view - part camera, part opaque navigational panel at runtime
Is it possible to split the game view? It seems that the game view is simply whatever the camera in the scene is seeing. Is it possible to limit part of the screen to showing the camera, and the other part to show a opaque panel?
Answer by Jesse Anders · Dec 23, 2010 at 02:30 AM
You can specify what portion of the screen a camera will render to using the camera's normalized viewport rect field.
okay, so you do this at the gameobject level, but is there a way to do this from the global level? would you have to use a second camera for the 2d panel?
Yes, typically you'd use a separate camera for each discrete area of the screen that you want to render to.
Is there a way to specify this by percentage? What if you don't know the target screen size?
Regarding your question about percentage, that's essentially what the normalized viewport rect does: (0, 0) represents one corner of the screen and (1, 1) represents the opposite corner. Regarding your second comment, I assume this is an error that you're receiving? If so, it's hard to say what might be causing the error without more information.