Difference between revisions of "B2.Body:setGravityScale"

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

Latest revision as of 17:59, 12 July 2023