B2CREATEBODY

This command will make a static body in the specified world from the specified template.  Now it exists as an actual entity in the simulation.  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 BodyTemplateID should be the integer handle of the template the body should be created from, which was returned when the template was created.

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 = b2CreateBody(ID as Integer, BodyTemplateID as Integer)

Related Information

BOX2D Commands Menu
Index