client/js/tweetvote-anim.js
changeset 9 fd659ad76e0f
parent 8 d41e19b3b043
child 11 ef4287a73c4a
equal deleted inserted replaced
8:d41e19b3b043 9:fd659ad76e0f
   289 		walls[1] = null;
   289 		walls[1] = null;
   290 		walls[2] = null;
   290 		walls[2] = null;
   291 		walls[3] = null;
   291 		walls[3] = null;
   292 	} else {
   292 	} else {
   293   
   293   
   294   wall_thickness = 10;
   294   wall_thickness = 20;
   295   
   295   
   296   walls[0] = createBox(world, 1880, 900, wall_thickness, 900); //  rightmost wall
   296   walls[0] = createBox(world, 1910, 900, wall_thickness, 900); //  rightmost wall
   297   walls[1] = createBox(world, 1510, 600, wall_thickness, 300); //  wall 4 / 3
   297   walls[1] = createBox(world, 1540, 600, wall_thickness, 300); //  wall 4 / 3
   298   walls[2] = createBox(world, 1130, 600, wall_thickness, 300); //  wall 3 / 2
   298   
   299   walls[3] = createBox(world, 760, 600, wall_thickness, 300); //   wall 2 / 1
   299   walls[2] = createBox(world, 1160, 600, wall_thickness, 300); //  wall 3 / 2
   300   walls[4] = createBox(world, 390, 600, wall_thickness, 300); //   leftmostwall    
   300   walls[3] = createBox(world, 790, 600, wall_thickness, 300); //   wall 2 / 1
       
   301   walls[4] = createBox(world, 420, 600, wall_thickness, 300); //   leftmostwall    
   301  
   302  
   302   walls[5] = createBox(world, 580, 600, 170, 10); //  4    
   303   walls[5] = createBox(world, 580, 600, 170, 10); //  4    
   303   walls[6] = createBox(world, 950, 750, 170, 10); //  3   
   304   walls[6] = createBox(world, 950, 750, 170, 10); //  3   
   304   walls[7] = createBox(world, 1320, 750, 170, 10); //  2   
   305   walls[7] = createBox(world, 1320, 750, 170, 10); //  2   
   305   walls[8] = createBox(world, 1690, 600, 170, 10); //  1   
   306   walls[8] = createBox(world, 1690, 600, 170, 10); //  1   
   444 
   445 
   445   */
   446   */
   446   
   447   
   447   var img = new Image();
   448   var img = new Image();
   448   img.src = t.profile_image_url;
   449   img.src = t.profile_image_url;
       
   450 
   449   img.onload = function(){
   451   img.onload = function(){
   450     var ptrn = graphics.createPattern(img,'repeat');
   452   
   451 
   453     var canvasCopy = document.createElement("canvas");
       
   454     var copyContext = canvasCopy.getContext("2d");
       
   455     
       
   456     canvasCopy.width = 96;
       
   457     canvasCopy.height = 96;
       
   458     copyContext.drawImage(img, 0, 0, 96, 96);
       
   459 
       
   460     var ptrn = graphics.createPattern(canvasCopy,'no-repeat');
   452     graphics.fillStyle = ptrn;
   461     graphics.fillStyle = ptrn;
   453     graphics.fill(-5,0,150,150);
   462     graphics.fill(-5,0,150,150);
       
   463 
   454   }
   464   }
   455   
   465   
   456   
   466   
   457   
   467   
   458 	element.appendChild( circle );
   468 	element.appendChild( circle );