- Home /
Resize game according screen resolution
Hello people, did unity resizes the game according the screen resolution? Like, program in a device with screen 1280x820, but another device has 640x480, did the engine resize the game automactly?
Best regards!
Answer by APenguin · Feb 06, 2014 at 01:47 PM
I tried this before as a test for my project, and it does resize the game. However you would have to re-run the game after resizing the screen resolution, anywise positions may move out of place.
But basically yes it does is the simple answer :)
EDIT: i only tried it for a 3D game, i haven't tried it for 2D. I guess for 2D the textures might become pixelated or something unless the textures are changed to match the screen resolution.
Actually is for mobile games, i tested in many mobile with different resolutions and works.
Answer by lloydhooson · Feb 06, 2014 at 02:31 PM
Hi,
you can get the supported resolutions from Screen.resolutions
Then just change the app res but using Screen.SetResolution(int width, int height, bool fullscreen, int preferredRefreshRate = 0)
Links:
Hope this helps.
Answer by Kiwi2703 · Feb 07, 2014 at 03:11 PM
Hi, I use this script to do that:
Screen.SetResolution (Screen.currentResolution.width, Screen.currentResolution.height, true);
Screen.fullScreen = true;
Your answer
![](https://koobas.hobune.stream/wayback/20220613132712im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
gui texture crop and resize 1 Answer
How do I detect resize event for the game window in the editor? 2 Answers
How to stretch small resolution to larger resolution whilst keeping perspective ratio? 1 Answer
I bought unity games for reskin. package name how do I change the game name?,reskin 0 Answers
GameObjects appear different on device than on Unity3d scene mode 2 Answers