0 Favourites

Check if mobile device screen is rotate

  • 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

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • You can use the IntelXDK Event:

    IntelXDK : Compare orientation ( Landscape || Portrait ) => do sth.

  • 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!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
Rikoshe Mobile Game Jam
138 13,775
SorianS's avatar
SorianS
Unread hot topic
102 6,404
Ashley's avatar
Ashley Construct Team Founder
Unread hot topic
104 8,616
ArcadEd's avatar
ArcadEd