mirror of
https://github.com/photonstorm/phaser
synced 2024-12-25 20:43:26 +00:00
1 line
48 KiB
JSON
1 line
48 KiB
JSON
|
{"class":{"name":"Phaser.Physics.P2","extends":"","static":false,"constructor":true,"parameters":[{"name":"game","type":["Phaser.Game"],"help":"Reference to the current game instance.","optional":false,"default":null},{"name":"config","type":["object"],"help":"Physics configuration object passed in from the game constructor.","optional":true,"default":null}],"help":"This is your main access to the P2 Physics World.\\nFrom here you can create materials, listen for events and add bodies into the physics simulation."},"consts":[],"methods":{"public":[{"name":"addBody","static":false,"returns":{"types":["boolean"],"help":"True if the Body was added successfully, otherwise false."},"help":"Add a body to the world.","line":734,"public":true,"protected":false,"private":false,"parameters":[{"name":"body","type":["Phaser.Physics.P2.Body"],"help":"The Body to add to the World.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"addConstraint","static":false,"returns":{"types":["Phaser.Physics.P2.Constraint"],"help":"The Constraint that was added."},"help":"Adds a Constraint to the world.","line":966,"public":true,"protected":false,"private":false,"parameters":[{"name":"constraint","type":["Phaser.Physics.P2.Constraint"],"help":"The Constraint to add to the World.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"addContactMaterial","static":false,"returns":{"types":["Phaser.Physics.P2.ContactMaterial"],"help":"The Contact Material that was added."},"help":"Adds a Contact Material to the world.","line":1000,"public":true,"protected":false,"private":false,"parameters":[{"name":"material","type":["Phaser.Physics.P2.ContactMaterial"],"help":"The Contact Material to be added to the World.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"addSpring","static":false,"returns":{"types":["Phaser.Physics.P2.Spring"],"help":"The Spring that was added."},"help":"Adds a Spring to the world.","line":778,"public":true,"protected":false,"private":false,"parameters":[{"name":"spring","type":["Phaser.Physics.P2.Spring","p2.LinearSpring","p2.RotationalSpring"],"help":"The Spring to add to the World.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"beginContactHandler","static":false,"returns":null,"help":"Handles a p2 begin contact event.","line":418,"public":true,"protected":false,"private":false,"parameters":[{"name":"event","type":["object"],"help":"The event data.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"clear","static":false,"returns":null,"help":"Clears all bodies from the simulation, resets callbacks and resets the collision bitmask.","line":696,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"clearTilemapLayerBodies","static":false,"returns":null,"help":"Clears all physics bodies from the given TilemapLayer that were created with `World.convertTilemap`.","line":1511,"public":true,"protected":false,"private":false,"parameters":[{"name":"map","type":["Phaser.Tilemap"],"help":"The Tilemap to get the map data from.","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to operate on. If not given will default to map.currentLayer.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"convertCollisionObjects","static":false,"returns":{"types":["array"],"help":"An array of the Phaser.Physics.Body objects that have been created."},"help":"Converts all of the polylines objects inside a Tiled ObjectGroup into physics bodies that are added to the world.\\nNote that the polylines must be created in such a way that they can withstand polygon decomposition.","line":1473,"public":true,"protected":false,"private":false,"parameters":[{"name":"map","type":["Phaser.Tilemap"],"help":"The Tilemap to get the map data from.","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to operate o
|