mirror of
https://github.com/photonstorm/phaser
synced 2024-12-21 02:23:29 +00:00
1 line
No EOL
14 KiB
JSON
1 line
No EOL
14 KiB
JSON
{"class":{"name":"Phaser.Physics.Ninja.Body","extends":"","static":false,"constructor":true,"parameters":[{"name":"system","type":["Phaser.Physics.Ninja"],"help":"The physics system this Body belongs to.","optional":false,"default":null},{"name":"sprite","type":["Phaser.Sprite"],"help":"The Sprite object this physics body belongs to.","optional":false,"default":null},{"name":"type","type":["number"],"help":"The type of Ninja shape to create. 1 = AABB, 2 = Circle or 3 = Tile.","optional":true,"default":"1"},{"name":"id","type":["number"],"help":"If this body is using a Tile shape, you can set the Tile id here, i.e. Phaser.Physics.Ninja.Tile.SLOPE_45DEGpn, Phaser.Physics.Ninja.Tile.CONVEXpp, etc.","optional":true,"default":"1"},{"name":"radius","type":["number"],"help":"If this body is using a Circle shape this controls the radius.","optional":true,"default":"16"},{"name":"x","type":["number"],"help":"The x coordinate of this Body. This is only used if a sprite is not provided.","optional":true,"default":"0"},{"name":"y","type":["number"],"help":"The y coordinate of this Body. This is only used if a sprite is not provided.","optional":true,"default":"0"},{"name":"width","type":["number"],"help":"The width of this Body. This is only used if a sprite is not provided.","optional":true,"default":"0"},{"name":"height","type":["number"],"help":"The height of this Body. This is only used if a sprite is not provided.","optional":true,"default":"0"}],"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, 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":387,"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":397,"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":407,"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":417,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"destroy","static":false,"returns":null,"help":"Destroys this body's reference to the sprite and system, and destroys its shape.","line":426,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"moveBackward","static":false,"returns":null,"help":"Moves the Body backwards based on its current angle and the given speed.\\nThe speed is represented in pixels per second. So a value of 100 would move 100 pixels in 1 second (1000ms).","line":295,"public":true,"protected":false,"private":false,"parameters":[{"name":"speed","type":["number"],"help":"The speed at which it should move backwards.","optional":false,"default":null},{"name":"angle","type":["number"],"help":"The angle in which it should move, given in degrees.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"moveDown","static":false,"returns":null,"help":"If this Body is dynamic then this will move it down by setting its y velocity to the given speed.\\nThe speed is represented in pixels per second. So a value of 100 would move 100 pixels in 1 second (1000ms).","line":357,"public":true,"protected":false,"private":false,"parameters":[{"name":"speed","type":["number"],"help":"The speed at which it should move down, in pixels per second.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"moveLeft","static":false,"returns":null,"help":"If this Body is dynamic then this will move it to the left by setting its x velocity to the given speed.\\nThe speed is represented in pixels per second. So a value of 100 would move 100 pixels in 1 second (1000ms).","line":312,"public":true,"protected":false,"private":false,"parameters":[{"name":"speed","type":["number"],"help":"The speed at which it should move to the left, in pixels per second.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"moveRight","static":false,"returns":null,"help":"If this Body is dynamic then this will move it to the right by setting its x velocity to the given speed.\\nThe speed is represented in pixels per second. So a value of 100 would move 100 pixels in 1 second (1000ms).","line":327,"public":true,"protected":false,"private":false,"parameters":[{"name":"speed","type":["number"],"help":"The speed at which it should move to the right, in pixels per second.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"moveTo","static":false,"returns":null,"help":"Moves the Body forwards based on its current angle and the given speed.\\nThe speed is represented in pixels per second. So a value of 100 would move 100 pixels in 1 second (1000ms).","line":277,"public":true,"protected":false,"private":false,"parameters":[{"name":"speed","type":["number"],"help":"The speed at which it should move forwards.","optional":false,"default":null},{"name":"angle","type":["number"],"help":"The angle in which it should move, given in degrees.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"moveUp","static":false,"returns":null,"help":"If this Body is dynamic then this will move it up by setting its y velocity to the given speed.\\nThe speed is represented in pixels per second. So a value of 100 would move 100 pixels in 1 second (1000ms).","line":342,"public":true,"protected":false,"private":false,"parameters":[{"name":"speed","type":["number"],"help":"The speed at which it should move up, in pixels per second.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"render","static":false,"returns":null,"help":"Render Sprite's Body.","line":557,"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.Ninja.Body"],"help":"The Body to render.","optional":false,"default":null},{"name":"color","type":["string"],"help":"color of the debug shape to be rendered. (format is css color string).","optional":true,"default":"'rgba(0,255,0,0.4)'"},{"name":"filled","type":["boolean"],"help":"Render the shape as a filled (default, true) or a stroked (false)","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""},{"name":"reset","static":false,"returns":null,"help":"Resets all Body values and repositions on the Sprite.","line":370,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"setZeroVelocity","static":false,"returns":null,"help":"Stops all movement of this body.","line":262,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""}],"protected":[{"name":"postUpdate","static":false,"returns":null,"help":"Internal method.","line":220,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"preUpdate","static":false,"returns":null,"help":"Internal method.","line":190,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""}],"private":[],"static":[]},"properties":{"public":[{"name":"aabb","type":["Phaser.Physics.Ninja.AABB"],"help":"","inlineHelp":"The AABB object this body is using for collision.","line":54,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"angle","type":["number"],"help":"","inlineHelp":"The angle of this Body","line":540,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"bottom","type":["number"],"help":"","inlineHelp":"The bottom value of this Body (same as Body.y + Body.height)","line":501,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"bounce","type":["number"],"help":"","inlineHelp":"The bounciness of this object when it collides. A value between 0 and 1. We recommend setting it to 0.999 to avoid jittering.","line":95,"default":"0.3","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":125,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"circle","type":["Phaser.Physics.Ninja.Circle"],"help":"","inlineHelp":"The Circle object this body is using for collision.","line":64,"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":118,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"drag","type":["number"],"help":"","inlineHelp":"The drag applied to this object as it moves.","line":77,"default":"1","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":106,"default":"Phaser.NONE","public":true,"protected":false,"private":false,"readOnly":false},{"name":"friction","type":["number"],"help":"","inlineHelp":"The friction applied to this object as it moves.","line":83,"default":"0.05","public":true,"protected":false,"private":false,"readOnly":false},{"name":"game","type":["Phaser.Game"],"help":"","inlineHelp":"Local reference to game.","line":39,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"gravityScale","type":["number"],"help":"","inlineHelp":"How much of the world gravity should be applied to this object? 1 = all of it, 0.5 = 50%, etc.","line":89,"default":"1","public":true,"protected":false,"private":false,"readOnly":false},{"name":"height","type":["number"],"help":"","inlineHelp":"The height of this Body","line":488,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"immovable","type":["boolean"],"help":"","inlineHelp":"An immovable Body will not receive any impacts from other bodies. Not fully implemented.","line":112,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"maxSpeed","type":["number"],"help":"","inlineHelp":"The maximum speed this body can travel at (taking drag and friction into account)","line":144,"default":"8","public":true,"protected":false,"private":false,"readOnly":false},{"name":"right","type":["number"],"help":"","inlineHelp":"The right value of this Body (same as Body.x + Body.width)","line":514,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"shape","type":["object"],"help":"","inlineHelp":"A local reference to the body shape.","line":69,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"speed","type":["number"],"help":"","inlineHelp":"The speed of this Body","line":527,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"sprite","type":["Phaser.Sprite"],"help":"","inlineHelp":"Reference to the parent Sprite.","line":34,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"system","type":["Phaser.Physics.Ninja"],"help":"","inlineHelp":"The parent physics system.","line":49,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"tile","type":["Phaser.Physics.Ninja.Tile"],"help":"","inlineHelp":"The Tile object this body is using for collision.","line":59,"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":132,"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":44,"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":100,"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":138,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"width","type":["number"],"help":"","inlineHelp":"The width of this Body","line":475,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"x","type":["number"],"help":"","inlineHelp":"The x position.","line":442,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"y","type":["number"],"help":"","inlineHelp":"The y position.","line":458,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[]}} |