GyroscopeSensor Component


Properties

available
  Indicates whether a gyroscope sensor is available.
Data type: boolean
Designer Writable false
Code Writeable false
Code Readable true let variable = gyroscopesensorName.available

enabled
  Enabled property getter method.
Data type: boolean
Designer Writable true <gyroscopesensor name="gyroscopesensorName" enabled="true">
Code Writeable true gyroscopesensorName.enabled = true
Code Readable true let variable = gyroscopesensorName.enabled

xAngularVelocity
  The angular velocity around the X axis, in degrees per second.
Data type: number
Designer Writable false
Code Writeable false
Code Readable true let variable = gyroscopesensorName.xAngularVelocity

yAngularVelocity
  The angular velocity around the Y axis, in degrees per second.
Data type: number
Designer Writable false
Code Writeable false
Code Readable true let variable = gyroscopesensorName.yAngularVelocity

zAngularVelocity
  The angular velocity around the Z axis, in degrees per second.
Data type: number
Designer Writable false
Code Writeable false
Code Readable true let variable = gyroscopesensorName.zAngularVelocity

class
  The styling class of the the component
Data type: string
Designer Writable true <gyroscopesensor name="gyroscopesensorName" class="Test class">
Code Writeable false
Code Readable false

id
  The styling id of the the component
Data type: string
Designer Writable true <gyroscopesensor name="gyroscopesensorName" id="Test id">
Code Writeable false
Code Readable false

name
  The name of the component that will be used to refer to it in code.
Data type: string
Designer Writable true <gyroscopesensor name="gyroscopesensorName" name="testComponent">
Code Writeable false
Code Readable false

Methods

Method name Description Parameters
addEventListener Method used to create event listeners.
See Events below for samples.
eventName string
eventCallbackFunction callback

Events

Event name Description Parameters
gyroscopeChanged Indicates that the gyroscope sensor data has changed. The timestamp parameter is the time in nanoseconds at which the event occurred.
gyroscopesensorName.addEventListener(
    "gyroscopeChanged",
    function (xAngularVelocity, yAngularVelocity, zAngularVelocity, timestamp) {
        //Your code here
    }
)
xAngularVelocity number
yAngularVelocity number
zAngularVelocity number
timestamp number