Skip to content

Commit bba8285

Browse files
committed
Return type fix
1 parent 0ba7de7 commit bba8285

1 file changed

Lines changed: 48 additions & 48 deletions

File tree

src/physics/matter-js/Factory.js

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ var Vertices = require('./lib/geometry/Vertices');
2222
* @classdesc
2323
* The Matter Factory is responsible for quickly creating a variety of different types of
2424
* bodies, constraints and Game Objects and adding them into the physics world.
25-
*
25+
*
2626
* You access the factory from within a Scene using `add`:
27-
*
27+
*
2828
* ```javascript
2929
* this.matter.add.rectangle(x, y, width, height);
3030
* ```
31-
*
31+
*
3232
* Use of the Factory is optional. All of the objects it creates can also be created
3333
* directly via your own code or constructors. It is provided as a means to keep your
3434
* code concise.
@@ -200,24 +200,24 @@ var Factory = new Class({
200200

201201
/**
202202
* Creates a body using data exported from the application PhysicsEditor (https://www.codeandweb.com/physicseditor)
203-
*
203+
*
204204
* The PhysicsEditor file should be loaded as JSON:
205-
*
205+
*
206206
* ```javascript
207207
* preload ()
208208
* {
209209
* this.load.json('vehicles', 'assets/vehicles.json);
210210
* }
211-
*
211+
*
212212
* create ()
213213
* {
214214
* const vehicleShapes = this.cache.json.get('vehicles');
215215
* this.matter.add.fromPhysicsEditor(400, 300, vehicleShapes.truck);
216216
* }
217217
* ```
218-
*
218+
*
219219
* Do not pass the entire JSON file to this method, but instead pass one of the shapes contained within it.
220-
*
220+
*
221221
* If you pas in an `options` object, any settings in there will override those in the PhysicsEditor config object.
222222
*
223223
* @method Phaser.Physics.Matter.Factory#fromPhysicsEditor
@@ -247,18 +247,18 @@ var Factory = new Class({
247247

248248
/**
249249
* Creates a body using the path data from an SVG file.
250-
*
250+
*
251251
* SVG Parsing requires the pathseg polyfill from https://github.com/progers/pathseg
252-
*
252+
*
253253
* The SVG file should be loaded as XML, as this method requires the ability to extract
254254
* the path data from it. I.e.:
255-
*
255+
*
256256
* ```javascript
257257
* preload ()
258258
* {
259259
* this.load.xml('face', 'assets/face.svg);
260260
* }
261-
*
261+
*
262262
* create ()
263263
* {
264264
* this.matter.add.fromSVG(400, 300, this.cache.xml.get('face'));
@@ -310,29 +310,29 @@ var Factory = new Class({
310310

311311
/**
312312
* Creates a body using the supplied physics data, as provided by a JSON file.
313-
*
313+
*
314314
* The data file should be loaded as JSON:
315-
*
315+
*
316316
* ```javascript
317317
* preload ()
318318
* {
319319
* this.load.json('ninjas', 'assets/ninjas.json);
320320
* }
321-
*
321+
*
322322
* create ()
323323
* {
324324
* const ninjaShapes = this.cache.json.get('ninjas');
325-
*
325+
*
326326
* this.matter.add.fromJSON(400, 300, ninjaShapes.shinobi);
327327
* }
328328
* ```
329-
*
329+
*
330330
* Do not pass the entire JSON file to this method, but instead pass one of the shapes contained within it.
331-
*
331+
*
332332
* If you pas in an `options` object, any settings in there will override those in the config object.
333-
*
333+
*
334334
* The structure of the JSON file is as follows:
335-
*
335+
*
336336
* ```text
337337
* {
338338
* 'generator_info': // The name of the application that created the JSON data
@@ -343,7 +343,7 @@ var Factory = new Class({
343343
* }
344344
* }
345345
* ```
346-
*
346+
*
347347
* At the time of writing, only the Phaser Physics Tracer App exports in this format.
348348
*
349349
* @method Phaser.Physics.Matter.Factory#fromJSON
@@ -418,7 +418,7 @@ var Factory = new Class({
418418

419419
/**
420420
* Create a new composite containing bodies created in the callback in a grid arrangement.
421-
*
421+
*
422422
* This function uses the body bounds to prevent overlaps.
423423
*
424424
* @method Phaser.Physics.Matter.Factory#stack
@@ -584,18 +584,18 @@ var Factory = new Class({
584584

585585
/**
586586
* This method is an alias for `Factory.constraint`.
587-
*
587+
*
588588
* Constraints (or joints) are used for specifying that a fixed distance must be maintained
589589
* between two bodies, or a body and a fixed world-space position.
590-
*
590+
*
591591
* The stiffness of constraints can be modified to create springs or elastic.
592-
*
592+
*
593593
* To simulate a revolute constraint (or pin joint) set `length: 0` and a high `stiffness`
594594
* value (e.g. `0.7` or above).
595-
*
595+
*
596596
* If the constraint is unstable, try lowering the `stiffness` value and / or increasing
597597
* `constraintIterations` within the Matter Config.
598-
*
598+
*
599599
* For compound bodies, constraints must be applied to the parent body and not one of its parts.
600600
*
601601
* @method Phaser.Physics.Matter.Factory#joint
@@ -616,18 +616,18 @@ var Factory = new Class({
616616

617617
/**
618618
* This method is an alias for `Factory.constraint`.
619-
*
619+
*
620620
* Constraints (or joints) are used for specifying that a fixed distance must be maintained
621621
* between two bodies, or a body and a fixed world-space position.
622-
*
622+
*
623623
* The stiffness of constraints can be modified to create springs or elastic.
624-
*
624+
*
625625
* To simulate a revolute constraint (or pin joint) set `length: 0` and a high `stiffness`
626626
* value (e.g. `0.7` or above).
627-
*
627+
*
628628
* If the constraint is unstable, try lowering the `stiffness` value and / or increasing
629629
* `constraintIterations` within the Matter Config.
630-
*
630+
*
631631
* For compound bodies, constraints must be applied to the parent body and not one of its parts.
632632
*
633633
* @method Phaser.Physics.Matter.Factory#spring
@@ -649,15 +649,15 @@ var Factory = new Class({
649649
/**
650650
* Constraints (or joints) are used for specifying that a fixed distance must be maintained
651651
* between two bodies, or a body and a fixed world-space position.
652-
*
652+
*
653653
* The stiffness of constraints can be modified to create springs or elastic.
654-
*
654+
*
655655
* To simulate a revolute constraint (or pin joint) set `length: 0` and a high `stiffness`
656656
* value (e.g. `0.7` or above).
657-
*
657+
*
658658
* If the constraint is unstable, try lowering the `stiffness` value and / or increasing
659659
* `constraintIterations` within the Matter Config.
660-
*
660+
*
661661
* For compound bodies, constraints must be applied to the parent body and not one of its parts.
662662
*
663663
* @method Phaser.Physics.Matter.Factory#constraint
@@ -696,18 +696,18 @@ var Factory = new Class({
696696
/**
697697
* Constraints (or joints) are used for specifying that a fixed distance must be maintained
698698
* between two bodies, or a body and a fixed world-space position.
699-
*
699+
*
700700
* A world constraint has only one body, you should specify a `pointA` position in
701701
* the constraint options parameter to attach the constraint to the world.
702-
*
702+
*
703703
* The stiffness of constraints can be modified to create springs or elastic.
704-
*
704+
*
705705
* To simulate a revolute constraint (or pin joint) set `length: 0` and a high `stiffness`
706706
* value (e.g. `0.7` or above).
707-
*
707+
*
708708
* If the constraint is unstable, try lowering the `stiffness` value and / or increasing
709709
* `constraintIterations` within the Matter Config.
710-
*
710+
*
711711
* For compound bodies, constraints must be applied to the parent body and not one of its parts.
712712
*
713713
* @method Phaser.Physics.Matter.Factory#worldConstraint
@@ -743,13 +743,13 @@ var Factory = new Class({
743743

744744
/**
745745
* This method is an alias for `Factory.pointerConstraint`.
746-
*
746+
*
747747
* A Pointer Constraint is a special type of constraint that allows you to click
748748
* and drag bodies in a Matter World. It monitors the active Pointers in a Scene,
749749
* and when one is pressed down it checks to see if that hit any part of any active
750750
* body in the world. If it did, and the body has input enabled, it will begin to
751751
* drag it until either released, or you stop it via the `stopDrag` method.
752-
*
752+
*
753753
* You can adjust the stiffness, length and other properties of the constraint via
754754
* the `options` object on creation.
755755
*
@@ -771,7 +771,7 @@ var Factory = new Class({
771771
* and when one is pressed down it checks to see if that hit any part of any active
772772
* body in the world. If it did, and the body has input enabled, it will begin to
773773
* drag it until either released, or you stop it via the `stopDrag` method.
774-
*
774+
*
775775
* You can adjust the stiffness, length and other properties of the constraint via
776776
* the `options` object on creation.
777777
*
@@ -800,7 +800,7 @@ var Factory = new Class({
800800

801801
/**
802802
* Creates a Matter Physics Image Game Object.
803-
*
803+
*
804804
* An Image is a light-weight Game Object useful for the display of static images in your game,
805805
* such as logos, backgrounds, scenery or other non-animated elements. Images can have input
806806
* events and physics bodies, or be tweened, tinted or scrolled. The main difference between an
@@ -885,10 +885,10 @@ var Factory = new Class({
885885

886886
/**
887887
* Takes an existing Game Object and injects all of the Matter Components into it.
888-
*
888+
*
889889
* This enables you to use component methods such as `setVelocity` or `isSensor` directly from
890890
* this Game Object.
891-
*
891+
*
892892
* You can also pass in either a Matter Body Configuration object, or a Matter Body instance
893893
* to link with this Game Object.
894894
*
@@ -899,7 +899,7 @@ var Factory = new Class({
899899
* @param {(Phaser.Types.Physics.Matter.MatterBodyConfig|MatterJS.Body)} [options] - A Matter Body configuration object, or an instance of a Matter Body.
900900
* @param {boolean} [addToWorld=true] - Add this Matter Body to the World?
901901
*
902-
* @return {Phaser.GameObjects.GameObject} The Game Object that had the Matter Components injected into it.
902+
* @return {Phaser.Physics.Matter.MatterGameObject} The Game Object that had the Matter Components injected into it.
903903
*/
904904
gameObject: function (gameObject, options, addToWorld)
905905
{

0 commit comments

Comments
 (0)