Answer the question
In order to leave comments, you need to log in
Why doesn't globalCompositeOperation work on canvas?
Here is an example .
It is necessary that the letters be a transparent mask (the background is darkened, but it is visible from the area of the beeches).
ctx.globalCompositeOperation = "destination-out" - should work like this, but apparently I'm doing something wrong.
Answer the question
In order to leave comments, you need to log in
Everything is working. It's just that you first change the globalCompositeOperation, and then draw a picture - naturally, nothing is visible, everything becomes transparent, drawing text after that is pointless. Change the order of actions - first drawing the picture, then changing the globalCompositeOperation. Somehow so .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question