Hello All
I have recently made an app with a forced window size of 503800, this works fine on all resolutions I have tested apart from 1280800 to which the window is bigger than I set it.
It adds more pixels to the side of the window which puts all my aligned items too far left or too high.
To test i changed my pc resolution (12801024 native) to 1280800 with no stretching and it work fine. So it seems its only the laptops I tested with native resolutions of 1280*800.
I can not for the life of me figure why it would only be these screens that cause the issue. Could anyone shed some light or advise on where I am going wrong?
Unity - Scripting API: Screen.resolutions gives you a list of all the screen resolutions that are supported on the machine. Find one that is 800 pixels high, and select it. Then set up your camera’s view window to be 503 pixels wide.
Hello Graham
I really appreciate the time you took to reply.
I am not sure I am being clear as the script you gave as an example does not seem to help.
I am looking to set the resolution of the window so it never ever changes, regardless of the screen resolution.
I need the window and internal resolution of the app to stay constant.
I have set the default Screen resolution to 506 * 800 in player settings, Which on all resolutions sets the window size to the correct size apart from 1280*800 which ruins all the layout. As my company has laptops with this resolution it is quite a big issue for the app.
This is not a full screen application and it runs in orthographic mode.
I have tried to set the screen resolution with Screen.SetResolution but this does nothing.
I find it strange I can set my 1280x1024 screen to 1280800 and the app works fine. But on the laptops with native 1280800 it is all out of sync.
Even if I set the laptop to 1024*768 the app is still not working as it should.
===============================
EDIT:
Just to add some more confusion. I plugged in my monitor to the laptop and disabled the laptop screen so I am only running the external 1280*1024 monitor.
The issue still remains.
I can not understand why only the laptops are producing this error even when running only through an external monitor?!?!?
Also tested on Dell and IMB laptops with i5 and core2 (diff graphics chipsets) and they also produce the Error.
This just gets stranger and stranger.
Okay, so I am confused as well. If you laptops have a screen height of 800 pixels, and your app is not a full screen one (hence is a windowed one) how do you manage to get 800 pixels of Unity screen, plus the window decoration (title bar etc) into 800 pixels? If you temporarily set the Unity app size to be 600 or 700 pixels (hence the window will fit into a 800 high screen) does the problem go away? The screen API is really about the desktop size.
It was my intention to rebuild the app as I only showed the managers an example application (which made them purchase unity btw)
This issue only came to light when they went to do a presentation to the senior managers which they took a laptop in to show them.
(This app will be for our end users which most will not use 800 which is why I built it for 12801024 in mind)
It will be rebuilt with 506700 to accommodate the resolution of our laptops. I still can not understand why the laptops still produce this error in 12801024 mode.
I will rebuild to *700 and let you know.
Hi Graham
Thank you very much for your support.
So far it seems to have cured the problem although I had to make an entirely new project due the changes to player settings didn’t seem to change anything, which is an issue I have had with other projects.
I presume this problem is something to do with the native resolution of the device forcing a change in the programs resolution? due to the API having a native resolution equal too or less that the applications height/width.
It must be something to do with that as any other resolution produced the same issue with the laptops internal/external screen.
Thank you again so very very much, Consider this fixed till I return 