You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.2 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Symbols</title>
  6. <link rel="stylesheet" href="../css/style.css">
  7. <script type="text/javascript" src="../../dist/paper-full.js"></script>
  8. <script type="text/paperscript" canvas="canvas1">
  9. var path = new Path.Ellipse({
  10. from: [10, 10],
  11. to: [200, 100],
  12. fillColor: 'red'
  13. });
  14. path.firstSegment.handleOut.selected = true;
  15. var circle = new Path.Circle({
  16. center: [50, 150],
  17. radius: 25,
  18. fillColor: 'blue'
  19. });
  20. circle.selected = true;
  21. var rectangle = new Path.Rectangle({
  22. from: [25, 200],
  23. to: [100, 225],
  24. fillColor: 'green'
  25. });
  26. rectangle.lastSegment.point.selected = true;
  27. var group = new Group(circle, rectangle);
  28. window._json = project.exportJSON();
  29. console.log(window._json);
  30. </script>
  31. <script type="text/paperscript" canvas="canvas2">
  32. project.importJSON(window._json);
  33. </script>
  34. </head>
  35. <body>
  36. <canvas id="canvas1" width="500" height="500"></canvas>
  37. <canvas id="canvas2" width="500" height="500"></canvas>
  38. </body>
  39. </html>