Differences

This shows you the differences between two versions of the page.

Link to this comparison view

gdevelop5:all-features:device-sensors [2018/08/21 20:01]
wendigo [Expressions]
gdevelop5:all-features:device-sensors [2020/12/26 13:56]
Line 1: Line 1:
-====== Device sensors Extension ====== 
-This extension gives access to the sensors which can be found in most mobile devices. 
  
-===== Orientation sensor ===== 
-The orientation sensor combines the gyroscope, accellerometer and compass in one sensor. This allows you to control game objects by slightly rotating the mobile device in your hands. 
-You can access the location data via the "alpha", "beta" and "gamma" values which are explained in the next section. 
- 
-==== Axes explained ==== 
-=== Alpha === 
-{{:gdevelop5:all-features:orientation_alpha_axis.png?nolink|}} 
- 
-The "alpha" value corresponds to the axis which points to the sky when your phone is lying on a table with its display pointing upwards. You can easily create a compass using the "alpha" rotation value.  
- 
-**Range:** 0 to 360 degrees 
- 
-=== Beta === 
-{{:gdevelop5:all-features:orientation_beta_axis.png?nolink|}} 
- 
-The "beta" axis runs through the narrow edge of the phone. 
- 
-**Range:** -180 to 180 degrees 
- 
-=== Gamma === 
-{{:gdevelop5:all-features:orientation_gamma_axis.png?nolink|}} 
- 
-The "gamma" axis runs through the longer edge of the phone. 
- 
-**Range:** -90 to 90 degrees 
-==== Conditions ==== 
- 
-**Sensor Active** 
- 
-This condition checks wether the sensor has been activated before and is delivering location data. 
- 
-**Orientation Alpha** 
- 
-This condition lets you compare the value of alpha to a number or variable. 
- 
-**Orientation Beta** 
- 
-This condition lets you compare the value of beta to a number or variable. 
- 
-**Orientation Gamma** 
- 
-This condition lets you compare the value of gamma to a number or variable. 
-==== Actions ==== 
- 
-**Activate Orientation Sensor** 
- 
-This action activates the orientation sensor so that it begins to deliver alpha, beta and gamma values. 
-Turn this off again when you no longer need the sensor to save some processing time. 
- 
-**Deactivate Orientation Sensor** 
- 
-This action deactivates the orientation sensor so that it stops delivering alpha, beta and gamma values. 
- 
- 
-==== Expressions ==== 
- 
-**Sensor Active** 
- 
-Same as the condition but lets you write the active state into a variable. 
- 
-**Is Absolute** 
- 
-This value indicates if the orientation data are absolute values, in reference to the Earth's coordinates (value 1) or using an arbitary frame which is determined by the device (value 0). 
- 
-**Alpha Value** 
- 
-The "alpha" rotation, rounded to a whole number. 
- 
-**Beta Value** 
- 
-The "beta" rotation, rounded to a whole number. 
- 
-**Gamma Value** 
- 
-The "gamma" rotation, rounded to a whole number.