paper.js/examples/Scripts/RoundRectangle.html
2014-08-16 19:24:54 +02:00

28 lines
767 B
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Rounded Rectangle</title>
<link rel="stylesheet" href="../css/style.css">
<script type="text/javascript" src="../../dist/paper-full.js"></script>
<script type="text/paperscript" canvas="canvas">
var path;
function onFrame(event) {
if (path)
path.remove();
path = new Path.Rectangle({
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>