- Home /
Question by
Leroterr · Dec 14, 2014 at 12:07 PM ·
c#aspect-ratioaspect ratio
How do you check what aspect ratio the player is using to play the game?
Is there a way I can check in script what aspect ratio the player is using?
For example:
if(aspect.ratio.of.player == 16:9)
{
//do this
}
else if(aspect.ratio.of.player == 4:3)
{
//do this insteaad
}
etc. etc.
Thanks!
Comment
Best Answer
Answer by tanoshimi · Dec 14, 2014 at 12:24 PM
(float)Screen.width / (float)Screen.height;
That doesn't really give me an exact number. EDIT: Never$$anonymous$$d, fixed it :)
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
A node in a childnode? 1 Answer
Distribute terrain in zones 3 Answers
How do you CORRECTLY call methods from another C# file 1 Answer