Mercurial > MadButterfly
comparison nodejs/testcanvas.js @ 754:86f2c0fbadfc
Merge from head
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Thu, 26 Aug 2010 13:35:48 +0800 |
parents | 9f4a1134ec82 |
children | cf60cf8983f8 |
comparison
equal
deleted
inserted
replaced
753:cedfe4966fd6 | 754:86f2c0fbadfc |
---|---|
9 app.canvas.background(0,0,0,1); | 9 app.canvas.background(0,0,0,1); |
10 app.canvas.rect(0,0,400,400); | 10 app.canvas.rect(0,0,400,400); |
11 app.canvas.strokeWeight(8); | 11 app.canvas.strokeWeight(8); |
12 width=200; | 12 width=200; |
13 height=200; | 13 height=200; |
14 for(i=0;i<width;i++) { | |
15 x = Math.random()*255; | |
16 y = Math.random()*200; | |
17 cr = Math.random() | |
18 cg = Math.random() | |
19 cb = Math.random() | |
20 app.canvas.stroke(cr,cg,cb,1); | |
21 app.canvas.line(i,0,x,height); | |
22 } | |
23 | 14 |
15 setInterval(function() { | |
16 app.canvas.clear(); | |
17 | |
18 for(i=0;i<width;i++) { | |
19 x = Math.random()*255; | |
20 y = Math.random()*200; | |
21 cr = Math.random() | |
22 cg = Math.random() | |
23 cb = Math.random() | |
24 app.canvas.stroke(cr,cg,cb,1); | |
25 app.canvas.line(i,0,x,height); | |
26 } | |
27 app.update(); | |
28 },33); | |
24 app.loop(); | 29 app.loop(); |