- Home /
Standalone player in windows open fullscreen, but player settings says windowed
In the late stages of a project I'm working on I found out that if I export a build as a standalone player for windows, the 'Default is fullscreen' checkbox in player settings seems not to be respected. If I leave this box unchecked, and create a windows build, and run that build under windows (7), it opens fullscreen anyway. In case it's relevant, I'm developing on a mac. The mac builds of the project open as expected.
I stumbled on a 'fix' of sorts but it's very unsatisfactory. If I enable the 'Display Resolution Dialogue' checkbox, build for windows, then disable 'Display Resolution Dialogue' and build for windows again, then the second build will open as expected under windows (windowed, at the specified Default Screen width and height).
Unfortunately I haven't been able to reproduce this bug in a simple project so far. The one I'm working on has several third party tools (including PlayMaker and NGUI).
Does anyone have an idea about what might be going wrong here?
Answer by Statement · Oct 28, 2013 at 01:24 PM
I stumbled on a 'fix' of sorts but it's very unsatisfactory. If I enable the 'Display Resolution Dialogue' checkbox, build for windows, then disable 'Display Resolution Dialogue' and build for windows again, then the second build will open as expected under windows (windowed, at the specified Default Screen width and height).
The 'fix' you describe suggests that you have run your application on your computer with fullscreen toggled on at some point and then disabled the resolution window. This should not affect end users and the 'bug' you're seeing is just your preferences you've previously set, most likely. If you try to run it on a machine where you've never run the app on before, or if you change the app name in player settings on your current machine, I would expect you'd be able to run in windowed mode.
So:
Try changing app name temporarily to verify this was the case, and
Try running your app on a machine where you haven't run the game before
The reason for this is that the resolution dialog writes your settings into the registry. When Unity boots up ready to load your game, it reads those values. Therefore, enabling the dialog to change your settings is valid and as you understand, this is only a 'fix' on your own machine. Changing your app name is valid, since it will cause Unity to look for settings in a different registry (which doesn't exist yet), and will cause the application to behave as if it's never been run on the machine before.
Ah I see. In this particular case the correspondence between screen pixels and size of pixels in my player always needs to be 1-to-1. So I guess adding Screen.fullScreen = false; in some startup routine to enforce a windowed state when starting up might make sense here right?
O$$anonymous$$G THAN$$anonymous$$ YOU! I've been scratching my head for long time for this. This bug will cause your aspect ratio go haywire when you use the setResolution function from the Screen class. a BIG thumb up for this insightful solution!
Genius !!!! I had the opposite problem (game always running windowed, but I needed it fullscreen), and I've been tweaking the player settings for hours... Thanks!
Your answer
Follow this Question
Related Questions
Player can't move in windows standalone 2 Answers
SetResolution in full screen is a nightmare (Standalone Windows) 1 Answer
Desktop Standalone Not Working In Fullscreen Mode 1 Answer
How do I change the size & position of the standalone player in windows? 0 Answers
Windows Standalone Crashes in -batchmode , how do I read the strack from the log? 1 Answer