Advertisement
metalx1000

Line - Basic

Jun 28th, 2013
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.72 KB | None | 0 0
  1. <!DOCTYPE HTML>
  2. <html>
  3.   <head>
  4.   </head>
  5.   <body>
  6.     <canvas id="MyCanvas" width="600" height="300"></canvas>
  7.  
  8.     <script>
  9.  
  10.         var canvas = document.getElementById('MyCanvas');
  11.         var context = canvas.getContext('2d');
  12.  
  13.         context.beginPath();
  14.         context.moveTo(100,30);
  15.         context.lineTo(250,50);
  16.         context.lineWidth = 15;
  17.         context.strokeStyle = "#af5000";
  18.         context.lineCap = 'butt';
  19.         context.stroke();
  20.  
  21.                 context.beginPath();
  22.                 context.moveTo(100,50);
  23.                 context.lineTo(250,50);
  24.                 context.lineWidth = 15;
  25.                 context.strokeStyle = "blue";
  26.                 context.lineCap = 'butt';
  27.                 context.stroke();
  28.  
  29.     </script>
  30.   </body>
  31. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement