mirror of
https://github.com/photonstorm/phaser
synced 2024-11-25 22:20:44 +00:00
Lots of type fixes
This commit is contained in:
parent
91e59ab39a
commit
f15ef8648e
24 changed files with 883 additions and 324 deletions
|
@ -86,7 +86,7 @@ var Factory = new Class({
|
|||
* @param {number} height - The height of the Body.
|
||||
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.
|
||||
*
|
||||
* @return {MatterJS.Body} A Matter JS Body.
|
||||
* @return {MatterJS.BodyType} A Matter JS Body.
|
||||
*/
|
||||
rectangle: function (x, y, width, height, options)
|
||||
{
|
||||
|
@ -110,7 +110,7 @@ var Factory = new Class({
|
|||
* @param {number} slope - The slope of the trapezoid. 0 creates a rectangle, while 1 creates a triangle. Positive values make the top side shorter, while negative values make the bottom side shorter.
|
||||
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.
|
||||
*
|
||||
* @return {MatterJS.Body} A Matter JS Body.
|
||||
* @return {MatterJS.BodyType} A Matter JS Body.
|
||||
*/
|
||||
trapezoid: function (x, y, width, height, slope, options)
|
||||
{
|
||||
|
@ -133,7 +133,7 @@ var Factory = new Class({
|
|||
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.
|
||||
* @param {number} [maxSides] - The maximum amount of sides to use for the polygon which will approximate this circle.
|
||||
*
|
||||
* @return {MatterJS.Body} A Matter JS Body.
|
||||
* @return {MatterJS.BodyType} A Matter JS Body.
|
||||
*/
|
||||
circle: function (x, y, radius, options, maxSides)
|
||||
{
|
||||
|
@ -156,7 +156,7 @@ var Factory = new Class({
|
|||
* @param {number} radius - The "radius" of the polygon, i.e. the distance from its center to any vertex. This is also the radius of its circumcircle.
|
||||
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.
|
||||
*
|
||||
* @return {MatterJS.Body} A Matter JS Body.
|
||||
* @return {MatterJS.BodyType} A Matter JS Body.
|
||||
*/
|
||||
polygon: function (x, y, sides, radius, options)
|
||||
{
|
||||
|
@ -182,7 +182,7 @@ var Factory = new Class({
|
|||
* @param {number} [removeCollinear=0.01] - Whether Matter.js will discard collinear edges (to improve performance).
|
||||
* @param {number} [minimumArea=10] - During decomposition discard parts that have an area less than this.
|
||||
*
|
||||
* @return {MatterJS.Body} A Matter JS Body.
|
||||
* @return {MatterJS.BodyType} A Matter JS Body.
|
||||
*/
|
||||
fromVertices: function (x, y, vertexSets, options, flagInternal, removeCollinear, minimumArea)
|
||||
{
|
||||
|
@ -229,7 +229,7 @@ var Factory = new Class({
|
|||
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.
|
||||
* @param {boolean} [addToWorld=true] - Should the newly created body be immediately added to the World?
|
||||
*
|
||||
* @return {MatterJS.Body} A Matter JS Body.
|
||||
* @return {MatterJS.BodyType} A Matter JS Body.
|
||||
*/
|
||||
fromPhysicsEditor: function (x, y, config, options, addToWorld)
|
||||
{
|
||||
|
@ -275,7 +275,7 @@ var Factory = new Class({
|
|||
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.
|
||||
* @param {boolean} [addToWorld=true] - Should the newly created body be immediately added to the World?
|
||||
*
|
||||
* @return {MatterJS.Body} A Matter JS Body.
|
||||
* @return {MatterJS.BodyType} A Matter JS Body.
|
||||
*/
|
||||
fromSVG: function (x, y, xml, scale, options, addToWorld)
|
||||
{
|
||||
|
@ -355,7 +355,7 @@ var Factory = new Class({
|
|||
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.
|
||||
* @param {boolean} [addToWorld=true] - Should the newly created body be immediately added to the World?
|
||||
*
|
||||
* @return {MatterJS.Body} A Matter JS Body.
|
||||
* @return {MatterJS.BodyType} A Matter JS Body.
|
||||
*/
|
||||
fromJSON: function (x, y, config, options, addToWorld)
|
||||
{
|
||||
|
@ -389,7 +389,7 @@ var Factory = new Class({
|
|||
* @param {number} [rowGap=0] - The distance between each row.
|
||||
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.
|
||||
*
|
||||
* @return {MatterJS.Composite} A Matter JS Composite Stack.
|
||||
* @return {MatterJS.CompositeType} A Matter JS Composite Stack.
|
||||
*/
|
||||
imageStack: function (key, frame, x, y, columns, rows, columnGap, rowGap, options)
|
||||
{
|
||||
|
@ -432,7 +432,7 @@ var Factory = new Class({
|
|||
* @param {number} rowGap - The distance between each row.
|
||||
* @param {function} callback - The callback that creates the stack.
|
||||
*
|
||||
* @return {MatterJS.Composite} A new composite containing objects created in the callback.
|
||||
* @return {MatterJS.CompositeType} A new composite containing objects created in the callback.
|
||||
*/
|
||||
stack: function (x, y, columns, rows, columnGap, rowGap, callback)
|
||||
{
|
||||
|
@ -458,7 +458,7 @@ var Factory = new Class({
|
|||
* @param {number} rowGap - The distance between each row.
|
||||
* @param {function} callback - The callback function to be invoked.
|
||||
*
|
||||
* @return {MatterJS.Composite} A Matter JS Composite pyramid.
|
||||
* @return {MatterJS.CompositeType} A Matter JS Composite pyramid.
|
||||
*/
|
||||
pyramid: function (x, y, columns, rows, columnGap, rowGap, callback)
|
||||
{
|
||||
|
@ -475,14 +475,14 @@ var Factory = new Class({
|
|||
* @method Phaser.Physics.Matter.Factory#chain
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {MatterJS.Composite} composite - The composite in which all bodies will be chained together sequentially.
|
||||
* @param {MatterJS.CompositeType} composite - The composite in which all bodies will be chained together sequentially.
|
||||
* @param {number} xOffsetA - The horizontal offset of the BodyA constraint. This is a percentage based on the body size, not a world position.
|
||||
* @param {number} yOffsetA - The vertical offset of the BodyA constraint. This is a percentage based on the body size, not a world position.
|
||||
* @param {number} xOffsetB - The horizontal offset of the BodyB constraint. This is a percentage based on the body size, not a world position.
|
||||
* @param {number} yOffsetB - The vertical offset of the BodyB constraint. This is a percentage based on the body size, not a world position.
|
||||
* @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.
|
||||
*
|
||||
* @return {MatterJS.Composite} The original composite that was passed to this method.
|
||||
* @return {MatterJS.CompositeType} The original composite that was passed to this method.
|
||||
*/
|
||||
chain: function (composite, xOffsetA, yOffsetA, xOffsetB, yOffsetB, options)
|
||||
{
|
||||
|
@ -495,13 +495,13 @@ var Factory = new Class({
|
|||
* @method Phaser.Physics.Matter.Factory#mesh
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {MatterJS.Composite} composite - The composite in which all bodies will be chained together.
|
||||
* @param {MatterJS.CompositeType} composite - The composite in which all bodies will be chained together.
|
||||
* @param {number} columns - The number of columns in the mesh.
|
||||
* @param {number} rows - The number of rows in the mesh.
|
||||
* @param {boolean} crossBrace - Create cross braces for the mesh as well?
|
||||
* @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.
|
||||
*
|
||||
* @return {MatterJS.Composite} The original composite that was passed to this method.
|
||||
* @return {MatterJS.CompositeType} The original composite that was passed to this method.
|
||||
*/
|
||||
mesh: function (composite, columns, rows, crossBrace, options)
|
||||
{
|
||||
|
@ -520,7 +520,7 @@ var Factory = new Class({
|
|||
* @param {number} size - The radius of each ball in the cradle.
|
||||
* @param {number} length - The length of the 'string' the balls hang from.
|
||||
*
|
||||
* @return {MatterJS.Composite} A Newton's cradle composite.
|
||||
* @return {MatterJS.CompositeType} A Newton's cradle composite.
|
||||
*/
|
||||
newtonsCradle: function (x, y, number, size, length)
|
||||
{
|
||||
|
@ -543,7 +543,7 @@ var Factory = new Class({
|
|||
* @param {number} height - The height of the car chasis.
|
||||
* @param {number} wheelSize - The radius of the car wheels.
|
||||
*
|
||||
* @return {MatterJS.Composite} A new composite car body.
|
||||
* @return {MatterJS.CompositeType} A new composite car body.
|
||||
*/
|
||||
car: function (x, y, width, height, wheelSize)
|
||||
{
|
||||
|
@ -571,7 +571,7 @@ var Factory = new Class({
|
|||
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [particleOptions] - An optional Body configuration object that is used to set initial Body properties on creation.
|
||||
* @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [constraintOptions] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.
|
||||
*
|
||||
* @return {MatterJS.Composite} A new composite simple soft body.
|
||||
* @return {MatterJS.CompositeType} A new composite simple soft body.
|
||||
*/
|
||||
softBody: function (x, y, columns, rows, columnGap, rowGap, crossBrace, particleRadius, particleOptions, constraintOptions)
|
||||
{
|
||||
|
@ -601,13 +601,13 @@ var Factory = new Class({
|
|||
* @method Phaser.Physics.Matter.Factory#joint
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {MatterJS.Body} bodyA - The first possible `Body` that this constraint is attached to.
|
||||
* @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to.
|
||||
* @param {MatterJS.BodyType} bodyA - The first possible `Body` that this constraint is attached to.
|
||||
* @param {MatterJS.BodyType} bodyB - The second possible `Body` that this constraint is attached to.
|
||||
* @param {number} [length] - A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`.
|
||||
* @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring.
|
||||
* @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.
|
||||
*
|
||||
* @return {MatterJS.Constraint} A Matter JS Constraint.
|
||||
* @return {MatterJS.ConstraintType} A Matter JS Constraint.
|
||||
*/
|
||||
joint: function (bodyA, bodyB, length, stiffness, options)
|
||||
{
|
||||
|
@ -633,13 +633,13 @@ var Factory = new Class({
|
|||
* @method Phaser.Physics.Matter.Factory#spring
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {MatterJS.Body} bodyA - The first possible `Body` that this constraint is attached to.
|
||||
* @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to.
|
||||
* @param {MatterJS.BodyType} bodyA - The first possible `Body` that this constraint is attached to.
|
||||
* @param {MatterJS.BodyType} bodyB - The second possible `Body` that this constraint is attached to.
|
||||
* @param {number} [length] - A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`.
|
||||
* @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring.
|
||||
* @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.
|
||||
*
|
||||
* @return {MatterJS.Constraint} A Matter JS Constraint.
|
||||
* @return {MatterJS.ConstraintType} A Matter JS Constraint.
|
||||
*/
|
||||
spring: function (bodyA, bodyB, length, stiffness, options)
|
||||
{
|
||||
|
@ -663,13 +663,13 @@ var Factory = new Class({
|
|||
* @method Phaser.Physics.Matter.Factory#constraint
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {MatterJS.Body} bodyA - The first possible `Body` that this constraint is attached to.
|
||||
* @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to.
|
||||
* @param {MatterJS.BodyType} bodyA - The first possible `Body` that this constraint is attached to.
|
||||
* @param {MatterJS.BodyType} bodyB - The second possible `Body` that this constraint is attached to.
|
||||
* @param {number} [length] - A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`.
|
||||
* @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring.
|
||||
* @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.
|
||||
*
|
||||
* @return {MatterJS.Constraint} A Matter JS Constraint.
|
||||
* @return {MatterJS.ConstraintType} A Matter JS Constraint.
|
||||
*/
|
||||
constraint: function (bodyA, bodyB, length, stiffness, options)
|
||||
{
|
||||
|
@ -713,12 +713,12 @@ var Factory = new Class({
|
|||
* @method Phaser.Physics.Matter.Factory#worldConstraint
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {MatterJS.Body} body - The Matter `Body` that this constraint is attached to.
|
||||
* @param {MatterJS.BodyType} body - The Matter `Body` that this constraint is attached to.
|
||||
* @param {number} [length] - A number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`.
|
||||
* @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring.
|
||||
* @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.
|
||||
*
|
||||
* @return {MatterJS.Constraint} A Matter JS Constraint.
|
||||
* @return {MatterJS.ConstraintType} A Matter JS Constraint.
|
||||
*/
|
||||
worldConstraint: function (body, length, stiffness, options)
|
||||
{
|
||||
|
@ -758,7 +758,7 @@ var Factory = new Class({
|
|||
*
|
||||
* @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.
|
||||
*
|
||||
* @return {MatterJS.Constraint} A Matter JS Constraint.
|
||||
* @return {MatterJS.ConstraintType} A Matter JS Constraint.
|
||||
*/
|
||||
mouseSpring: function (options)
|
||||
{
|
||||
|
@ -780,7 +780,7 @@ var Factory = new Class({
|
|||
*
|
||||
* @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.
|
||||
*
|
||||
* @return {MatterJS.Constraint} A Matter JS Constraint.
|
||||
* @return {MatterJS.ConstraintType} A Matter JS Constraint.
|
||||
*/
|
||||
pointerConstraint: function (options)
|
||||
{
|
||||
|
|
|
@ -1044,7 +1044,7 @@ var MatterPhysics = new Class({
|
|||
*
|
||||
* @param {array} [bodies] - An array of objects to extract the bodies from. If falsey, it will return all bodies in the world.
|
||||
*
|
||||
* @return {MatterJS.Body[]} An array of native Matter Body objects.
|
||||
* @return {MatterJS.BodyType[]} An array of native Matter Body objects.
|
||||
*/
|
||||
getMatterBodies: function (bodies)
|
||||
{
|
||||
|
@ -1290,7 +1290,7 @@ var MatterPhysics = new Class({
|
|||
* @method Phaser.Physics.Matter.MatterPhysics#getConstraintLength
|
||||
* @since 3.22.0
|
||||
*
|
||||
* @param {MatterJS.Constraint} constraint - The constraint to get the length from.
|
||||
* @param {MatterJS.ConstraintType} constraint - The constraint to get the length from.
|
||||
*
|
||||
* @return {number} The length of the constraint.
|
||||
*/
|
||||
|
|
|
@ -243,7 +243,7 @@ var MatterTileBody = new Class({
|
|||
* @method Phaser.Physics.Matter.TileBody#setBody
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {MatterJS.Body} body - The new Matter body to use.
|
||||
* @param {MatterJS.BodyType} body - The new Matter body to use.
|
||||
* @param {boolean} [addToWorld=true] - Whether or not to add the body to the Matter world.
|
||||
*
|
||||
* @return {Phaser.Physics.Matter.TileBody} This TileBody object.
|
||||
|
|
|
@ -32,7 +32,7 @@ var PhysicsEditorParser = {
|
|||
* @param {object} config - The body configuration and fixture (child body) definitions, as exported by PhysicsEditor.
|
||||
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.
|
||||
*
|
||||
* @return {MatterJS.Body} A compound Matter JS Body.
|
||||
* @return {MatterJS.BodyType} A compound Matter JS Body.
|
||||
*/
|
||||
parseBody: function (x, y, config, options)
|
||||
{
|
||||
|
@ -75,7 +75,7 @@ var PhysicsEditorParser = {
|
|||
*
|
||||
* @param {object} fixtureConfig - The fixture object to parse.
|
||||
*
|
||||
* @return {MatterJS.Body[]} - An array of Matter JS Bodies.
|
||||
* @return {MatterJS.BodyType[]} - An array of Matter JS Bodies.
|
||||
*/
|
||||
parseFixture: function (fixtureConfig)
|
||||
{
|
||||
|
@ -110,7 +110,7 @@ var PhysicsEditorParser = {
|
|||
* @param {array} vertexSets - The vertex lists to parse.
|
||||
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.
|
||||
*
|
||||
* @return {MatterJS.Body[]} - An array of Matter JS Bodies.
|
||||
* @return {MatterJS.BodyType[]} - An array of Matter JS Bodies.
|
||||
*/
|
||||
parseVertices: function (vertexSets, options)
|
||||
{
|
||||
|
|
|
@ -61,7 +61,7 @@ var PhysicsJSONParser = {
|
|||
* @param {object} config - The body configuration data.
|
||||
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.
|
||||
*
|
||||
* @return {MatterJS.Body} A Matter JS Body.
|
||||
* @return {MatterJS.BodyType} A Matter JS Body.
|
||||
*/
|
||||
parseBody: function (x, y, config, options)
|
||||
{
|
||||
|
|
|
@ -125,7 +125,7 @@ var PointerConstraint = new Class({
|
|||
* The body that is currently being dragged, if any.
|
||||
*
|
||||
* @name Phaser.Physics.Matter.PointerConstraint#body
|
||||
* @type {?MatterJS.Body}
|
||||
* @type {?MatterJS.BodyType}
|
||||
* @since 3.16.2
|
||||
*/
|
||||
this.body = null;
|
||||
|
@ -134,7 +134,7 @@ var PointerConstraint = new Class({
|
|||
* The part of the body that was clicked on to start the drag.
|
||||
*
|
||||
* @name Phaser.Physics.Matter.PointerConstraint#part
|
||||
* @type {?MatterJS.Body}
|
||||
* @type {?MatterJS.BodyType}
|
||||
* @since 3.16.2
|
||||
*/
|
||||
this.part = null;
|
||||
|
@ -143,7 +143,7 @@ var PointerConstraint = new Class({
|
|||
* The native Matter Constraint that is used to attach to bodies.
|
||||
*
|
||||
* @name Phaser.Physics.Matter.PointerConstraint#constraint
|
||||
* @type {MatterJS.Constraint}
|
||||
* @type {MatterJS.ConstraintType}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
this.constraint = Constraint.create(Merge(options, defaults));
|
||||
|
@ -239,7 +239,7 @@ var PointerConstraint = new Class({
|
|||
* @method Phaser.Physics.Matter.PointerConstraint#hitTestBody
|
||||
* @since 3.16.2
|
||||
*
|
||||
* @param {MatterJS.Body} body - The Matter Body to check.
|
||||
* @param {MatterJS.BodyType} body - The Matter Body to check.
|
||||
* @param {Phaser.Math.Vector2} position - A translated hit test position.
|
||||
*
|
||||
* @return {boolean} `true` if a part of the body was hit, otherwise `false`.
|
||||
|
|
|
@ -354,7 +354,7 @@ var World = new Class({
|
|||
* @method Phaser.Physics.Matter.World#setCompositeRenderStyle
|
||||
* @since 3.22.0
|
||||
*
|
||||
* @param {MatterJS.Composite} composite - The Matter Composite to set the render style on.
|
||||
* @param {MatterJS.CompositeType} composite - The Matter Composite to set the render style on.
|
||||
*
|
||||
* @return {this} This Matter World instance for method chaining.
|
||||
*/
|
||||
|
@ -408,7 +408,7 @@ var World = new Class({
|
|||
* @method Phaser.Physics.Matter.World#setBodyRenderStyle
|
||||
* @since 3.22.0
|
||||
*
|
||||
* @param {MatterJS.Body} body - The Matter Body to set the render style on.
|
||||
* @param {MatterJS.BodyType} body - The Matter Body to set the render style on.
|
||||
* @param {number} [lineColor] - The line color. If `null` it will use the World Debug Config value.
|
||||
* @param {number} [lineOpacity] - The line opacity, between 0 and 1. If `null` it will use the World Debug Config value.
|
||||
* @param {number} [lineThickness] - The line thickness. If `null` it will use the World Debug Config value.
|
||||
|
@ -494,7 +494,7 @@ var World = new Class({
|
|||
* @method Phaser.Physics.Matter.World#setConstraintRenderStyle
|
||||
* @since 3.22.0
|
||||
*
|
||||
* @param {MatterJS.Constraint} constraint - The Matter Constraint to set the render style on.
|
||||
* @param {MatterJS.ConstraintType} constraint - The Matter Constraint to set the render style on.
|
||||
* @param {number} [lineColor] - The line color. If `null` it will use the World Debug Config value.
|
||||
* @param {number} [lineOpacity] - The line opacity, between 0 and 1. If `null` it will use the World Debug Config value.
|
||||
* @param {number} [lineThickness] - The line thickness. If `null` it will use the World Debug Config value.
|
||||
|
@ -886,7 +886,7 @@ var World = new Class({
|
|||
* @param {number} height - The height of the body.
|
||||
* @param {object} options - Optional Matter configuration object.
|
||||
*
|
||||
* @return {MatterJS.Body} The Matter.js body that was created.
|
||||
* @return {MatterJS.BodyType} The Matter.js body that was created.
|
||||
*/
|
||||
create: function (x, y, width, height, options)
|
||||
{
|
||||
|
@ -960,7 +960,7 @@ var World = new Class({
|
|||
* @method Phaser.Physics.Matter.World#removeConstraint
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(MatterJS.Constraint|MatterJS.Constraint[])} constraint - A Matter JS Constraint, or an array of constraints, to be removed.
|
||||
* @param {(MatterJS.ConstraintType|MatterJS.ConstraintType[])} constraint - A Matter JS Constraint, or an array of constraints, to be removed.
|
||||
* @param {boolean} [deep=false] - Optionally search the objects children and recursively remove those as well.
|
||||
*
|
||||
* @return {this} This Matter World object.
|
||||
|
@ -1244,7 +1244,7 @@ var World = new Class({
|
|||
*
|
||||
* @param {(MatterJS.Body|Phaser.GameObjects.GameObject)} body - The Matter Body, or Game Object, to search for within the world.
|
||||
*
|
||||
* @return {MatterJS.Body[]} An array of all the Matter JS Bodies in this World.
|
||||
* @return {MatterJS.BodyType[]} An array of all the Matter JS Bodies in this World.
|
||||
*/
|
||||
has: function (body)
|
||||
{
|
||||
|
@ -1259,7 +1259,7 @@ var World = new Class({
|
|||
* @method Phaser.Physics.Matter.World#getAllBodies
|
||||
* @since 3.22.0
|
||||
*
|
||||
* @return {MatterJS.Body[]} An array of all the Matter JS Bodies in this World.
|
||||
* @return {MatterJS.BodyType[]} An array of all the Matter JS Bodies in this World.
|
||||
*/
|
||||
getAllBodies: function ()
|
||||
{
|
||||
|
@ -1272,7 +1272,7 @@ var World = new Class({
|
|||
* @method Phaser.Physics.Matter.World#getAllConstraints
|
||||
* @since 3.22.0
|
||||
*
|
||||
* @return {MatterJS.Constraint[]} An array of all the Matter JS Constraints in this World.
|
||||
* @return {MatterJS.ConstraintType[]} An array of all the Matter JS Constraints in this World.
|
||||
*/
|
||||
getAllConstraints: function ()
|
||||
{
|
||||
|
@ -1285,7 +1285,7 @@ var World = new Class({
|
|||
* @method Phaser.Physics.Matter.World#getAllComposites
|
||||
* @since 3.22.0
|
||||
*
|
||||
* @return {MatterJS.Composite[]} An array of all the Matter JS Composites in this World.
|
||||
* @return {MatterJS.CompositeType[]} An array of all the Matter JS Composites in this World.
|
||||
*/
|
||||
getAllComposites: function ()
|
||||
{
|
||||
|
@ -1851,7 +1851,7 @@ var World = new Class({
|
|||
* @method Phaser.Physics.Matter.World#renderBody
|
||||
* @since 3.22.0
|
||||
*
|
||||
* @param {MatterJS.Body} body - The Matter Body to be rendered.
|
||||
* @param {MatterJS.BodyType} body - The Matter Body to be rendered.
|
||||
* @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to.
|
||||
* @param {boolean} showInternalEdges - Render internal edges of the polygon?
|
||||
* @param {number} [lineColor] - The line color.
|
||||
|
@ -1988,7 +1988,7 @@ var World = new Class({
|
|||
* @method Phaser.Physics.Matter.World#renderConvexHull
|
||||
* @since 3.22.0
|
||||
*
|
||||
* @param {MatterJS.Body} body - The Matter Body to be rendered.
|
||||
* @param {MatterJS.BodyType} body - The Matter Body to be rendered.
|
||||
* @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to.
|
||||
* @param {number} hullColor - The color used to render the hull.
|
||||
* @param {number} [lineThickness=1] - The hull line thickness.
|
||||
|
@ -2066,7 +2066,7 @@ var World = new Class({
|
|||
* @method Phaser.Physics.Matter.World#renderConstraint
|
||||
* @since 3.22.0
|
||||
*
|
||||
* @param {MatterJS.Constraint} constraint - The Matter Constraint to render.
|
||||
* @param {MatterJS.ConstraintType} constraint - The Matter Constraint to render.
|
||||
* @param {Phaser.GameObjects.Graphics} graphics - The Graphics object to render to.
|
||||
* @param {number} lineColor - The line color.
|
||||
* @param {number} lineOpacity - The line opacity, between 0 and 1.
|
||||
|
|
|
@ -108,7 +108,7 @@ var SetBody = {
|
|||
* @method Phaser.Physics.Matter.Components.SetBody#setExistingBody
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {MatterJS.Body} body - The Body this Game Object should use.
|
||||
* @param {MatterJS.BodyType} body - The Body this Game Object should use.
|
||||
* @param {boolean} [addToWorld=true] - Should the body be immediately added to the World?
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Physics.Matter.Events.CollisionActiveEvent} event - The Collision Event object.
|
||||
* @param {MatterJS.Body} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
|
||||
* @param {MatterJS.Body} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
|
||||
* @param {MatterJS.BodyType} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
|
||||
* @param {MatterJS.BodyType} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
|
||||
*/
|
||||
module.exports = 'collisionactive';
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Physics.Matter.Events.CollisionEndEvent} event - The Collision Event object.
|
||||
* @param {MatterJS.Body} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
|
||||
* @param {MatterJS.Body} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
|
||||
* @param {MatterJS.BodyType} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
|
||||
* @param {MatterJS.BodyType} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
|
||||
*/
|
||||
module.exports = 'collisionend';
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Physics.Matter.Events.CollisionStartEvent} event - The Collision Event object.
|
||||
* @param {MatterJS.Body} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
|
||||
* @param {MatterJS.Body} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
|
||||
* @param {MatterJS.BodyType} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
|
||||
* @param {MatterJS.BodyType} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies.
|
||||
*/
|
||||
module.exports = 'collisionstart';
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* @event Phaser.Physics.Matter.Events#DRAG_END
|
||||
* @since 3.16.2
|
||||
*
|
||||
* @param {MatterJS.Body} body - The Body that has stopped being dragged. This is a Matter Body, not a Phaser Game Object.
|
||||
* @param {MatterJS.BodyType} body - The Body that has stopped being dragged. This is a Matter Body, not a Phaser Game Object.
|
||||
* @param {Phaser.Physics.Matter.PointerConstraint} constraint - The Pointer Constraint that was dragging the body.
|
||||
*/
|
||||
module.exports = 'dragend';
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* @event Phaser.Physics.Matter.Events#DRAG
|
||||
* @since 3.16.2
|
||||
*
|
||||
* @param {MatterJS.Body} body - The Body that is being dragged. This is a Matter Body, not a Phaser Game Object.
|
||||
* @param {MatterJS.BodyType} body - The Body that is being dragged. This is a Matter Body, not a Phaser Game Object.
|
||||
* @param {Phaser.Physics.Matter.PointerConstraint} constraint - The Pointer Constraint that is dragging the body.
|
||||
*/
|
||||
module.exports = 'drag';
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
* @event Phaser.Physics.Matter.Events#DRAG_START
|
||||
* @since 3.16.2
|
||||
*
|
||||
* @param {MatterJS.Body} body - The Body that has started being dragged. This is a Matter Body, not a Phaser Game Object.
|
||||
* @param {MatterJS.Body} part - The part of the body that was clicked on.
|
||||
* @param {MatterJS.BodyType} body - The Body that has started being dragged. This is a Matter Body, not a Phaser Game Object.
|
||||
* @param {MatterJS.BodyType} part - The part of the body that was clicked on.
|
||||
* @param {Phaser.Physics.Matter.PointerConstraint} constraint - The Pointer Constraint that is dragging the body.
|
||||
*/
|
||||
module.exports = 'dragstart';
|
||||
|
|
|
@ -22,6 +22,6 @@
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Physics.Matter.Events.SleepEndEvent} event - The Sleep Event object.
|
||||
* @param {MatterJS.Body} body - The body that has stopped sleeping.
|
||||
* @param {MatterJS.BodyType} body - The body that has stopped sleeping.
|
||||
*/
|
||||
module.exports = 'sleepend';
|
||||
|
|
|
@ -22,6 +22,6 @@
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Physics.Matter.Events.SleepStartEvent} event - The Sleep Event object.
|
||||
* @param {MatterJS.Body} body - The body that has gone to sleep.
|
||||
* @param {MatterJS.BodyType} body - The body that has gone to sleep.
|
||||
*/
|
||||
module.exports = 'sleepstart';
|
||||
|
|
|
@ -83,6 +83,7 @@ var Axes = require('../geometry/Axes');
|
|||
mass: 0,
|
||||
inverseMass: 0,
|
||||
inertia: 0,
|
||||
inverseInertia: 0,
|
||||
_original: null,
|
||||
render: {
|
||||
visible: true,
|
||||
|
@ -1234,7 +1235,7 @@ var Axes = require('../geometry/Axes');
|
|||
*/
|
||||
|
||||
/**
|
||||
* A value that defines the fill opqcity to use when rendering the body.
|
||||
* A value that defines the fill opacity to use when rendering the body.
|
||||
*
|
||||
* @property render.fillOpacity
|
||||
* @type number
|
||||
|
@ -1248,7 +1249,7 @@ var Axes = require('../geometry/Axes');
|
|||
*/
|
||||
|
||||
/**
|
||||
* A value that defines the line opqcity to use when rendering the body.
|
||||
* A value that defines the line opacity to use when rendering the body.
|
||||
*
|
||||
* @property render.lineOpacity
|
||||
* @type number
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
* @typedef {(MatterJS.Body|Phaser.GameObjects.GameObject|Phaser.Physics.Matter.Image|Phaser.Physics.Matter.Sprite|Phaser.Physics.Matter.TileBody)} Phaser.Types.Physics.Matter.MatterBody
|
||||
* @typedef {(MatterJS.BodyType|Phaser.GameObjects.GameObject|Phaser.Physics.Matter.Image|Phaser.Physics.Matter.Sprite|Phaser.Physics.Matter.TileBody)} Phaser.Types.Physics.Matter.MatterBody
|
||||
* @since 3.22.0
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* @since 3.22.0
|
||||
*
|
||||
* @property {string} [label='Body'] - An arbitrary string-based name to help identify this body.
|
||||
* @property {MatterJS.Body[]} [parts] - An array of bodies that make up this body. The first body in the array must always be a self reference to the current body instance. All bodies in the `parts` array together form a single rigid compound body.
|
||||
* @property {MatterJS.BodyType[]} [parts] - An array of bodies that make up this body. The first body in the array must always be a self reference to the current body instance. All bodies in the `parts` array together form a single rigid compound body.
|
||||
* @property {any} [plugin] - An object reserved for storing plugin-specific properties.
|
||||
* @property {number} [angle=0] - A number specifying the angle of the body, in radians.
|
||||
* @property {Phaser.Types.Math.Vector2Like[]} [vertices=null] - An array of `Vector` objects that specify the convex hull of the rigid body. These should be provided about the origin `(0, 0)`.
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
* @since 3.22.0
|
||||
*
|
||||
* @property {boolean} collided - Have the pair collided or not?
|
||||
* @property {MatterJS.Body} bodyA - A reference to the first body involved in the collision.
|
||||
* @property {MatterJS.Body} bodyB - A reference to the second body involved in the collision.
|
||||
* @property {MatterJS.Body} axisBody - A reference to the dominant axis body.
|
||||
* @property {MatterJS.BodyType} bodyA - A reference to the first body involved in the collision.
|
||||
* @property {MatterJS.BodyType} bodyB - A reference to the second body involved in the collision.
|
||||
* @property {MatterJS.BodyType} axisBody - A reference to the dominant axis body.
|
||||
* @property {number} axisNumber - The index of the dominant collision axis vector (edge normal)
|
||||
* @property {number} depth - The depth of the collision on the minimum overlap.
|
||||
* @property {MatterJS.Body} parentA - A reference to the parent of Body A, or to Body A itself if it has no parent.
|
||||
* @property {MatterJS.Body} parentB - A reference to the parent of Body B, or to Body B itself if it has no parent.
|
||||
* @property {MatterJS.BodyType} parentA - A reference to the parent of Body A, or to Body A itself if it has no parent.
|
||||
* @property {MatterJS.BodyType} parentB - A reference to the parent of Body B, or to Body B itself if it has no parent.
|
||||
* @property {MatterJS.Vector} normal - The collision normal, facing away from Body A.
|
||||
* @property {MatterJS.Vector} tangent - The tangent of the collision normal.
|
||||
* @property {MatterJS.Vector} penetration - The penetration distances between the two bodies.
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
* @since 3.22.0
|
||||
*
|
||||
* @property {string} id - The unique auto-generated collision pair id. A combination of the body A and B IDs.
|
||||
* @property {MatterJS.Body} bodyA - A reference to the first body involved in the collision.
|
||||
* @property {MatterJS.Body} bodyB - A reference to the second body involved in the collision.
|
||||
* @property {MatterJS.BodyType} bodyA - A reference to the first body involved in the collision.
|
||||
* @property {MatterJS.BodyType} bodyB - A reference to the second body involved in the collision.
|
||||
* @property {MatterJS.Vector[]} activeContacts - An array containing all of the active contacts between bodies A and B.
|
||||
* @property {number} separation - The amount of separation that occured between bodies A and B.
|
||||
* @property {boolean} isActive - Is the collision still active or not?
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
* @since 3.22.0
|
||||
*
|
||||
* @property {string} [label='Constraint'] - An arbitrary string-based name to help identify this constraint.
|
||||
* @property {MatterJS.Body} [bodyA] - The first possible `Body` that this constraint is attached to.
|
||||
* @property {MatterJS.Body} [bodyB] - The second possible `Body` that this constraint is attached to.
|
||||
* @property {MatterJS.BodyType} [bodyA] - The first possible `Body` that this constraint is attached to.
|
||||
* @property {MatterJS.BodyType} [bodyB] - The second possible `Body` that this constraint is attached to.
|
||||
* @property {Phaser.Types.Math.Vector2Like} [pointA] - A `Vector` that specifies the offset of the constraint from center of the `constraint.bodyA` if defined, otherwise a world-space position.
|
||||
* @property {Phaser.Types.Math.Vector2Like} [pointB] - A `Vector` that specifies the offset of the constraint from center of the `constraint.bodyB` if defined, otherwise a world-space position.
|
||||
* @property {number} [stiffness=1] - A `Number` that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts like a soft spring.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* @typedef {object} Phaser.Types.Physics.Matter.MatterTileOptions
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {MatterJS.Body} [body=null] - An existing Matter body to be used instead of creating a new one.
|
||||
* @property {MatterJS.BodyType} [body=null] - An existing Matter body to be used instead of creating a new one.
|
||||
* @property {boolean} [isStatic=true] - Whether or not the newly created body should be made static. This defaults to true since typically tiles should not be moved.
|
||||
* @property {boolean} [addToWorld=true] - Whether or not to add the newly created body (or existing body if options.body is used) to the Matter world.
|
||||
*/
|
||||
|
|
1044
types/matter.d.ts
vendored
1044
types/matter.d.ts
vendored
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue