Difference between revisions of "Accelerometer"
From GiderosMobile
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
+ | <!-- GIDEROSOBJ:Accelerometer --> | ||
'''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]]<br/> | '''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]]<br/> | ||
'''<translate>Available since</translate>:''' Gideros 2012.8<br/> | '''<translate>Available since</translate>:''' Gideros 2012.8<br/> | ||
Line 22: | Line 23: | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
=== <translate>Methods</translate> === | === <translate>Methods</translate> === | ||
− | [[Special:MyLanguage/Accelerometer.isAvailable|Accelerometer.isAvailable]] ''<translate> | + | [[Special:MyLanguage/Accelerometer.isAvailable|Accelerometer.isAvailable]] ''<translate>does the accelerometer available?</translate>''<br/><!-- GIDEROSMTD:Accelerometer.isAvailable --> |
− | [[Special:MyLanguage/Accelerometer.new|Accelerometer.new]] ''<translate>Creates new Accelerometer instance</translate>''<br/> | + | [[Special:MyLanguage/Accelerometer.new|Accelerometer.new]] ''<translate>Creates new Accelerometer instance</translate>''<br/><!-- GIDEROSMTD:Accelerometer.new --> |
− | [[Special:MyLanguage/Accelerometer:getAcceleration|Accelerometer:getAcceleration]] ''<translate> | + | [[Special:MyLanguage/Accelerometer:getAcceleration|Accelerometer:getAcceleration]] ''<translate>returns the 3-axis acceleration measured by the accelerometer</translate>''<br/><!-- GIDEROSMTD:Accelerometer:getAcceleration --> |
− | [[Special:MyLanguage/Accelerometer:start|Accelerometer:start]] ''<translate> | + | [[Special:MyLanguage/Accelerometer:start|Accelerometer:start]] ''<translate>starts accelerometer updates</translate>''<br/><!-- GIDEROSMTD:Accelerometer:start --> |
− | [[Special:MyLanguage/Accelerometer:stop|Accelerometer:stop]] ''<translate> | + | [[Special:MyLanguage/Accelerometer:stop|Accelerometer:stop]] ''<translate>starts accelerometer updates</translate>''<br/><!-- GIDEROSMTD:Accelerometer:stop --> |
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
=== <translate>Events</translate> === | === <translate>Events</translate> === | ||
=== <translate>Constants</translate> === | === <translate>Constants</translate> === | ||
|} | |} |
Revision as of 14:53, 31 August 2018
Supported platforms:
Available since: Gideros 2012.8
Inherits from: Object
Description
The Accelerometer class is used to access accelerometer data.
Examples
Example
--create instance
local accelerometer = Accelerometer.new()
--start receiving data
accelerometer:start()
---get values for example on each enter frame event
local x, y, z = accelerometer:getAcceleration()
print(x, y, z)
--once you don't need it, stop it
accelerometer:stop()
MethodsAccelerometer.isAvailable does the accelerometer available? |
EventsConstants |