@@ -18,6 +18,10 @@ const GetObjectDescription = (obj, precision = 1) => {
1818 count = obj . children . list . length ;
1919 } else if ( type === "ParticleEmitter" ) {
2020 count = obj . getParticleCount ( ) ;
21+ } else if ( type === "SpriteGPULayer" ) {
22+ count = obj . memberCount ;
23+ } else if ( type === "TilemapLayer" || type === "TilemapGPULayer" ) {
24+ count = obj . tilesTotal ;
2125 } else if ( obj . list ) {
2226 count = obj . list . length ;
2327 }
@@ -66,6 +70,7 @@ const WalkDisplayListObj = (obj, output = [], currentDepth = 0, maxDepth = 10, m
6670const { POSITIVE_INFINITY } = Number ;
6771const TextureEvents = Phaser . Textures . Events ;
6872const CacheEvents = Phaser . Cache . Events ;
73+ const CoreEvents = Phaser . Core . Events ;
6974const KeyboardEvents = Phaser . Input . Keyboard . Events ;
7075const SceneEvents = Phaser . Scenes . Events ;
7176const { KeyCodes } = Phaser . Input . Keyboard ;
@@ -124,6 +129,7 @@ class DisplayListWatcher extends Phaser.Plugins.ScenePlugin {
124129 this . start ( ) ;
125130 }
126131 start ( ) {
132+ const { game } = this ;
127133 const { cache, events, input, make, renderer } = this . systems ;
128134 const fontCache = cache . bitmapFont ;
129135 const keyboard = input == null ? void 0 : input . keyboard ;
@@ -132,7 +138,7 @@ class DisplayListWatcher extends Phaser.Plugins.ScenePlugin {
132138 fontCache . events . on ( CacheEvents . ADD , this . onFontCacheAdded , this ) ;
133139 return ;
134140 }
135- events . on ( SceneEvents . RENDER , this . render , this ) ;
141+ game . events . on ( CoreEvents . POST_RENDER , this . render , this ) ;
136142 this . camera = new Phaser . Cameras . Scene2D . Camera ( 0 , 0 , width , height ) . setBounds ( 0 , 0 , POSITIVE_INFINITY , POSITIVE_INFINITY ) . setRoundPixels ( true ) ;
137143 if ( keyboard ) {
138144 events . on ( SceneEvents . UPDATE , this . update , this ) ;
@@ -142,11 +148,12 @@ class DisplayListWatcher extends Phaser.Plugins.ScenePlugin {
142148 this . renderText = renderer . type === Phaser . WEBGL ? this . text . renderWebGL : this . text . renderCanvas ;
143149 }
144150 stop ( ) {
151+ const { game } = this ;
145152 const { cache, events, input, settings } = this . systems ;
146153 const keyboard = input == null ? void 0 : input . keyboard ;
147154 cache . bitmapFont . events . off ( CacheEvents . ADD , this . onFontCacheAdded , this ) ;
148155 events . off ( SceneEvents . UPDATE , this . update , this ) ;
149- events . off ( SceneEvents . RENDER , this . render , this ) ;
156+ game . events . off ( CoreEvents . POST_RENDER , this . render , this ) ;
150157 if ( keyboard ) {
151158 keyboard . off ( KeyboardEvents . ANY_KEY_DOWN , this . onAnyKeyDown , this ) ;
152159 }
0 commit comments