Dealing with orientation change

Monkey Targets Forums/iOS/Dealing with orientation change

Grey Alien(Posted 2013) [#1]
Sorry for another noob question but I can't find decent details on this.

On iOS I'm aware that I can set a fixed orientation in xcode (but hear there may be trouble setting it to landscape to start according to some recent theads).

However, I want to support both orientations and detect the chance. Is there a function I can call to check the orientation? I can't find anything in the help files. Also when the orientation changes, do DeviceWidth() and DeviceHeight() change (admittedly I could test this myself but I thought I'd seek clarification first).

Any general advice, pitfalls etc? Thanks in advance!


therevills(Posted 2013) [#2]
do DeviceWidth() and DeviceHeight() change

Yep!

I normally use a virtual resolution to deal with orientation change. (eg James' AutoFit Code)

And to check the orientation just do a quick if DeviceWidth() > DeviceHeight() check or something similar.


Grey Alien(Posted 2013) [#3]
Yep I'm using the autofit code, OK that's pretty cool and easy then. Thx!