You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using fill method in RenderTexture does not set CanvasRenderingContext2D.globalCompositeOperation, resulting in reusing value set by last drawn gameObject.
I was thinking if doing ctx.save() right before setting blendMode and globalAlpha would help, however I am not sure if it doesn't break other parts of code.
The text was updated successfully, but these errors were encountered:
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.
Version
Description
Using
fill
method inRenderTexture
does not setCanvasRenderingContext2D.globalCompositeOperation
, resulting in reusing value set by last drawn gameObject.acts as expected, resulting in filling
RenderTexture
with color.Reversing order of
draw
enderase
methods, causesfill
to remove pixels from wholeRenderTexture
.Example Test Code
https://codepen.io/mkchomik/pen/QWQaxbz
Additional Information
Digging in the codebase, I found that value of
globalCompositeOperation
is set inSetTransform
function:https://github.com/photonstorm/phaser/blob/master/src/renderer/canvas/utils/SetTransform.js#L47
I was thinking if doing
ctx.save()
right before settingblendMode
andglobalAlpha
would help, however I am not sure if it doesn't break other parts of code.The text was updated successfully, but these errors were encountered: