paper.js/examples/Scripts/RoundRectangle.html

25 lines
766 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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Example</title>
<link rel="stylesheet" href="../css/style.css">
2011-03-07 20:07:26 -05:00
<script type="text/javascript">var root = '../../'</script>
<script type="text/javascript" src="../../src/load.js"></script>
2011-03-04 06:38:38 -05:00
<script type="text/paperscript" canvas="canvas">
var path;
var rect = new Rectangle([150, 150], [300, 300]);
document.currentStyle.fillColor = 'black';
function onFrame(event) {
if (path)
path.remove();
var size = Math.abs(Math.sin(event.count / 40)) * 150 + 10;
path = new Path.RoundRectangle(rect, size);
path.position = document.bounds.center;
2011-02-07 14:16:51 -05:00
}
</script>
</head>
<body>
<canvas id="canvas" resize keepalive="true"></canvas>
2011-02-07 14:16:51 -05:00
</body>