phaser/v2/resources/docgen/output/Phaser.Physics.Arcade.Body.json
2016-11-23 00:17:46 +00:00

1 line
No EOL
21 KiB
JSON
Executable file

{"class":{"name":"Phaser.Physics.Arcade.Body","extends":"","static":false,"constructor":true,"parameters":[{"name":"sprite","type":["Phaser.Sprite"],"help":"The Sprite object this physics body belongs to.","optional":false,"default":null}],"help":"The Physics Body is linked to a single Sprite. All physics operations should be performed against the body rather than\\nthe Sprite itself. For example you can set the velocity, acceleration, bounce values etc all on the Body."},"consts":[],"methods":{"public":[{"name":"deltaAbsX","static":false,"returns":{"types":["number"],"help":"The absolute delta value."},"help":"Returns the absolute delta x value.","line":675,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"deltaAbsY","static":false,"returns":{"types":["number"],"help":"The absolute delta value."},"help":"Returns the absolute delta y value.","line":685,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"deltaX","static":false,"returns":{"types":["number"],"help":"The delta value. Positive if the motion was to the right, negative if to the left."},"help":"Returns the delta x value. The difference between Body.x now and in the previous step.","line":695,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"deltaY","static":false,"returns":{"types":["number"],"help":"The delta value. Positive if the motion was downwards, negative if upwards."},"help":"Returns the delta y value. The difference between Body.y now and in the previous step.","line":705,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"deltaZ","static":false,"returns":{"types":["number"],"help":"The delta value. Positive if the motion was clockwise, negative if anti-clockwise."},"help":"Returns the delta z value. The difference between Body.rotation now and in the previous step.","line":715,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"destroy","static":false,"returns":null,"help":"Removes this bodies reference to its parent sprite, freeing it up for gc.","line":533,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"hitTest","static":false,"returns":{"types":["boolean"],"help":"True if the given coordinates are inside this Body, otherwise false."},"help":"Tests if a world point lies within this Body.","line":643,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The world x coordinate to test.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The world y coordinate to test.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"onFloor","static":false,"returns":{"types":["boolean"],"help":"True if in contact with either the world bounds or a tile."},"help":"Returns true if the bottom of this Body is in contact with either the world bounds or a tile.","line":655,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"onWall","static":false,"returns":{"types":["boolean"],"help":"True if in contact with either the world bounds or a tile."},"help":"Returns true if either side of this Body is in contact with either the world bounds or a tile.","line":665,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"render","static":false,"returns":null,"help":"Render Sprite Body.","line":791,"public":true,"protected":false,"private":false,"parameters":[{"name":"context","type":["object"],"help":"The context to render to.","optional":false,"default":null},{"name":"body","type":["Phaser.Physics.Arcade.Body"],"help":"The Body to render the info of.","optional":false,"default":null},{"name":"color","type":["string"],"help":"color of the debug info to be rendered. (format is css color string).","optional":true,"default":"'rgba(0,255,0,0.4)'"},{"name":"filled","type":["boolean"],"help":"Render the objected as a filled (default, true) or a stroked (false)","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""},{"name":"renderBodyInfo","static":false,"returns":null,"help":"Render Sprite Body Physics Data as text.","line":819,"public":true,"protected":false,"private":false,"parameters":[{"name":"body","type":["Phaser.Physics.Arcade.Body"],"help":"The Body to render the info of.","optional":false,"default":null},{"name":"x","type":["number"],"help":"X position of the debug info to be rendered.","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position of the debug info to be rendered.","optional":false,"default":null},{"name":"color","type":["string"],"help":"color of the debug info to be rendered. (format is css color string).","optional":true,"default":"'rgb(255,255,255)'"}],"inherited":false,"inheritedFrom":""},{"name":"reset","static":false,"returns":null,"help":"Resets all Body values (velocity, acceleration, rotation, etc)","line":611,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The new x position of the Body.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The new y position of the Body.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setSize","static":false,"returns":null,"help":"You can modify the size of the physics Body to be any dimension you need.\\nSo it could be smaller or larger than the parent Sprite. You can also control the x and y offset, which\\nis the position of the Body relative to the top-left of the Sprite.","line":587,"public":true,"protected":false,"private":false,"parameters":[{"name":"width","type":["number"],"help":"The width of the Body.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height of the Body.","optional":false,"default":null},{"name":"offsetX","type":["number"],"help":"The X offset of the Body from the Sprite position.","optional":true,"default":null},{"name":"offsetY","type":["number"],"help":"The Y offset of the Body from the Sprite position.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""}],"protected":[{"name":"checkWorldBounds","static":false,"returns":null,"help":"Internal method.","line":546,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"postUpdate","static":false,"returns":null,"help":"Internal method.","line":450,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"preUpdate","static":false,"returns":null,"help":"Internal method.","line":370,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"updateBounds","static":false,"returns":null,"help":"Internal method.","line":344,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""}],"private":[],"static":[]},"properties":{"public":[{"name":"acceleration","type":["Phaser.Point"],"help":"","inlineHelp":"The velocity in pixels per second sq. of the Body.","line":128,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"allowGravity","type":["boolean"],"help":"","inlineHelp":"Allow this Body to be influenced by gravity? Either world or local.","line":139,"default":"true","public":true,"protected":false,"private":false,"readOnly":false},{"name":"allowRotation","type":["boolean"],"help":"","inlineHelp":"Allow this Body to be rotated? (via angularVelocity, etc)","line":59,"default":"true","public":true,"protected":false,"private":false,"readOnly":false},{"name":"angle","type":["number"],"help":"","inlineHelp":"The angle of the Body in radians as calculated by its velocity, rather than its visual angle.","line":191,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"angularAcceleration","type":["number"],"help":"","inlineHelp":"The angular acceleration in pixels per second sq. of the Body.","line":167,"default":"0","public":true,"protected":false,"private":false,"readOnly":false},{"name":"angularDrag","type":["number"],"help":"","inlineHelp":"The angular drag applied to the rotation of the Body.","line":173,"default":"0","public":true,"protected":false,"private":false,"readOnly":false},{"name":"angularVelocity","type":["number"],"help":"","inlineHelp":"The angular velocity in pixels per second sq. of the Body.","line":161,"default":"0","public":true,"protected":false,"private":false,"readOnly":false},{"name":"blocked","type":["object"],"help":"This object is populated with boolean values when the Body collides with the World bounds or a Tile.\\nFor example if blocked.up is true then the Body cannot move up.","inlineHelp":"An object containing on which faces this Body is blocked from moving, if any.","line":285,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"bottom","type":["number"],"help":"","inlineHelp":"The bottom value of this Body (same as Body.y + Body.height)","line":726,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"bounce","type":["Phaser.Point"],"help":"","inlineHelp":"The elasticitiy of the Body when colliding. bounce.x\/y = 1 means full rebound, bounce.x\/y = 0.5 means 50% rebound velocity.","line":149,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"cache","type":[],"help":"","inlineHelp":"","line":92,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"center","type":["Phaser.Point"],"help":"","inlineHelp":"The center coordinate of the Physics Body.","line":107,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"checkCollision","type":["object"],"help":"Set the checkCollision properties to control which directions collision is processed for this Body.\\nFor example checkCollision.up = false means it won't collide when the collision happened while moving up.","inlineHelp":"An object containing allowed collision.","line":265,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"collideWorldBounds","type":["boolean"],"help":"A Body can be set to collide against the World bounds automatically and rebound back into the World if this is set to true. Otherwise it will leave the World.","inlineHelp":"Should the Body collide with the World bounds?","line":258,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"customSeparateX","type":["boolean"],"help":"This flag allows you to disable the custom x separation that takes place by Physics.Arcade.separate.\\nUsed in combination with your own collision processHandler you can create whatever type of collision response you need.","inlineHelp":"Use a custom separation system or the built-in one?","line":226,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"customSeparateY","type":["boolean"],"help":"This flag allows you to disable the custom y separation that takes place by Physics.Arcade.separate.\\nUsed in combination with your own collision processHandler you can create whatever type of collision response you need.","inlineHelp":"Use a custom separation system or the built-in one?","line":234,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"deltaMax","type":["Phaser.Point"],"help":"","inlineHelp":"The Sprite position is updated based on the delta x\/y values. You can set a cap on those (both +-) using deltaMax.","line":123,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"drag","type":["Phaser.Point"],"help":"","inlineHelp":"The drag applied to the motion of the Body.","line":133,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"embedded","type":["boolean"],"help":"If a body is overlapping with another body, but neither of them are moving (maybe they spawned on-top of each other?) this is set to true.","inlineHelp":"Body embed value.","line":252,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"enable","type":["boolean"],"help":"","inlineHelp":"A disabled body won't be checked for any form of collision or overlap or have its pre\/post updates run.","line":36,"default":"true","public":true,"protected":false,"private":false,"readOnly":false},{"name":"facing","type":["number"],"help":"","inlineHelp":"A const reference to the direction the Body is traveling or facing.","line":203,"default":"Phaser.NONE","public":true,"protected":false,"private":false,"readOnly":false},{"name":"game","type":["Phaser.Game"],"help":"","inlineHelp":"Local reference to game.","line":25,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"gravity","type":["Phaser.Point"],"help":"","inlineHelp":"A local gravity applied to this Body. If non-zero this over rides any world gravity, unless Body.allowGravity is set to false.","line":144,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"halfHeight","type":["number"],"help":"","inlineHelp":"The calculated height \/ 2 of the physics body.","line":102,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"halfWidth","type":["number"],"help":"","inlineHelp":"The calculated width \/ 2 of the physics body.","line":97,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"immovable","type":["boolean"],"help":"","inlineHelp":"An immovable Body will not receive any impacts from other bodies.","line":209,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"mass","type":["number"],"help":"","inlineHelp":"The mass of the Body.","line":185,"default":"1","public":true,"protected":false,"private":false,"readOnly":false},{"name":"maxAngular","type":["number"],"help":"","inlineHelp":"The maximum angular velocity in pixels per second sq. that the Body can reach.","line":179,"default":"1000","public":true,"protected":false,"private":false,"readOnly":false},{"name":"maxVelocity","type":["Phaser.Point"],"help":"","inlineHelp":"The maximum velocity in pixels per second sq. that the Body can reach.","line":155,"default":"new Phaser.Point(10000, 10000)","public":true,"protected":false,"private":false,"readOnly":false},{"name":"moves","type":["boolean"],"help":"If you have a Body that is being moved around the world via a tween or a Group motion, but its local x\/y position never\\nactually changes, then you should set Body.moves = false. Otherwise it will most likely fly off the screen.\\nIf you want the physics system to move the body around, then set moves to true.","inlineHelp":"Set to true to allow the Physics system to move this Body, other false to move it manually.","line":218,"default":"true","public":true,"protected":false,"private":false,"readOnly":false},{"name":"newVelocity","type":["Phaser.Point"],"help":"","inlineHelp":"New velocity.","line":118,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"offset","type":["Phaser.Point"],"help":"","inlineHelp":"The offset of the Physics Body from the Sprite x\/y position.","line":41,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"overlapX","type":["number"],"help":"When this body collides with another, the amount of overlap is stored here.","inlineHelp":"The amount of horizontal overlap during the collision.","line":240,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"overlapY","type":["number"],"help":"When this body collides with another, the amount of overlap is stored here.","inlineHelp":"The amount of vertical overlap during the collision.","line":246,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"phaser","type":["number"],"help":"","inlineHelp":"Is this Body in a preUpdate (1) or postUpdate (2) state?","line":297,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"position","type":["Phaser.Point"],"help":"","inlineHelp":"The position of the physics body.","line":47,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"preRotation","type":["number"],"help":"","inlineHelp":"The previous rotation of the physics body.","line":70,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"prev","type":["Phaser.Point"],"help":"","inlineHelp":"The previous position of the physics body.","line":53,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"right","type":["number"],"help":"","inlineHelp":"The right value of this Body (same as Body.x + Body.width)","line":739,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"rotation","type":["number"],"help":"","inlineHelp":"The amount the Body is rotated.","line":64,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"skipQuadTree","type":["boolean"],"help":"","inlineHelp":"If true and you collide this Sprite against a Group, it will disable the collision check from using a QuadTree.","line":302,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"sourceHeight","type":["number"],"help":"","inlineHelp":"The un-scaled original size.","line":82,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"sourceWidth","type":["number"],"help":"","inlineHelp":"The un-scaled original size.","line":76,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"speed","type":["number"],"help":"","inlineHelp":"The speed of the Body as calculated by its velocity.","line":197,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"sprite","type":["Phaser.Sprite"],"help":"","inlineHelp":"Reference to the parent Sprite.","line":20,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"tilePadding","type":["Phaser.Point"],"help":"If this is an especially small or fast moving object then it can sometimes skip over tilemap collisions if it moves through a tile in a step.\\nSet this padding value to add extra padding to its bounds. tilePadding.x applied to its width, y to its height.","inlineHelp":"Extra padding to be added to this sprites dimensions when checking for tile collision.","line":292,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"touching","type":["object"],"help":"This object is populated with boolean values when the Body collides with another.\\ntouching.up = true means the collision happened to the top of this Body for example.","inlineHelp":"An object containing touching results.","line":272,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"type","type":["number"],"help":"","inlineHelp":"The type of physics system this body belongs to.","line":30,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"velocity","type":["Phaser.Point"],"help":"","inlineHelp":"The velocity in pixels per second sq. of the Body.","line":112,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"wasTouching","type":["object"],"help":"This object is populated with previous touching values from the bodies previous collision.","inlineHelp":"An object containing previous touching results.","line":278,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"width","type":["number"],"help":"","inlineHelp":"The calculated width of the physics body.","line":87,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"x","type":["number"],"help":"","inlineHelp":"The x position.","line":751,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"y","type":["number"],"help":"","inlineHelp":"The y position.","line":768,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[{"name":"_dx","type":["number"],"help":"","inlineHelp":"Internal cache var.","line":326,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_dy","type":["number"],"help":"","inlineHelp":"Internal cache var.","line":332,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_reset","type":["boolean"],"help":"","inlineHelp":"Internal cache var.","line":308,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_sx","type":["number"],"help":"","inlineHelp":"Internal cache var.","line":314,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_sy","type":["number"],"help":"","inlineHelp":"Internal cache var.","line":320,"default":null,"public":false,"protected":false,"private":true,"readOnly":false}]}}