paperjs / paperjs.org

The source of the Paper.js website http://paperjs.org, translated to the static pages in https://github.com/paperjs/paperjs.github.io by running it through https://github.com/paperjs/woods in a Travis CI worker on each commit.
48 stars 34 forks source link

how to create pattern for strokeStyle in Paper.js #8

Closed zousandian closed 8 years ago

zousandian commented 9 years ago

I can create pattern for the stroke like this in Javascript:

var img = new Image();
img.src = "xx.png";

img.onload = function(){

  var pattern = ctx.createPattern(img, "repeat");
  ctx.strokeStyle=pattern;

  ctx.lineWidth = 30;

  ctx.beginPath();
  ctx.moveTo(100,0)
  ctx.lineTo(100,300);

  ctx.stroke();
}

How can i create pattern for Path items created with Paper.js?

lehni commented 8 years ago

There is no support for patterns in paper.js yet, and this is the wrong place for such requests.

There is an issue for it here: https://github.com/paperjs/paper.js/issues/829 And requests for support go here: http://groups.google.com/group/paperjs