[Solved] How do I detect the phone orientation?

0 favourites
  • 2 posts
  • I want to make the green bar move to the left when you tilt to the left. Same applies for moving to the right.

    This has to be played in Landscape orientation and it works perfectly by using the Beta orientation from the touch plugin on one phone position.

    Whenever I hold the phone differently, the green bar won't work like intended.

    The screen will auto rotate with you. However, the defined Beta orientation conditions won't change with the autorotate. This is troublesome.

    Is there a way:

    -to detect how one hold their phone?

    -to lock the screen on one position to prevent auto rotate? (Holding your phone up-side-down won't rotate the screen)

    I have addded a picture to make things more clear.

    ikke2902

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The included 'Browser' plugin was able to fix my problem.

    That plugin has an action to lock the screen orientation.

    https://www.scirra.com/manual/110/browser

    There are several options like Primary Orientation, Secondary orientation locks etc.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)