User:Nicole Hametner/canvas: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
No edit summary
Line 1: Line 1:
<canvas id="c1" showsrc>
function draw(){
  c = document.getElementById("c1")
  //console.log("c is",c)
  p = c.getContext("2d")
  x = 10
  while (x<250) {
    p.strokeRect(x,100,20,40)
    x+=60
  }
}
</canvas>
[[File:19_Hello_canvas.png]]
[[File:19_Hello_canvas.png]]

Revision as of 16:01, 14 October 2012

<canvas id="c1" showsrc> function draw(){

 c = document.getElementById("c1")
 //console.log("c is",c)
 p = c.getContext("2d")
 x = 10
 while (x<250) {
   p.strokeRect(x,100,20,40)
   x+=60
 }

} </canvas>

19 Hello canvas.png