Skip to content

WEBGL still falls back to CANVAS #5583

Closed
@samme

Description

@samme

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.

The docs say:

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.

webgl disabled

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');
        }
    }
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions