Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get monitor/display resolution

As you know, monitors and displays are manufactured with some resolution. I need to get monitor/display resolution. I don't mean resolution of game window/fullscreen, I mean physical resolution of monitor/display.

I need it to work both on Android and Windows.

EDIT :

I just found what i'm looking for is called NATIVE RESOLUTION

like image 450
Jacob Avatar asked Jan 28 '23 20:01

Jacob


1 Answers

Looks like i found solution. @Draco18s pointed to Screen class but what i'm looking for is called Display. Display class allows me to get native size of monitor or display in pixels. Looks like "Screen" class is used only for game window/full screen but for display as hardware device is used "Display" class. It was added to Unity3d very recently with multi-display support, this is reason why very few people knows about its existence.

To be more specific i was looking for Display.main.systemHeight and Display.main.systemWidth

like image 172
Jacob Avatar answered Jan 31 '23 19:01

Jacob