- Home /
Game window vs Application resolution
When I play my application in the editor all the elements are the correct proportions. When I build and play the app everything is stretched length wise and squashed height wise.
This is driving me crazy. My app needs to display at 1024x768 full screen for user. What in the world am I missing?
I have been looking at different threads and I guess I just don't get it. Any help is welcome.
Fullscreen stretches your game view to fill the screen and be of the physical screen aspect ratio. To still have a 1024x768 aspect ratio, you could somewhat use this: http://gamedesigntheory.blogspot.com/2010/09/controlling-aspect-ratio-in-unity.html
Answer by Merman · Dec 09, 2014 at 08:49 PM
Try
Screen.SetResolution(1024, 768 , true);
wherever you are telling the game to run in full screen mode. If you are doing this from the Player Settings, simply set the default screen width and default screen height and select the "Default is Full Screen" option.
If the monitor running the game does not support 1024 x 768 for some reason, though, the game will attempt to fall back to the closest available setting (as far as I know). It would be better to generate a list of available resolutions and allow the player to choose the one they'd prefer.
Also, on your canvas (assuming you're using the new UI system), change the UI scale mode to "scale with screen size". Set the reference resolution, and set screen match mode to "width or height" with the slider at 0.5. This should minimize any distortion regardless of the resolution chosen.
Thank you. As it turns out the solution was a combination of factors. What you offered was one. Another was in the player settings. Default Screen width and height. Also my camera near, far, width and height needed adjusting. In the end I have learned a lot about setting up for a build. Thanks again for the response.
Your answer
Follow this Question
Related Questions
Build Resolution differs to editor resolution 0 Answers
Is there an alternate way to Build? 2 Answers
How to lock aspect ratio on full screen 4 Answers
Distribute terrain in zones 3 Answers
how to get a window bigger than screen 0 Answers