UNPKG

paper

Version:

The Swiss Army Knife of Vector Graphics Scripting

36 lines (32 loc) 951 B
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Clouds</title> <link rel="stylesheet" href="../css/style.css"> <script type="text/javascript" src="../../dist/paper-full.js"></script> <script type="text/paperscript" canvas="canvas"> // Any newly created item will inherit the following styles: project.currentStyle = { strokeColor: 'black', strokeWidth: 5, strokeJoin: 'round', strokeCap: 'round' }; // The user has to drag the mouse at least 30pt before the mouse drag // event is fired: tool.minDistance = 30; var path; function onMouseDown(event) { path = new Path(); path.add(event.point); } function onMouseDrag(event) { path.arcTo(event.point, true); } </script> </head> <body> <canvas id="canvas" resize></canvas> </body> </html>