mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
28 lines
No EOL
661 B
HTML
28 lines
No EOL
661 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>Rounded Rectangle</title>
|
|
<link rel="stylesheet" href="../css/style.css">
|
|
<script type="text/javascript" src="../../dist/paper.js"></script>
|
|
<script type="text/paperscript" canvas="canvas">
|
|
var path;
|
|
|
|
function onFrame(event) {
|
|
if (path)
|
|
path.remove();
|
|
path = new Path.RoundRectangle({
|
|
radius: Math.abs(Math.sin(event.count / 40)) * 150 + 10,
|
|
rectangle: {
|
|
size: [300, 300]
|
|
},
|
|
fillColor: 'black'
|
|
});
|
|
path.position = view.center;
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<canvas id="canvas" resize></canvas>
|
|
</body>
|
|
</html> |