M
M
mishapsv2019-01-30 15:30:58
JavaScript
mishapsv, 2019-01-30 15:30:58

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

1 answer(s)
0
0xD34F, 2019-01-30
@mishapsv

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 question

Ask a Question

731 491 924 answers to any question