B2.Body:setGravityScale: Difference between revisions

From GiderosMobile
No edit summary
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
'''<translate>Available since</translate>:''' Gideros 2012.2.2.1<br/>
'''Available since:''' Gideros 2012.2.2.1<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/b2.Body|b2.Body]]<br/>
'''Class:''' [[b2.Body]]<br/>
=== <translate>Description</translate> ===
 
<translate><br />
=== Description ===
Sets the gravity scale of the body. <br />
Strengthens or weakens the effect of the world gravity on a body.
<br /></translate>
<syntaxhighlight lang="lua">
<source lang="lua">
b2.Body:setGravityScale(scale)
b2.Body:setGravityScale(scale)
</syntaxhighlight>
</source>
 
=== <translate>Parameters</translate> ===
Setting the gravity scale to 0 will make your body float.
'''scale''': (number) <translate>new gravity scale of the body</translate> <br/>
 
You can set a negative number, for example -1, to inverse gravity.
 
'''Note: increased gravity can decrease stability'''
 
=== Parameters ===
'''scale''': (number) new gravity scale of the body<br/>
 
{{B2.Body}}

Latest revision as of 22:02, 30 April 2025