Difference between revisions of "love.physics.newBody"

(Undo revision 7042 by Daemonicky (talk))
Line 16: Line 16:
 
=== Returns ===
 
=== Returns ===
 
{{param|Body|body|A new body.}}
 
{{param|Body|body|A new body.}}
 +
----
 +
{{newin|[[0.8.0]]|type=variants|plural=y}}
 +
== Function ==
 +
=== Synopsis ===
 +
<source lang="lua">
 +
body = love.physics.newBody( world, x, y, type )
 +
</source>
 +
=== Arguments ===
 +
{{param|World|world|The world to create the body in.}}
 +
{{param|number|x (0)|The x position of the body.}}
 +
{{param|number|y (0)|The y position of the body.}}
 +
{{param|string|type|Whether the body is static or dynamic.}}
 +
=== Returns ===
 +
{{param|Body|body|A new body.}}
 +
----
 
== See Also ==
 
== See Also ==
 
* [[parent::love.physics]]
 
* [[parent::love.physics]]

Revision as of 11:10, 30 March 2012

Create a new body. A body with zero mass is static and will not move. Mass can be changed at any time with Body:setMass or Body:setMassFromShapes.

Function

Synopsis

body = love.physics.newBody( world, x, y, m, i )

Arguments

World world
The world to create the body in.
number x (0)
The x position of the body.
number y (0)
The y position of the body.
number m (0)
The mass of the body.
number i (0)
The rotational inertia of the body.

Returns

Body body
A new body.

Available since LÖVE 0.8.0
These variants are not supported in earlier versions.

Function

Synopsis

body = love.physics.newBody( world, x, y, type )

Arguments

World world
The world to create the body in.
number x (0)
The x position of the body.
number y (0)
The y position of the body.
string type
Whether the body is static or dynamic.

Returns

Body body
A new body.

See Also


Other Languages