mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 07:04:31 +00:00
Merge pull request #5166 from samme/feature/group-setActive-setName
Add Group#setActive(), Group#setName()
This commit is contained in:
commit
d83b14274d
1 changed files with 38 additions and 3 deletions
|
@ -136,8 +136,7 @@ var Group = new Class({
|
|||
this.name = GetFastValue(config, 'name', '');
|
||||
|
||||
/**
|
||||
* Whether this group runs its {@link Phaser.GameObjects.Group#preUpdate} method
|
||||
* (which may update any members).
|
||||
* Whether this group runs its {@link Phaser.GameObjects.Group#preUpdate} method (which may update any members).
|
||||
*
|
||||
* @name Phaser.GameObjects.Group#active
|
||||
* @type {boolean}
|
||||
|
@ -1108,6 +1107,42 @@ var Group = new Class({
|
|||
return (capacity - used);
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the `active` property of this Group.
|
||||
* When active, this Group runs its `preUpdate` method.
|
||||
*
|
||||
* @method Phaser.GameObjects.Group#setActive
|
||||
* @since 3.24.0
|
||||
*
|
||||
* @param {boolean} value - True if this Group should be set as active, false if not.
|
||||
*
|
||||
* @return {this} This Group object.
|
||||
*/
|
||||
setActive: function (value)
|
||||
{
|
||||
this.active = value;
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the `name` property of this Group.
|
||||
* The `name` property is not populated by Phaser and is presented for your own use.
|
||||
*
|
||||
* @method Phaser.GameObjects.Group#setName
|
||||
* @since 3.24.0
|
||||
*
|
||||
* @param {string} value - The name to be given to this Group.
|
||||
*
|
||||
* @return {this} This Group object.
|
||||
*/
|
||||
setName: function (value)
|
||||
{
|
||||
this.name = value;
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the property as defined in `key` of each group member to the given value.
|
||||
*
|
||||
|
@ -1265,7 +1300,7 @@ var Group = new Class({
|
|||
/**
|
||||
* Iterate through the group members changing the position of each element to be that of the element that came before
|
||||
* it in the array (or after it if direction = 1)
|
||||
*
|
||||
*
|
||||
* The first group member position is set to x/y.
|
||||
*
|
||||
* @method Phaser.GameObjects.Group#shiftPosition
|
||||
|
|
Loading…
Reference in a new issue