Closed
Description
Version
- Phaser Version: 3.52.0
Description
Create a game with type Phaser.WEBGL
. Run it on a device without WebGL. The game runs in CANVAS mode.
Forces Phaser to use the WebGL Renderer. If the browser does not support it, there is no fallback to Canvas with this setting, so you should trap it and display a suitable message to the user.
But this doesn't happen. In this case WEBGL seems to act just like AUTO.
Example Test Code
In Firefox you can set webGL.disabled
to false
in about:config
and then visit any WEBGL example, e.g., http://phaser.io/examples/v3/view/display/alpha/single-alpha. The game runs in CANVAS mode with no error.
Or you can do
new Phaser.Game({
type: Phaser.WEBGL,
backgroundColor: 0x0074D9,
callbacks: {
preBoot: function (game) {
game.device.features.webGL = false;
}
},
scene: {
create: function () {
this.add.text(0, 0, 'Hello');
}
}
});