Check if mobile device screen is rotate

Get help using Construct 2

Post » Tue May 14, 2013 7:42 am

I'm sure this has been answered somewhere already so I'm sorry for asking again. What I'm looking for is to check if a mobile device has been rotated and the screens orientation has changed to be on the side. I know using a touch object I can check how far it's been turned left and right but that doesn't actually tell me if the screen has flipped.

Is there any way to get the full window size rather than just the container that the game is in maybe? I thought about checking if windowWidh > windowHeight which would make me think the screen has been rotated but this doesn't work unfortunately.

I'd imagine there would be some easy way to do this, unfortunately when ever I search for it all I'm finding is results on how to tell how far the device is turned rather than if the screen has actually changed orientation.

Any help anyone is able to give me would be greatly appreciated, and sorry again for what I assume is a double post.

Stevil
B
4
Posts: 10
Reputation: 220

Post » Tue May 14, 2013 10:10 am

You can use the IntelXDK Event:

IntelXDK : Compare orientation ( Landscape || Portrait ) => do sth.
B
7
S
1
G
1
Posts: 32
Reputation: 1,016

Post » Wed May 15, 2013 12:26 am

Thanks Prox, I can't test it out at the moment but it looks exactly like what I've been looking for. I knew there would have been a simple way to do it.

Appreciate the help!
B
4
Posts: 10
Reputation: 220


Return to How do I....?

Who is online

Users browsing this forum: amarcelo, Magistross, PavleNikolic and 21 guests