- Home /
Question by
Fractalbase · Jun 16, 2014 at 10:19 PM ·
gamescreendimensions
game screen dimensions
Is there a way to query for x&y screen dimensions, and to set those dimensions programmatically?
Comment
Answer by Tanshaydar · Jun 16, 2014 at 11:42 PM
Everything about Screen: http://docs.unity3d.com/ScriptReference/Screen.html
Current Screen Resolution:
void Example() {
print(Screen.currentResolution);
}
Getting and setting screen resolution:
void Start() {
Resolution[] resolutions = Screen.resolutions;
foreach (Resolution res in resolutions) {
print(res.width + "x" + res.height);
}
Screen.SetResolution(resolutions[0].width, resolutions[0].height, true);
}
So you can get width and height values, set new ones on specific dimensions like 4:3, 16:10 etc.
Your answer
Follow this Question
Related Questions
Why isn't the text centered in my game screen? 3 Answers
Blue game screen 0 Answers
I can't go back to the start up screen after hitting not now 0 Answers
How to make game fit all screen Size and Resolutions 1 Answer
There is nothing in the GAME mode and nothing shows when the game is installed. 2 Answers