HTML5 Game - Canvas Shape Arrow

Description

Arrow

Demo

ResultView the demo in separate window

<!DOCTYPE html>
   <head>
      <style> 
         body {/*from  w  w  w  .  j a v  a  2s  . c o  m*/
            background: #dddddd;
         }

         #canvas {
            position: absolute;
            left: 0px;
            top: 0px;
            margin: 20px;
            background: #ffffff;
            border: thin solid #aaaaaa;
         }
      </style>
   </head>

  <body>
    <canvas id='canvas' width='1500' height='1500'>
      Canvas not supported
    </canvas>

    <script>
let context = document.querySelector('#canvas').getContext('2d');

      context.beginPath(); 
      context.moveTo(0, 40); 
      context.lineTo(240, 40); 
      context.moveTo(260, 40); 
      context.lineTo(500, 40); 
      context.moveTo(495, 35); 
      context.lineTo(500, 40); 
      context.lineTo(495, 45); 
      context.strokeStyle = "#000"; 
      context.stroke(); 
       </script> 

      </script>
  </body>
</html>

Related Topics