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.

34 lines
1.1 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Circle Testing</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 topLeft = new Point(200, 200);
  10. var size = new Size(150, 100);
  11. var rectangle = new Rectangle(topLeft, size);
  12. var path = new Path.Ellipse(rectangle);
  13. path.fillColor = 'black';
  14. var topLeft = new Point(5, 400);
  15. var size = new Size(100, 50);
  16. var rectangle = new Rectangle(topLeft, size);
  17. var path = new Path.Ellipse(rectangle);
  18. path.fillColor = 'yellow';
  19. var path = new Path.Circle(new Point(50, 50), 25);
  20. path.fillColor = 'red';
  21. window._json = project.exportJSON();
  22. console.log(window._json);
  23. </script>
  24. <script type="text/paperscript" canvas="canvas2">
  25. project.importJSON(window._json);
  26. </script>
  27. </head>
  28. <body>
  29. <canvas id="canvas1" width="500" height="500"></canvas>
  30. <canvas id="canvas2" width="500" height="500"></canvas>
  31. </body>
  32. </html>