3

I'm using fabric.js and so far I'm pretty impressed with what it can do. However, even though it comes with some nice brushes, I really need some customized ones for my project.

After searching extensively for days, all I could find was this page: http://perfectionkills.com/exploring-canvas-drawing-techniques. It's a wonderful resource (especially the fur brush) that would definitely solve my problem... if only I could make it work in fabric.js.

But, as much as I've tried, I can't get it right - every time I try to edit the PencilBrush class in fabric.js' source I end up "breaking" it. The farther I could get was to make the image of the brush appear as I hold down the mouse (by messing with the _render function), but it doesn't affect the painting in any way and disappears as soon as I let it go. I also tried to edit the pattern brush, but I couldn't figure out how to replace fabric.js' shapes for images.

Can someone please (PLEASE!) tell me what to do, or at least point me in the right way? I'm completely lost here, and I think this would help many other people as well!

Thank you very much!

Joana F.
  • 31
  • 1
  • 2
  • Create a Fiddle of the issues and link it here. Which particular example on that page you are trying to recreate? – Alvin K. Aug 19 '14 at 15:58
  • @AlvinK. Hello! Thank you very much for commenting!! I'm really, really sorry for taking so long to reply (I had some health problems in the family). I've tried to create a fiddle, but it's very complicated since I haven't even gotten close to the result I need, and also I'd have to add the entire fabric.js source. The one I tried to replicate the most was [link](http://perfectionkills.com/exploring-canvas-drawing-techniques/#brush-fur-pen), but I just can't figure out how to use the last-point-technique in fabric.js. I wish someone would at least tell me where I should try to edit the source. – Joana F. Aug 22 '14 at 00:23
  • 1
    I had similar requirement for my project and here is a solution that I found : http://stackoverflow.com/questions/38898999/how-to-create-custom-brush-paint-with-fabric-js/38910952#38910952 – pariwesh Aug 12 '16 at 06:05

0 Answers0