x


How to get native screen resolution

Hi,

is it possible to get the native resolution of the screen?

And is it possible to get the resolution of a certain screen (two monitors of different type, horizontally spanned), lets say the right monitor (Unity game is fullscreen on both monitors)?

At least I need the aspect ratio of the native resolution...

more ▼

asked Apr 28, 2010 at 12:05 PM

drhenry gravatar image

drhenry
485 20 23 38

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

3 answers: sort voted first

CRT multiscan displays don't really have a "native" resolution, so this question does not really Apply there.

For LCD screens, as Duck said, typically the highest resolution the screen is capable of is the native resolution. You can get a list of supported resolutions using Screen.resolutions, however, this is not always guaranteed to actually contain the highest available resolution, if the user has set his desktop resolution to something less then the highest possible.

This has mostly historic reasons - in the days of VGA monitors, often the graphics cards would support higher resolutions then the screens, and sometimes the communication between the two, to find out which combinations are supported by both did not quite work correctly. For this reason, we would not actually list resolutions higher then the current selected desktop resolution, to avoid switching a system into a screen mode it does not support. I am not sure if this is the case on all platforms, though, and in general, the highest Resolution reported by Screens.resolutions is the closest you will get to getting a screen's "native" resolution.

more ▼

answered Apr 28, 2010 at 11:22 PM

jonas echterhoff gravatar image

jonas echterhoff ♦♦
10.5k 9 37 115

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

If you want the resolution the screen is currently set to, you can get that with:

Screen.currentResolution

ie.

Screen.SetResolution (Screen.currentResolution.width, Screen.currentResolution.height, true);

Will set the view to fullscreen at without changing the resolution of you screen.

more ▼

answered Aug 01, 2010 at 01:50 AM

cncguy gravatar image

cncguy
1.1k 58 47 63

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

You can get the list of supported resolutions using Screen.resolutions.

I have a feeling that the highest supported resolution is very likely to be the native resolution if the screen is an LCD, however I'm not 100% sure of that.

I'm also not sure what that list will look like in the case of a multi-monitor set up.

more ▼

answered Apr 28, 2010 at 04:40 PM

duck gravatar image

duck ♦♦
47.8k 131 233 472

(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:

x698
x90

asked: Apr 28, 2010 at 12:05 PM

Seen: 16551 times

Last Updated: Apr 28, 2010 at 12:05 PM