Get mobile orientation (tilt, left/right/up/down & compass)

  • 17 favourites

Attached Files

The following files have been attached to this tutorial:



3,212 visits, 4,648 views


This tutorial hasn't been translated.



This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Hi, I have just written a capx to display the mobiles orientation, the capx is fully commented.

It uses the touch.alpha, touch.beta and touch.gamma to find if the user is tilting their phone, up/down/left or right, I have added a simple compass also.

You have to enable preview over LAN to see this on mobile, or if you cant I have put an example here, which will work on most mobiles.

Link To Demo


  • Order by
Want to leave a comment? Login or Register an account!