- Home /
Do screen.width and screen.height get updated depending on screen orientation on Android?
Do screen.width and screen.height get updated depending on screen orientation on Android? Like if you have the phone in portrait and then rotate it to landscape. Do scren.width and screen.height switch places?
The script I'm using relies on this behavior to work properly. Seeing that the script works correctly I'm assu$$anonymous$$g that screen width and height get updated when the screen changes orientation. I'm just assu$$anonymous$$g that this has to be the behavior since the script works as intended. If anyone has a definite , informed answer I'd be happy to hear it.
Answer by lzell · Jun 25, 2013 at 10:50 PM
For other googlers: Just did a test with Unity 4.1.5, and Screen.width and Screen.height did in fact switch after rotation of an iOS device.
Answer by OperationDogBird · Sep 06, 2012 at 04:16 AM
I just did a test using Unity version 3.4. I set Auto-Rotation for device orientation and just have a text mesh that shows the screen width and height. I am updating the text every frame to be sure. The values never changed.
This may be different on later versions of unity, but as far as 3.4 goes, the Screen width and height do not change.
Your answer
Follow this Question
Related Questions
Android screen orientation: why am I getting wrong screen size values? 1 Answer
Screen.width & height not updated after screen rotation 1 Answer
Unity 3.5.7 Android Screen returns the wrong value? 0 Answers
When are Screen.width and Screen.height updated after changing the Screen.orientation value? 0 Answers
Screen.width and Screen.height sometimes flipped for Android 1 Answer