Difference between revisions of "love.physics.newCircleBody"

(Created page)
 
(Add world parameter to function arguments)
 
Line 7: Line 7:
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
body = love.physics.newCircleBody( type, x, y, radius )
+
body = love.physics.newCircleBody( world, type, x, y, radius )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
 +
{{param|World|world|The world to create the body in.}}
 
{{param|BodyType|type|The type of the body.}}
 
{{param|BodyType|type|The type of the body.}}
 
{{param|number|x|The x position of the body in the world.}}
 
{{param|number|x|The x position of the body in the world.}}
Line 15: Line 16:
 
{{param|number|radius|The radius of the circle.}}
 
{{param|number|radius|The radius of the circle.}}
 
=== Returns ===
 
=== Returns ===
{{param|Body|body|The new Body with an attached CircleShape. The shape's local origin is at the center of the Body.}}
+
{{param|Body|body|The new [[Body]] with an attached [[CircleShape]]. The shape's local origin is at the center of the [[Body]].}}
  
 
== See Also ==
 
== See Also ==

Latest revision as of 21:25, 3 August 2024

Available since LÖVE 12.0
This function is not supported in earlier versions.

Creates a new Body with an attached CircleShape.

This is a convenience constructor which effectively calls love.physics.newBody and love.physics.newCircleShape.

Function

Synopsis

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

Arguments

World world
The world to create the body in.
BodyType type
The type of the body.
number x
The x position of the body in the world.
number y
The y position of the body in the world.
number radius
The radius of the circle.

Returns

Body body
The new Body with an attached CircleShape. The shape's local origin is at the center of the Body.

See Also


Other Languages