@@ -6,6 +6,7 @@ import WalkDisplayListObj from './WalkDisplayListObject'
66const { POSITIVE_INFINITY } = Number
77const TextureEvents = Phaser . Textures . Events
88const CacheEvents = Phaser . Cache . Events
9+ const CoreEvents = Phaser . Core . Events
910const KeyboardEvents = Phaser . Input . Keyboard . Events
1011const SceneEvents = Phaser . Scenes . Events
1112const { KeyCodes } = Phaser . Input . Keyboard
@@ -104,6 +105,7 @@ export class DisplayListWatcher extends Phaser.Plugins.ScenePlugin {
104105 }
105106
106107 start ( ) {
108+ const { game } = this
107109 const { cache, events, input, make, renderer } = this . systems
108110 const fontCache = cache . bitmapFont
109111 const keyboard = input ?. keyboard
@@ -119,7 +121,7 @@ export class DisplayListWatcher extends Phaser.Plugins.ScenePlugin {
119121 return
120122 }
121123
122- events . on ( SceneEvents . RENDER , this . render , this )
124+ game . events . on ( CoreEvents . POST_RENDER , this . render , this )
123125
124126 this . camera = new Phaser . Cameras . Scene2D . Camera ( 0 , 0 , width , height )
125127 . setBounds ( 0 , 0 , POSITIVE_INFINITY , POSITIVE_INFINITY )
@@ -142,6 +144,7 @@ export class DisplayListWatcher extends Phaser.Plugins.ScenePlugin {
142144 }
143145
144146 stop ( ) {
147+ const { game } = this
145148 const { cache, events, input, settings } = this . systems
146149 const keyboard = input ?. keyboard
147150
@@ -150,7 +153,8 @@ export class DisplayListWatcher extends Phaser.Plugins.ScenePlugin {
150153 cache . bitmapFont . events . off ( CacheEvents . ADD , this . onFontCacheAdded , this )
151154
152155 events . off ( SceneEvents . UPDATE , this . update , this )
153- events . off ( SceneEvents . RENDER , this . render , this )
156+
157+ game . events . off ( CoreEvents . POST_RENDER , this . render , this )
154158
155159 if ( keyboard ) {
156160 keyboard . off ( KeyboardEvents . ANY_KEY_DOWN , this . onAnyKeyDown , this )
0 commit comments