Const
The Destroy Camera Event.
This event is dispatched by a Camera instance when it is destroyed by the Camera Manager.
Listen for it via either of the following:
this.cameras.main.on('cameradestroy', () => {}); Copy
this.cameras.main.on('cameradestroy', () => {});
or use the constant, to avoid having to remember the correct event string:
this.cameras.main.on(Phaser.Cameras.Scene2D.Events.DESTROY, () => {}); Copy
this.cameras.main.on(Phaser.Cameras.Scene2D.Events.DESTROY, () => {});
The Destroy Camera Event.
This event is dispatched by a Camera instance when it is destroyed by the Camera Manager.
Listen for it via either of the following:
or use the constant, to avoid having to remember the correct event string: