- Home /
camera view independent of resolution
hi, i was wondering how to make my second camera, that shows interface controls in the top-right corner of the screen, resolution independent.
i have these values set in the inspector:
Normalized Viewport Rect: X:0.8 Y:0.0 Width:1 Height:1
but when i start the player and make game screen bigger, it messes up the view of the second camera. how to make it consistent?
Answer by Tetrad · Jul 12, 2010 at 04:50 PM
Well you should probably change the width and height to .2, .2, because you're rendering a lot of it off screen with your X position at .8.
Using that method should make it resolution independent, if by resolution independent you mean it's the same percentage of the screen regardless of resolution.
However, a better way to do it might be to render that camera to a texture and render that texture on some geometry that has a fixed aspect ratio, so you don't have issues with rendering the game at different aspect ratios changing the aspect ratio of your interface controls.
That would only work with Pro, and seems relatively resource-intensive when you could just change the X and width of the viewport rect to compensate for different aspect ratios.
Well there are other benefits to that, like being able to render to a non-axis-aligned rectangle.