You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Do not pass the entire JSON file to this method, but instead pass one of the shapes contained within it.
331
+
*
332
+
* If you pas in an `options` object, any settings in there will override those in the config object.
333
+
*
334
+
* The structure of the JSON file is as follows:
335
+
*
336
+
* ```text
337
+
* {
338
+
* 'generator_info': // The name of the application that created the JSON data
339
+
* 'shapeName': {
340
+
* 'type': // The type of body
341
+
* 'label': // Optional body label
342
+
* 'vertices': // An array, or an array of arrays, containing the vertex data in x/y object pairs
343
+
* }
344
+
* }
345
+
* ```
346
+
*
347
+
* At the time of writing, only the Phaser Physics Tracer App exports in this format.
315
348
*
316
349
* @method Phaser.Physics.Matter.Factory#fromJSON
317
350
* @since 3.22.0
318
351
*
319
352
* @param {number} x - The X coordinate of the body.
320
353
* @param {number} y - The Y coordinate of the body.
321
-
* @param {object} data - The body data object as parsed from the JSON body format.
354
+
* @param {any} config - The JSON physics data.
322
355
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.
323
356
* @param {boolean} [addToWorld=true] - Should the newly created body be immediately added to the World?
* @param {number} x - The horizontal world location of the body.
60
+
* @param {number} y - The vertical world location of the body.
61
+
* @param {object} config - The body configuration data.
62
+
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.
0 commit comments