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

html5 color / masking bug #352

Open
SavedByZero opened this issue Jul 23, 2015 · 1 comment
Open

html5 color / masking bug #352

SavedByZero opened this issue Jul 23, 2015 · 1 comment

Comments

@SavedByZero
Copy link

I have this masking code:

g.save();
g.drawTexture(_texture, 0, 0);
g.setBlendMode(BlendMode.Mask);
g.drawTexture(_mask, 0, 0);

    g.restore();

It works fine for the Flash and android targets, but for html5, the colors of that object appear all black. The odd thing is, this only used to happen for Chrome. But now it's started happening in Firefox also.

@aduros
Copy link
Owner

aduros commented Jul 25, 2015

Do you know if that's with the WebGL or canvas renderer?

There's an issue with Mask that's documented in the BlendMode API doc. In canvas, the blend mode is unbounded, meaning the source alpha will be applied to the entire destination image. On other renderers, only the parts of the destination within the bounds of the source image will be affected. Could that be what's going on here?

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

2 participants