Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
  <script type="text/javascript" src="https://raw.github.com/paperjs/paper.js/master/dist/paper.js"></script>
  
    
</head>
<body>
  <canvas id="p" resize></canvas>
    <script type="text/paperscript" canvas="p">
    var rect = new Path.RoundRectangle(new Rectangle([300,100], [100, 100]), 15);
    rect.strokeColor = "black";
    rect.fillColor = "white";
    rect.opacity = 0.1;
    var text = new PointText();
    //text.justification = 'center';
    text.fillColor = 'black';
    text.strokeColor = 'green';
    text.content = 'The contents of the point text';
    // rect ortası 
      text.position = rect.bounds.center;
    rect.onMouseEnter = function(event){
      console.log("gğı", event.point);
        rect.opacity = 0.7;
    };
    rect.onMouseLeave = function(event){
      //console.log("gğı", event.point);
        rect.opacity = 0.1;
    };
    
      onMouseDown = function(event){
        console.log(event.point);
      };
  </script>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
hinoglupro
0viewers