Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
gdevelop5:all-features:device-sensors [2018/09/13 08:43] wendigo |
gdevelop5:all-features:device-sensors [2020/12/26 13:56] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Device sensors Extension ====== | ====== Device sensors Extension ====== | ||
- | This extension gives access to the sensors | + | This powerful |
===== Orientation sensor ===== | ===== Orientation sensor ===== | ||
- | The orientation sensor combines the gyroscope, | + | The orientation sensor combines the gyroscope, |
You can access the location data via the " | You can access the location data via the " | ||
Line 31: | Line 31: | ||
**Sensor Active** | **Sensor Active** | ||
- | This condition checks | + | This condition checks |
**Orientation Alpha** | **Orientation Alpha** | ||
Line 49: | Line 49: | ||
This action activates the orientation sensor so that it begins to deliver alpha, beta and gamma values. | 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 and phone battery. | + | Turn this off when you no longer need the sensor to save some processing time and phone battery. |
**Deactivate Orientation Sensor** | **Deactivate Orientation Sensor** | ||
Line 57: | Line 57: | ||
==== Expressions ==== | ==== Expressions ==== | ||
- | |||
- | **Sensor Active** | ||
- | |||
- | Same as the condition but lets you write the active state into a variable. | ||
**Is Absolute** | **Is Absolute** | ||
- | This value indicates | + | This value indicates |
**Alpha Value** | **Alpha Value** | ||
- | The " | + | The " |
**Beta Value** | **Beta Value** | ||
- | The " | + | The " |
**Gamma Value** | **Gamma Value** | ||
- | The " | + | The " |
===== Motion sensor ===== | ===== Motion sensor ===== | ||
In contrast to the orientation sensor which returns absolute values, the motion sensor delivers relative ones. | In contrast to the orientation sensor which returns absolute values, the motion sensor delivers relative ones. | ||
- | This sensor only returns values while the device is moving. If you hold it still, no matter | + | This sensor only returns values while the device is moving. If you hold it still, no matter |
You can access the motion data along an axis via the " | You can access the motion data along an axis via the " | ||
+ | |||
+ | < | ||
==== Axes explained ==== | ==== Axes explained ==== | ||
===Acceleration X=== | ===Acceleration X=== | ||
- | This value shows the acceleration along the x-axis. If you move your device along the longer edge the x value will increase. | + | {{: |
+ | |||
+ | This value shows the acceleration along the x-axis. If you move your device along the longer edge, the x value will increase. | ||
===Acceleration Y=== | ===Acceleration Y=== | ||
- | This value shows the acceleration along the y-axis. If you move your device along the smaller edge the y value will increase. | + | {{: |
+ | |||
+ | This value shows the acceleration along the y-axis. If you move your device along the smaller edge, the y value will increase. | ||
===Acceleration Z=== | ===Acceleration Z=== | ||
- | This value shows the acceleration along the z-axis. If you move your device up or down the z value will increase. | + | {{: |
+ | |||
+ | This value shows the acceleration along the z-axis. If you move your device up or down, the z value will increase. | ||
===Rotation alpha=== | ===Rotation alpha=== | ||
- | This value shows the acceleration around | + | {{: |
+ | |||
+ | This value shows the acceleration around the z-axis. If you turn your device with the display pointing up, the alpha value will increase. | ||
===Rotation beta=== | ===Rotation beta=== | ||
- | This value shows the acceleration around | + | {{: |
+ | |||
+ | This value shows the acceleration around the x-axis. If you hold your device in landscape mode with a hand on each side, you can turn your device around the x-axis and the beta value will increase. | ||
===Rotation gamma=== | ===Rotation gamma=== | ||
- | This value shows the acceleration around | + | {{: |
+ | |||
+ | This value shows the acceleration around the y-axis. If you hold your device in portrait mode with a hand on each side, you can turn your device around the y-axis and the beta value will increase. | ||
==== Conditions ==== | ==== Conditions ==== | ||
Line 106: | Line 116: | ||
**Sensor Active** | **Sensor Active** | ||
- | This condition checks | + | This condition checks |
**Acceleration X** | **Acceleration X** | ||
- | This condition lets you compare the value of x-acceleration to a number or variable. | + | This condition lets you compare the value of x-acceleration to a number or variable. |
**Acceleration Y** | **Acceleration Y** | ||
- | This condition lets you compare the value of y-acceleration to a number or variable. | + | This condition lets you compare the value of y-acceleration to a number or variable. |
**Acceleration Z** | **Acceleration Z** | ||
- | This condition lets you compare the value of z-acceleration to a number or variable. | + | This condition lets you compare the value of z-acceleration to a number or variable. |
**Motion Alpha** | **Motion Alpha** | ||
- | This condition lets you compare the value of alpha to a number or variable. | + | This condition lets you compare the value of alpha to a number or variable. |
**Motion Beta** | **Motion Beta** | ||
- | This condition lets you compare the value of beta to a number or variable. | + | This condition lets you compare the value of beta to a number or variable. |
**Motion Gamma** | **Motion Gamma** | ||
- | This condition lets you compare the value of gamma to a number or variable. | + | This condition lets you compare the value of gamma to a number or variable. |
+ | |||
+ | ==== Actions ==== | ||
+ | |||
+ | **Activate Motion Sensor** | ||
+ | |||
+ | This action activates the motion sensor so that it begins to deliver x, y, z, alpha, beta and gamma values. | ||
+ | Turn this off again when you no longer need the sensor to save some processing time and phone battery. | ||
+ | |||
+ | **Deactivate Motion Sensor** | ||
+ | |||
+ | This action deactivates the motion sensor so that it stops delivering x, y, z, alpha, beta and gamma values. | ||
+ | |||
+ | ==== Expressions ==== | ||
+ | |||
+ | |||
+ | **Acceleration X Value** | ||
+ | |||
+ | The " | ||
+ | |||
+ | **Acceleration Y Value** | ||
+ | |||
+ | The " | ||
+ | |||
+ | **Acceleration Z Value** | ||
+ | |||
+ | The " | ||
+ | |||
+ | **Alpha Value** | ||
+ | |||
+ | The " | ||
+ | |||
+ | **Beta Value** | ||
+ | |||
+ | The " | ||
+ | |||
+ | **Gamma Value** | ||
+ | |||
+ | The " | ||
+ | |||
+ | {{ : |