x


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?

more ▼

asked Jul 09 '11 at 06:52 PM

Jesus_Freak gravatar image

Jesus_Freak
1.2k 38 44 59

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Jul 09 '11 at 10:09 PM

Graham Dunnett gravatar image

Graham Dunnett ♦♦
11.7k 11 20 64

ok, so instead of what they have, I'd say resolutions[resolutions.Length].width, etc?

Jul 09 '11 at 10:29 PM Jesus_Freak

The last index of a zero-based array is always [whatever.Length - 1].

Jul 09 '11 at 10:47 PM Dreamblur

ok, and since I'm using c# generic List, it'd be [whatever.Count -1]?

Jul 09 '11 at 11:21 PM Jesus_Freak
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x484
x379
x122
x85

asked: Jul 09 '11 at 06:52 PM

Seen: 1558 times

Last Updated: Jul 09 '11 at 11:21 PM