mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 21:53:59 +00:00
Added getDisplayList method
This commit is contained in:
parent
7bd23db219
commit
4c2f2ed899
1 changed files with 32 additions and 0 deletions
|
@ -820,6 +820,38 @@ var GameObject = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a reference to the underlying display list _array_ that contains this Game Object,
|
||||
* which will be either the Scene's Display List or the internal list belonging
|
||||
* to its parent Container, if it has one.
|
||||
*
|
||||
* If this Game Object is not on a display list or in a container, it will return `null`.
|
||||
*
|
||||
* You should be very careful with this method, and understand that it returns a direct reference to the
|
||||
* internal array used by the Display List. Mutating this array directly can cause all kinds of subtle
|
||||
* and difficult to debug issues in your game.
|
||||
*
|
||||
* @method Phaser.GameObjects.GameObject#getDisplayList
|
||||
* @since 3.85.0
|
||||
*
|
||||
* @return {?Phaser.GameObjects.GameObject[]} The internal Display List array of Game Objects, or `null`.
|
||||
*/
|
||||
getDisplayList: function ()
|
||||
{
|
||||
var list = null;
|
||||
|
||||
if (this.parentContainer)
|
||||
{
|
||||
list = this.parentContainer.list;
|
||||
}
|
||||
else if (this.displayList)
|
||||
{
|
||||
list = this.displayList.list;
|
||||
}
|
||||
|
||||
return list;
|
||||
},
|
||||
|
||||
/**
|
||||
* Destroys this Game Object removing it from the Display List and Update List and
|
||||
* severing all ties to parent resources.
|
||||
|
|
Loading…
Reference in a new issue