Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 1.39 KB

README.md

File metadata and controls

40 lines (28 loc) · 1.39 KB

DeviceOrientationManager

Useful device orientation data for Framer prototypes. Find out what direction the user is facing and point them in the right direction. If you are interested in Virtual Reality you should check out the VRComponent.

Example

  • Compass (uses compassHeading, only works on mobile)
  • WaveReader (uses heading, only works on mobile)

Properties

  • heading <number> readonly (0 to 360 degrees)
  • elevation <number> readonly (90 to -90 degrees)
  • tilt <number> readonly (180 to -180 degrees)
  • compassHeading <number> readonly (0 to 360 degrees)
  • alpha <number> readonly (0 to 360 degrees)
  • beta <number> readonly (180 to -180 degrees)
  • gamma <number> readonly (90 to -90 degrees)
# Include the DeviceOrientationManager
{DeviceOrientationManager} = require "DeviceOrientationManager"

orientationManager = new DeviceOrientationManager

Functions

  • DeviceOrientationManager.available() returns <bool>

Events

  • onOrientationChange (data {heading, elevation, tilt, compassHeading, alpha, beta, gamma})
orientationManager.onOrientationChange (data) ->
	heading = data.heading
	elevation = data.elevation
	tilt = data.tilt