- Home /
Portrait build on pc?
I'm creating a game for a vertical screen but I can't build a portrait version for pc. I created the game using a second monitor with flipped desktop (using Ctrl+Alt+"Left arrow") and the game window resolution set up in 720x1280 and everything went perfect, when I build and run it, all possible options for resolution are wide, I changed "Resolution and Presentation" for PC and set up the properties as showed in the image:
But still works on wide resolution when runs, even If I set "Display Resolution Dialog" to disabled to have only 720x1280.
Any ideas on how Can I make a 720x1280 build?
Hi buddy,
I just found out the solution use default player settings in unity. And add this line into start function of any script. - Screen.SetResolution(1080,1920,true);
And just set your display resolution TO PORTRAIT $$anonymous$$ODE using display setting on windows. After that reopen unity and build it again.
Woola..! After you start your game you will see that your application in portrait mode.
Answer by Ippokratis · Feb 21, 2018 at 08:46 PM
Try this one, tested, works.
private void Awake()
{
//Set screen size for Standalone
#if UNITY_STANDALONE
Screen.SetResolution(564, 960, false);
Screen.fullScreen = false;
#endif
}
This answer works best for me. The application doesn't start at the specified resolution, but as soon as the scene opens that contains that Awake function, the window size is adjusted.
Yup, you place the script in the first scene of your app.
Answer by awplays49 · Feb 27, 2015 at 07:58 PM
Press Ctrl+Shift+B and click player settings. In the inspector, click resolution and presentation under the standalone tab. Turn off the launcher, turn off native resolution and type in the values of the screen size :)
Answer by svendkiloo · Jan 16, 2017 at 12:26 PM
The answer given doesn't work for me. However, if I do all those changes and also enable resizing and rung the app, it will still have the same landscape size I last chose from the launcher. If I now resize it to a portrait size and close it, and disable the resizing, it now continues to launch in this portrait format. Not sure if it's something Windows is doing (I'm running Windows 10).
Answer by shacharoz · Apr 30, 2019 at 08:47 AM
Do you guys think it is possible to also set an aspect ration and not only the resolution?