I'm working on a paint app using canvas, and i want to let the user the option to draw only in a selected area. for that I can use the clip() method. but if I want the user to be able to draw inside letters also - is there any way to use clip() for text? is there another way I can do it?
thanks
You can do this but not using clip. Clip only works with paths and text is not a path.
You will need to use a second in-memory (not on the page) canvas in order to achieve the effect. Here is how:
drawImage(in-memory-canvas, x, y)
to put the newly created effect onto your normal canvasIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With