- Home /
Aspect Ratio ( supporting different screen resolutions )
Hi there, I have been trying to figure out how to support different screen resolutions and aspect ratios and I've finally managed to get a script working but the problem is that it cuts off about a tenth of the screen at the top and I don't know why or how to fix it, so I guess my question is do you know how to fix this?
void Start(){
float width = Screen.width / 440f;
float height = Screen.height / 724f;
Camera.main.rect = new Rect(0,0,1,width/height);
}
Answer by rober-psious · Apr 27, 2016 at 04:08 PM
The camera rectangle defines the screen portion which this rectangle will be painted.
You can work with a virtual screen and then interpolate to your real screen.
Your answer
Follow this Question
Related Questions
Screen.SetResolution not behaving as expected 0 Answers
How can I change the orthographic camera’s viewport size based on aspect ratio? 0 Answers
Aspect ratio restriction problem 3 Answers
How to limit scrolling at same position not depending on aspect ratio 0 Answers
Limit Android Screen Aspect Ratio 0 Answers