Web UI for ARGUS server
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.

44 lines
1.2 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Mulitple Tools</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="canvas">
  9. // Create two drawing tools.
  10. // tool1 will draw straight lines, tool2 will draw clouds.
  11. // Both share the mouseDown event:
  12. var path;
  13. function onMouseDown(event) {
  14. path = new Path();
  15. path.strokeColor = 'black';
  16. path.add(event.point);
  17. }
  18. window.app = {
  19. tool1: new Tool({
  20. onMouseDown: onMouseDown,
  21. onMouseDrag: function(event) {
  22. path.add(event.point);
  23. }
  24. }),
  25. tool2: new Tool({
  26. minDistance: 20,
  27. onMouseDown: onMouseDown,
  28. onMouseDrag: function(event) {
  29. // Use the arcTo command to draw cloudy lines
  30. path.arcTo(event.point);
  31. }
  32. })
  33. };
  34. </script>
  35. </head>
  36. <body>
  37. <a href="#" onclick="app.tool1.activate(); return false;">Lines</a>
  38. <a href="#" onclick="app.tool2.activate(); return false;">Clouds</a>
  39. <canvas id="canvas" resize></canvas>
  40. </body>
  41. </html>