BoxSymbol Clock.png
This is an archive.
See the new ClickWiki at https://clickwiki.github.io. This version is just an archive for the purposes of migrating content to the new structure.


Jump to: navigation, search

Accelerometer object

Icon Accelerometer object.png
Author Official extension or is supported by Clickteam.
Status Released
Release Date Unknown
Last Updated {{{LastUpdated}}}
Available for Multimedia Fusion 2 Standard Multimedia Fusion Developer 2 Clickteam Fusion 2.5 Free Edition Clickteam Fusion 2.5 Standard Clickteam Fusion 2.5 Developer
Supported Runtimes iOS Runtime Android Runtime HTML5 Runtime XNA Runtime (now deprecated) UWP Runtime
License Free
Attributes {{{Attributes}}}
Download
Includes Examples No
Includes Help Files Yes
Links
Downloadable via the Extension Manager
Included by default.
Alternates {{{Alternates}}}

The Accelerometer object allows you to receive information from the accelerometers from your mobile device (Android, iPhone, iPad etc.). Please note that the accelerometer hardware drains the battery of the device, and it is a good practice to turn it on only when necessary. The accelerometers are turned on when an Accelerometer object is present in the frame, at the start of the frame. They are turned off when the frame ends.

When you run an application on the PC with the object, it will return values of zero.

Conditions

Device orientation changed

This condition is true when the orientation of the device has changed. If this is the case, you can get the new orientation by using the Get current orientation expression of the object.

Expressions

Device orientation

Orientation( "Accelerometer object" )

This expression returns the current orientation of the device. A new orientation can be detected by triggering the "Device orientation changed" condition.

It returns values from 0 to 6:

  • Unknown (should not happen unless you shake the device)
  • Portrait
  • Portrait upside down
  • Landscape left
  • Landscape right
  • Face up
  • Face down

Direct values

  • X Acceleration
XDirect( "Accelerometer object" )
  • Y Acceleration
YDirect( "Accelerometer object" )
  • Z Acceleration
ZDirect( "Accelerometer object" )

These expressions return the raw values from the accelerometer. The accelerometers are not precise devices, the value will fluctuate very much, even if you do not touch the device.

Gravity isolated values

  • X Acceleration
XGravity( "Accelerometer object" )
  • Y Acceleration
YGravity( "Accelerometer object" )
  • Z Acceleration
ZGravity( "Accelerometer object" )

These expressions return the values from the accelerometer taking away the gravity factor. The accelerometers are not precise devices, the value will fluctuate very much, even if you do not touch the device.

Instantaneous values

  • X Acceleration
XInstant( "Accelerometer object" )
  • Y Acceleration
YInstant( "Accelerometer object" )
  • Z Acceleration
ZInstant( "Accelerometer object" )

These expressions return the values from the accelerometer from the last evaluation. The accelerometers are not precise devices, the value will fluctuate very much, even if you do not touch the device.


Contributors to this page

Advaith (100.0%)