File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -836,6 +836,39 @@ Phaser.Utils.Debug.prototype = {
836836
837837 } ,
838838
839+ /**
840+ * Call this function from the Dev Tools console.
841+ *
842+ * It will scan the display list and output all of the Objects it finds, and their renderOrderIDs.
843+ *
844+ * **Note** Requires a browser that supports console.group and console.groupEnd (such as Chrome)
845+ *
846+ * @method displayList
847+ * @param {Object } [displayObject] - The displayObject level display object to start from. Defaults to the World.
848+ */
849+ displayList : function ( displayObject ) {
850+
851+ if ( displayObject === undefined ) { displayObject = this . game . world ; }
852+
853+ if ( displayObject . hasOwnProperty ( 'renderOrderID' ) )
854+ {
855+ console . log ( '[' + displayObject . renderOrderID + ']' , displayObject ) ;
856+ }
857+ else
858+ {
859+ console . log ( '[]' , displayObject ) ;
860+ }
861+
862+ if ( displayObject . children && displayObject . children . length > 0 )
863+ {
864+ for ( var i = 0 ; i < displayObject . children . length ; i ++ )
865+ {
866+ this . game . debug . displayList ( displayObject . children [ i ] ) ;
867+ }
868+ }
869+
870+ } ,
871+
839872 /**
840873 * Destroy this object.
841874 *
You can’t perform that action at this time.
0 commit comments