paper.js/examples/Scripts/RoundRectangle.html

29 lines
767 B
HTML
Raw Normal View History

2011-02-21 08:31:26 -05:00
<!DOCTYPE html>
2011-02-07 14:16:51 -05:00
<html>
<head>
2014-08-16 13:24:54 -04:00
<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;
2011-07-07 10:09:02 -04:00
2014-08-16 13:24:54 -04:00
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>
2011-02-07 14:16:51 -05:00
</head>
<body>
2014-08-16 13:24:54 -04:00
<canvas id="canvas" resize></canvas>
2011-05-30 18:27:39 -04:00
</body>
</html>