mirror of
https://github.com/photonstorm/phaser
synced 2024-12-19 09:34:02 +00:00
1 line
6.1 KiB
JSON
1 line
6.1 KiB
JSON
|
{"class":{"name":"Phaser.QuadTree","extends":"","static":false,"constructor":true,"parameters":[{"name":"x","type":["number"],"help":"The top left coordinate of the quadtree.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The top left coordinate of the quadtree.","optional":false,"default":null},{"name":"width","type":["number"],"help":"The width of the quadtree in pixels.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height of the quadtree in pixels.","optional":false,"default":null},{"name":"maxObjects","type":["number"],"help":"The maximum number of objects per node.","optional":true,"default":"10"},{"name":"maxLevels","type":["number"],"help":"The maximum number of levels to iterate to.","optional":true,"default":"4"},{"name":"level","type":["number"],"help":"Which level is this?","optional":true,"default":"0"}],"help":"A QuadTree implementation. The original code was a conversion of the Java code posted to GameDevTuts.\\nHowever I've tweaked it massively to add node indexing, removed lots of temp. var creation and significantly increased performance as a result.\\nOriginal version at https:\/\/github.com\/timohausmann\/quadtree-js\/"},"consts":[],"methods":{"public":[{"name":"clear","static":false,"returns":null,"help":"Clear the quadtree.","line":299,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"getIndex","static":false,"returns":{"types":["number"],"help":"index - Index of the subnode (0-3), or -1 if rect cannot completely fit within a subnode and is part of the parent node."},"help":"Determine which node the object belongs to.","line":210,"public":true,"protected":false,"private":false,"parameters":[{"name":"rect","type":["Phaser.Rectangle","object"],"help":"The bounds in which to check.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"insert","static":false,"returns":null,"help":"Insert the object into the node. If the node exceeds the capacity, it will split and add all objects to their corresponding subnodes.","line":157,"public":true,"protected":false,"private":false,"parameters":[{"name":"body","type":["Phaser.Physics.Arcade.Body","object"],"help":"The Body object to insert into the quadtree. Can be any object so long as it exposes x, y, right and bottom properties.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"populate","static":false,"returns":null,"help":"Populates this quadtree with the children of the given Group. In order to be added the child must exist and have a body property.","line":109,"public":true,"protected":false,"private":false,"parameters":[{"name":"group","type":["Phaser.Group"],"help":"The Group to add to the quadtree.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"populateHandler","static":false,"returns":null,"help":"Handler for the populate method.","line":121,"public":true,"protected":false,"private":false,"parameters":[{"name":"sprite","type":["Phaser.Sprite","object"],"help":"The Sprite to check.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"reset","static":false,"returns":null,"help":"Resets the QuadTree.","line":81,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The top left coordinate of the quadtree.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The top left coordinate of the quadtree.","optional":false,"default":null},{"name":"width","type":["number"],"help":"The width of the quadtree in pixels.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height of the quadtree in pixels.","optional":false,"default":null},{"name":"maxObjects","type":["number"],"help":"The maximum number of objects per node.","optional":true,"default":"10"},{"name":"maxLevels","type":["number"],"help":"The maximum number of levels to iterate to.","optional":true,"default":"4"},{"name":"level","type":["number"],"help":"Which level is this?
|