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

Applying config background color immediately #6993

Merged
merged 2 commits into from
Jan 2, 2025

Conversation

pavle-goloskokovic
Copy link
Contributor

This PR makes an improvement/fixes a bug:

Currently background color is rendered on first render call and not immediately upon renderer creation.

This causes a brief but noticeable "flash" of black canvas which lasts from game creation to first render call.

This PR introduces logic to apply background color on renderer initialization, both for Canvas and WebGL.

It also fixes a bug for Canvas renderer where transparent setting was not being copied from game to renderer config, but was being used.

@photonstorm
Copy link
Collaborator

You're the first person to notice this in 10 years 😅 I don't mind merging this, but I'd question what's going on in the game code to make it take > 60ms between the addition of the canvas to the dom, to the first render step.

@photonstorm photonstorm merged commit d4be345 into phaserjs:master Jan 2, 2025
@pavle-goloskokovic
Copy link
Contributor Author

Took me 10 years to notice 😅

I have a boot scene which applies some global settings and starts preload scene from its create method. I guess it takes 3-4 ticks to get from canvas creation to preload scene rendering, taking ~50-65ms of black canvas, which I noticed while working on preloading animation :)

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

Successfully merging this pull request may close these issues.

2 participants