Advertisement
metalx1000

Semicircle - Basic

Jun 28th, 2013
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.74 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.                 var canvas = document.getElementById('MyCanvas');
  10.                 var context = canvas.getContext('2d');
  11.                 var x = canvas.width / 2;
  12.                 var y = canvas.height / 2;
  13.                 var radius = 75;
  14.  
  15.                 context.beginPath();
  16.                 context.arc(x, y, radius, 0, 2, false);
  17.                 context.closePath();
  18.                 context.lineWidth = 15;
  19.                 context.strokeStyle = "Blue";
  20.                 context.fillStyle = 'blue';
  21.                 context.fill();
  22.                 context.stroke();
  23.         </script>
  24.   </body>
  25. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement