Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having render: {} in phaser's config adds black background to Phaser. #6097

Closed
michalfialadev opened this issue May 4, 2022 · 3 comments
Closed

Comments

@michalfialadev
Copy link

michalfialadev commented May 4, 2022

Version

  • Phaser Version: 3.55.2, 3.24.1 (tested both)
  • Operating system: win10
  • Browser:
    chrome

Description

Phaser clears/fill background with solid black (affects both CANVAS and WEBGL rendering modes), when render: {} (empty or filled) render object is present in it's config.

EDIT: samme was kind to explain, that transparent can be set in Phaser's config in 2 places, and the 'latter default' (false in render{}) in this case overrode the earlier 'true' (in config root). At this point i'd suggest that a check be made in phaser source (eg 'if proprerty is set somewhere in config object, do not override it by 'unset default value' elsewhere - i think for this resolution values of 'undefined' vs false|true could be used [in case of booleans]).

Example Test Code

Following code displays black background in phaser canvas:
myPhaserConfig = { type: Phaser.AUTO, transparent: true, render: {}}

Following code displays transparent background (expected):
myPhaserConfig = { type: Phaser.AUTO, transparent: true, }

As you can see, the only difference is, that we have removed the empty 'render' object.

Additional Information

Can be quickly reproduced by going to
https://labs.phaser.io/edit.html?src=src/game%20config/transparent.js&v=3.55.2
and adding a quick render: {} into phaser's config.

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

@sentoxaio
Copy link

The issue is still present in version 3.55.2.

@photonstorm
Copy link
Collaborator

The issue is still present in version 3.55.2.

Which was released before this issue was fixed and closed. It's part of 3.60.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants