Methods
(abstract) onDeviceMotion(data)
Gets called every X milliseconds with device motion data iff the
AirConsole was instantiated with the "device_motion" opts set to the
interval in milliseconds. Only works for controllers.
Note: Some browsers do not allow games to access accelerometer and gyroscope
in an iframe (your game). So use this method if you need gyroscope
or accelerometer data.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
object | data.x, data.y, data.z for accelerometer data.alpha, data.beta, data.gamma for gyroscope |
- Source:
vibrate(options)
Vibrates the device for a specific amount of time or playing back a specific pattern when
used with the controller app. Only works for controllers.
Note: iOS without controller app ignores the specified time and vibrates for a pre-set amount of time.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
Number | VibrationOptions | This represents either - Milliseconds to vibrate the device - Vibration options for fine-tuned vibration patterns |
- Source: