mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 05:33:35 +00:00
Re-arranged methods and added parent.
This commit is contained in:
parent
043efb759c
commit
0aa6650422
1 changed files with 21 additions and 22 deletions
|
@ -9,7 +9,9 @@
|
|||
*
|
||||
* @class
|
||||
*/
|
||||
Phaser.Component.Children = function () {
|
||||
Phaser.Component.Children = function (parent) {
|
||||
|
||||
this.parent = parent;
|
||||
|
||||
// The objects that belong to this collection.
|
||||
// The equivalent of the old `Sprite.children` array.
|
||||
|
@ -193,8 +195,6 @@ Phaser.Component.Children.prototype = {
|
|||
|
||||
},
|
||||
|
||||
|
||||
|
||||
swap: function (child1, child2) {
|
||||
|
||||
if (child1 === child2)
|
||||
|
@ -215,7 +215,6 @@ Phaser.Component.Children.prototype = {
|
|||
|
||||
},
|
||||
|
||||
|
||||
// was setIndex
|
||||
moveTo: function (child, index) {
|
||||
|
||||
|
@ -295,6 +294,24 @@ Phaser.Component.Children.prototype = {
|
|||
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes all the items.
|
||||
*
|
||||
* @method Phaser.ArraySet#removeAll
|
||||
*/
|
||||
removeAll: function () {
|
||||
|
||||
var i = this.list.length;
|
||||
|
||||
while (i--)
|
||||
{
|
||||
this.remove(this.list[i]);
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
},
|
||||
|
||||
// Check to see if the given child is a child of this object, at any depth (recursively scans up the tree)
|
||||
contains: function (child) {
|
||||
|
||||
|
@ -499,24 +516,6 @@ Phaser.Component.Children.prototype = {
|
|||
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes all the items.
|
||||
*
|
||||
* @method Phaser.ArraySet#reset
|
||||
*/
|
||||
reset: function () {
|
||||
|
||||
var i = this.list.length;
|
||||
|
||||
while (i--)
|
||||
{
|
||||
this.remove(this.list[i]);
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the property `key` to the given value on all members of this list.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue