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

Deprecates transparent Option #7067

Merged
merged 1 commit into from Dec 15, 2020
Merged

Deprecates transparent Option #7067

merged 1 commit into from Dec 15, 2020

Conversation

bigtimebuddy
Copy link
Member

@bigtimebuddy bigtimebuddy commented Dec 14, 2020

Fixes #7066

This clears up the ambiguity of the recent transparent changes by creating two distinct options for Application and Renderer. It's easier to backward support transparent by not overloading it with new meaning.

  • contextAlpha the readonly property for creating the canvas.getContext
  • backgroundAlpha the amount of background alpha from 0 to 1

The option transparent is marked as deprecated but still supports backward compatibility by setting contextAlpha and backgroundAlpha.

Broken
https://pixijs.io/examples/#/demos-basic/transparent-background.js

Fixed
https://pixijs.io/examples/?v=dev-context-alpha#/demos-basic/transparent-background.js

@bigtimebuddy bigtimebuddy added this to the v6.0.0 milestone Dec 14, 2020
Copy link
Member

@ShukantPal ShukantPal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find adding a context prefix to "alpha" distasteful, especially since other context fields aren't. But I'll be a stoic. 👍

@bigtimebuddy
Copy link
Member Author

@SukantPal backgroundAlpha does not work with canvas. Did you test that?

Also, I hear you on the context prefix. On the plus tho, it's unlikely a prop that devs will use much since it has some subtle pref side effects in some environments.

@bigtimebuddy bigtimebuddy added ✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t and removed ✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t labels Dec 15, 2020
@bigtimebuddy bigtimebuddy merged commit e8713c8 into dev Dec 15, 2020
@bigtimebuddy bigtimebuddy deleted the dev-context-alpha branch December 15, 2020 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transparent Not Working As Expected
3 participants