Phaser API Documentation

  Version: 
Event: LOSE_WEBGL
Phaser.Renderer.Events.LOSE_WEBGL
LOSE_WEBGL

Description:

The Lose WebGL Event.

This event is dispatched by the WebGLRenderer when the WebGL context is lost.

Context can be lost for a variety of reasons, like leaving the browser tab. The game canvas DOM object will dispatch webglcontextlost. All WebGL resources get wiped, and the context is reset.

While WebGL is lost, the game will continue to run, but all WebGL resources are lost, and new ones cannot be created.

Once the context is restored and the renderer has automatically restored the state, the renderer will emit a RESTORE_WEBGL event. At that point, it is safe to continue.

Parameters:

name type description
renderer Phaser.Renderer.WebGL.WebGLRenderer

the renderer that owns the WebGL context

Since: 3.80.0