↳ Controller Inputs

AirConsole

new AirConsole(opts) → {AirConsoleObject}

Your gateway object to AirConsole. There are getter and setter functions for all properties. Do not access properties of this object directly.
Parameters:
Name Type Description
opts AirConsole~Config Constructor config, see bellow.
Source:
Returns:
The AirConsole object.
Type
AirConsoleObject

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(time)

Vibrates the device for a specific amount of time. Only works for controllers. Note: iOS ignores the specified time and vibrates for a pre-set amount of time.
Parameters:
Name Type Description
time Number Milliseconds to vibrate the device
Source: