CoronaSDK 2013.1127 | Released: 25 May 2013, 2:00am | What's New | Download Now
These docs are *very* out of date.
You will be redirected to the new docs in a few seconds.
If you are certain you want to see the old docs, click cancel.
Cancel | Continue to new docs
You will be redirected to the new docs in a few seconds.
If you are certain you want to see the old docs, click cancel.
Cancel | Continue to new docs
physics.getGravity()
Description:
Returns the x,y components of the global gravity vector, in units of m/s2. This takes advantage of the fact that Lua functions can return multiple values.
Syntax:
gx, gy = physics.getGravity()
Example:
gx, gy = physics.getGravity() print( "X gravity: " .. gx .. ", Y gravity: " .. gy )
Parameters:
None.
Returns:
gx
The global gravity vector in X direction, in units of m/s2.
gy
The global gravity vector in Y direction, in units of m/s2.
Remarks:
Supported on operating systems and platforms for build numbers shown:
- Mac OS X:Corona SDK 2.0
- Windows:Corona SDK 2.0
- iOS:Corona SDK 2.0
- Android:Corona SDK 2.0