Merge pull request #4070 from samme/feature/arcade-group-config-enable

Add PhysicsGroupConfig.enable, Arcade.Body#setEnable()
This commit is contained in:
Richard Davey 2018-10-12 18:29:58 +01:00 committed by GitHub
commit a9938baec6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View file

@ -1955,6 +1955,25 @@ var Body = new Class({
return this;
},
/**
* Sets the Body's `enable` property.
*
* @method Phaser.Physics.Arcade.Body#setEnable
* @since 3.14.0
*
* @param {boolean} [value=true] - The value to assign to `enable`.
*
* @return {Phaser.Physics.Arcade.Body} This Body object.
*/
setEnable: function (value)
{
if (value === undefined) { value = true; }
this.enable = value;
return this;
},
/**
* The Body's horizontal position (left edge).
*

View file

@ -25,6 +25,7 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
* @property {number} [bounceY=0] - Sets {@link Phaser.Physics.Arcade.Body#bounce bounce.y}.
* @property {number} [dragX=0] - Sets {@link Phaser.Physics.Arcade.Body#drag drag.x}.
* @property {number} [dragY=0] - Sets {@link Phaser.Physics.Arcade.Body#drag drag.y}.
* @property {boolean} [enable=true] - Sets {@link Phaser.Physics.Arcade.Body#enable enable}.
* @property {number} [gravityX=0] - Sets {@link Phaser.Physics.Arcade.Body#gravity gravity.x}.
* @property {number} [gravityY=0] - Sets {@link Phaser.Physics.Arcade.Body#gravity gravity.y}.
* @property {number} [frictionX=0] - Sets {@link Phaser.Physics.Arcade.Body#friction friction.x}.
@ -51,6 +52,7 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
* @property {number} setBounceY - As {@link Phaser.Physics.Arcade.Body#setBounceY}.
* @property {number} setDragX - As {@link Phaser.Physics.Arcade.Body#setDragX}.
* @property {number} setDragY - As {@link Phaser.Physics.Arcade.Body#setDragY}.
* @property {boolean} setEnable - As {@link Phaser.Physics.Arcade.Body#setEnable}.
* @property {number} setGravityX - As {@link Phaser.Physics.Arcade.Body#setGravityX}.
* @property {number} setGravityY - As {@link Phaser.Physics.Arcade.Body#setGravityY}.
* @property {number} setFrictionX - As {@link Phaser.Physics.Arcade.Body#setFrictionX}.
@ -167,6 +169,7 @@ var PhysicsGroup = new Class({
setBounceY: GetFastValue(config, 'bounceY', 0),
setDragX: GetFastValue(config, 'dragX', 0),
setDragY: GetFastValue(config, 'dragY', 0),
setEnable: GetFastValue(config, 'enable', true),
setGravityX: GetFastValue(config, 'gravityX', 0),
setGravityY: GetFastValue(config, 'gravityY', 0),
setFrictionX: GetFastValue(config, 'frictionX', 0),