paperjs

paperjs select items and delete on mouse click

江枫思渺然 提交于 2019-12-24 18:41:06
问题 I want to create select an item and delete it when its needed. For example:- I have a line and a rectangle on a canvas, If the user wants to delete it how can I do it? I can track the click event but what happens if there is a overlap with other items. HTML jquery/paperjs $(document).ready(function(){ paper.install(window) paper.setup('myCanvas') var tool = new Tool(); tool.minDistance = 10 project.currentStyle = { strokeColor: 'red', fillColor: '#ff0000', strokeWidth: 3 }; var from = new

How to install and import paperjs for Angular 2?

[亡魂溺海] 提交于 2019-12-22 11:09:14
问题 I tried installing paperjs by using the command sudo npm install paper in my angular app folder. Paper seems to appear in node_modules folder, however when I try to import it using import { Paper } from '@paper' it doesn't find paper module. How do I include the paper module in angular2? 回答1: I did the following to get it working: npm install paper --save npm install @types/paper --save In systemjs.comfig.js add a map for paper map: ... 'paper': 'npm:paper/dist/paper-core.js' }, In the

How to install and import paperjs for Angular 2?

China☆狼群 提交于 2019-12-22 11:07:05
问题 I tried installing paperjs by using the command sudo npm install paper in my angular app folder. Paper seems to appear in node_modules folder, however when I try to import it using import { Paper } from '@paper' it doesn't find paper module. How do I include the paper module in angular2? 回答1: I did the following to get it working: npm install paper --save npm install @types/paper --save In systemjs.comfig.js add a map for paper map: ... 'paper': 'npm:paper/dist/paper-core.js' }, In the

Draw text along the bezier curve in paper.js

若如初见. 提交于 2019-12-20 14:37:13
问题 Is it possible to easily draw text along the bezier curve using paper.js? I know it is possible to attach text to a line path and then rotate it, but I am interested specifically in drawing text along the curve. Something like http://www.w3.org/TR/SVG11/images/text/toap02.svg I understand this may be achieved by printing text a letter by letter with corresponding rotation applied to every item, but I am interested in easier way to achieve this in paper.js 回答1: We haven't implement text along

Paper.js won't resize the canvas correctly

心不动则不痛 提交于 2019-12-20 09:48:18
问题 I'm trying out Paper.js for fun, but it seems I'm already stuck at the very start. Adding resize="true" to the canvas tag is supposed to make the element as high and wide as the browser window. However, doing that results in some rather strange behavior. I expected the canvas to adjust itself to the viewport right after loading the page, but it didn't do so, which is why I initially thought it didn't resize at all. What actually happens, though, is even more bizarre: The canvas starts out at

Paper.js external file will not load

纵饮孤独 提交于 2019-12-20 01:08:14
问题 I am just trying to get into paper.js. Code works fine when they're inlined. But when I move them to an external file and src it there, errors starts to pop up :( Can anyone figure out what I did wrong? Error screenshot is attached Much thanks! Error screenshot <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Paper.js Test</title> <script type="text/javascript" src="bower_components/paper/dist/paper-full.min.js"></script> <script type="text/paperscript" src="test.js" canvas=

Paper.js Interoperability

﹥>﹥吖頭↗ 提交于 2019-12-17 20:46:35
问题 I would like to call paper.js functions from HTML buttons in my page but I believe the paper.js functions exist in their own scope. The paper.js docs mention interoperability which sounds like the right direct by then take me to a page that says "coming soon": http://paperjs.org/tutorials/getting-started/paperscript-interoperability/ Does anyone know how I can call a function created within a paper.js script from my HTML page? 回答1: Apologies for that missing tutorial. I shall really invest

Paperscope and paperjs

半城伤御伤魂 提交于 2019-12-14 02:29:23
问题 So I am trying to create a project with two canvas elements, each with its own paperscript, and with buttons on the outside of each that control certain functions within both. Under the documentation under Paperscript, it says: Please note: When including more than one PaperScript in a page, each script will run >in its own scope and will not see the objects and functions declared in >the others. For PaperScript to communicate with other PaperScript or >JavaScript code, see the tutorial about

How to divide the path into several segments?

陌路散爱 提交于 2019-12-13 08:19:03
问题 I need to divide the Path into several sections. For example, a Path has a dashArray parameter that specifies the length of the dash and length of the gap. I need to get one or more paths that match only the dashes. That is, I need to get a path like this but without dashArray attribute. How can I do this using paper.js or some other library? 回答1: I found the solution to my problem. PaperJS have a method Path.getPointAt(offset) Here offset - is ofsset in pixels from start of path. I maked

Can I connect objects with javascript?

核能气质少年 提交于 2019-12-13 04:00:34
问题 I want to make an interface that looks like this So here is what the user can do 1- Connect people to each other 2- See some information about each person (the balloon) 3- Move these objects around without them loosing their connections Then I want to save these connection information using ajax, so that I can see who is connected to who, I also need to redraw these diagrams next time the user sees the page. It seems like jsPlumb, paperjs, and raphael can all do this and a lot more, my