Reputation: 289
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
Upvotes: 5
Views: 7368
Reputation: 289
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
Upvotes: 8
Reputation: 15951
The Screen
class is what you are looking for.
Particularly Screen.width
and Screen.height
.
Upvotes: 2