- Home /
Question by
pinkpigee · May 31, 2014 at 09:34 AM ·
cameramaterialorthographiccamera.render
Adjust Camera PixelRect Based on Screen Resolution In Unity
I'm creating a simple 2D game in Unity. The game has a subwindow. To create the subwindow, I added a secondary camera. Because I want the subwindow to display a small portion of my screen, I adjusted its PixelRect property.
Now, even if I scale my screen up or down, the ratio of my subwindow remains the same. However, I want my subwindow to scale up/scale down depending on the size of my screen. the thing is, I have a "border" for my subwindow. The border adjusts with the screen but I can't seem to do that with the actual camera view.
How will I make my camera using its pixelRect property adjust to the size/scale & position of its border?
Basically, i want my camera view to always fit inside the "border" regardless of the screen size.
Comment