Skip to content

Game config: Transparent is ignored when bacgroundColor set #5362

@Hoshinokoe

Description

@Hoshinokoe

Version

  • Phaser Version: 3.23
  • Operating system: Windows 10
  • Browser: All Browsers

Description

If game config contains "transparent = true" and "backgroundColor = color", transparent is ignored and color applied to game canvas.

From official documentation:
" Phaser.Core.Config#backgroundColor - The background color of the game canvas. The default is black. This value is ignored if transparent is set to true."

Example Test Code

        var config = {
        type: Phaser.AUTO,
        backgroundColor: '#65f865',
      
        transparent: true,
        scale: {
            // we do scale the game manually in resize()
            mode: Phaser.Scale.NONE,
            width: 600,
            height: 800,
            //autoCenter: Phaser.Scale.CENTER_BOTH,
        },
        physics: {
            default: 'arcade',
            arcade: {
                debug: true,
                gravity: { y: 600 }
            }
        }
    };

Additional Information

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions