CoronaSDK 2013.1126 | Released: 24 May 2013, 1:59am | 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.setGravity()
Description:
Sets the x,y components of the global gravity vector, in units of m/s2. The default is ( 0, 9.8 ) to simulate standard Earth gravity, pointing downwards on the y-axis.
Syntax:
physics.setGravity( gx, gy )
Example:
local function onTilt( event ) physics.setGravity( 10 * event.xGravity, -10 * event.yGravity ) end Runtime:addEventListener( "accelerometer", onTilt )
Parameters:
gx
Sets the global gravity vector in X direction, in units of m/s2.
gy
Sets the global gravity vector in Y direction, in units of m/s2.
Returns:
Nothing.
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