mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
26 lines
No EOL
692 B
HTML
26 lines
No EOL
692 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>Example</title>
|
|
<script type="text/javascript">var root = '../../'</script>
|
|
<script type="text/javascript" src="../../src/load.js"></script>
|
|
<script type="text/paperscript" canvas="canvas">
|
|
var path;
|
|
function onMouseDown(event) {
|
|
path = new Path();
|
|
path.strokeColor = 'black';
|
|
path.strokeWidth = 5;
|
|
path.strokeJoin = 'round';
|
|
path.strokeCap = 'round';
|
|
path.add(event.point);
|
|
}
|
|
function onMouseDrag(event) {
|
|
path.arcTo(event.point, true);
|
|
}
|
|
tool.minDistance = 30;
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<canvas id='canvas' width=1024 height=768></canvas>
|
|
</body> |