admin管理员组文章数量:1332865
I hope not pose an already answered question, but I could not find something helpful anywhere. I am evaluating javascript libraries for 2d vector graphics and animation. On my way i found paper.js but no way to use it with type="text/javascript", without canvas and so on. In the paper.js FAQ about this point here i could find out that it might work, but for now i could not get it to work.
If anybody has any experience with this, it would be nice to let me know about this.
I hope not pose an already answered question, but I could not find something helpful anywhere. I am evaluating javascript libraries for 2d vector graphics and animation. On my way i found paper.js but no way to use it with type="text/javascript", without canvas and so on. In the paper.js FAQ about this point here i could find out that it might work, but for now i could not get it to work.
If anybody has any experience with this, it would be nice to let me know about this.
Share Improve this question edited Nov 2, 2011 at 1:02 Dave Lee 5086 silver badges17 bronze badges asked Jul 18, 2011 at 11:43 philippphilipp 16.5k15 gold badges65 silver badges118 bronze badges 1- after some time of looking around i found annoying solution. Adding a new Script-Tag to head, just before the document is loaded. This script-tag needs to have a type of text/paperscript. Then it runs, but no debugging with firebug and so on. This is an mess! So if anybody got an idea, this would be great!! – philipp Commented Jul 18, 2011 at 13:03
2 Answers
Reset to default 5Since version 0.2, using paper.js from pure JavaScript is easy and well documented. One way to initialize is:
var scope = new paper.PaperScope();
scope.setup(myCanvas);
Full documentation here: http://paperjs/tutorials/getting-started/using-javascript-directly/
I'm not sure what you mean by "without canvas" though, paper.js does need a canvas object to operate.
You can as of 0.11.4 (and perhaps before) create a canvas-less project in the same way as the accepted answer. More here.
paper.setup(); // creates a new project
paper.setup([width, height]); // this also works for some width, height
// whatever vector calculations you now want to do.
本文标签: javascriptusing paperjs without canvas and paperscriptStack Overflow
版权声明:本文标题:javascript - using paper.js without canvas and paperscript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742289019a2447456.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论