Switch examples to using event.count in onFrame().

This commit is contained in:
Jürg Lehni 2011-05-15 18:12:56 +01:00
parent 36c9286ca9
commit cd7544c7c7
7 changed files with 16 additions and 30 deletions
examples/Scripts

View file

@ -7,18 +7,16 @@
<script type="text/javascript">var root = '../../'</script>
<script type="text/javascript" src="../../src/load.js"></script>
<script type="text/paperscript" canvas="canvas">
var path,
count = 0,
rect = new Rectangle([150, 150], [300, 300]);
var path;
var rect = new Rectangle([150, 150], [300, 300]);
document.currentStyle.fillColor = 'black';
function onFrame() {
function onFrame(event) {
if (path)
path.remove();
var size = Math.abs(Math.sin(count / 40)) * 150 + 10;
var size = Math.abs(Math.sin(event.count / 40)) * 150 + 10;
path = new Path.RoundRectangle(rect, size);
path.position = document.bounds.center;
count++;
}
</script>
</head>