B2CREATECIRCLEBODY

This command will create a circle in the specified world from the specified template.  The ID should be the integer handle of the world the body should be created in, which was returned when the world was created.  The radius sets the size of the circle.  The density controls the mass of the circle.  A body with a density of 0 becomes static and will not move when acted upon by outside forces.  The restitution value must be between 0 and 1 and sets the bounciness of the object - an object with a restitution of 0 will not bounce.  An object with a restitution of 1 will bounce a lot.  The friction value sets whether the object will slide or not.  A value of 1 is fairly normal, a value of 0 means the object will slide indefinitely until it hits something.

This command returns an integer handle that can be used to refer to the body in other commands.  It is recommended that you save this value as without it you cannot move the body, change its properties, or delete it.

 

Syntax

Return as Integer = b2CreateCircleBody(ID as Integer, Radius as Float, Density as Float, Restitution as Float, Friction as Float)

Related Information

BOX2D Commands Menu
Index