- Home /
how to make a global Screen resolution?
Such as in Portal 2, the VALVe game, where it makes itself fullscreen and works on all computers, huge and small.
Do i make
Screen.fullScreen = true;
or
Screen.SetResolution(1024, 768, true);
I think the second one works, but does it make the game run in a fullscreen mode without running offscreen on all computers?
Answer by Graham-Dunnett · Jul 09, 2011 at 10:09 PM
The first example you give will switch to full screen. But, what you really want to do is look at the resolutions supported on the machine and choose the largest one, so see http://unity3d.com/support/documentation/ScriptReference/Screen-resolutions.html. The resolutions appear in the area from smallest to largest.
ok, so ins$$anonymous$$d of what they have, I'd say resolutions[resolutions.Length].width, etc?
The last index of a zero-based array is always [whatever.Length - 1].
ok, and since I'm using c# generic List, it'd be [whatever.Count -1]?