mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-28 17:02:24 -05:00
35 lines
951 B
HTML
35 lines
951 B
HTML
<!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>
|