paper.js/examples/Tools/Clouds.html

35 lines
No EOL
909 B
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Example</title>
<link rel="stylesheet" href="../css/style.css">
<script type="text/javascript">var root = '../../'</script>
<script type="text/javascript" src="../../src/load.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 keepalive="true"></canvas>
</body>