Draw a Rectangle in Paper.js? - Javascript Canvas

Javascript examples for Canvas:Rectangle

Description

Draw a Rectangle in Paper.js?

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <!--load paper.js--> 
      <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/paper.js/0.10.2/paper-full.js"></script> 
      <script type="text/paperscript" canvas="myCanvas">
   var rectangle = new Rectangle(new Point(50, 50), new Point(150, 100));
    var path = new Path.Rectangle(rectangle);
    path.fillColor = '#e9e9ff';
    path.selected = true;/*www .  j  av  a2  s .c  om*/

      </script>
   </head>   
   <body> 
      <canvas id="myCanvas" resize></canvas>  
   </body>
</html>

Related Tutorials