Created
March 10, 2022 08:26
-
-
Save andyg2/be1e8e738bb718a0797dfb557dec86fb to your computer and use it in GitHub Desktop.
Vector Connect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<!-- Load the Paper.js library --> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/paper.js/0.11.5/paper-full.js"></script> | |
<!-- Define inlined PaperScript associate it with myCanvas --> | |
<script type="text/paperscript" canvas="myCanvas"> | |
var myPath = new Path(); | |
myPath.strokeColor = 'black'; | |
// This function is called whenever the user | |
// clicks the mouse in the view: | |
function onMouseDown(event) { | |
// Add a segment to the path at the position of the mouse: | |
myPath.add(event.point); | |
} | |
</script> | |
</head> | |
<body> | |
<canvas id="myCanvas" resize></canvas> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myPath = new Path(); | |
myPath.strokeColor = 'black'; | |
// This function is called whenever the user | |
// clicks the mouse in the view: | |
function onMouseDown(event) { | |
// Add a segment to the path at the position of the mouse: | |
myPath.add(event.point); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
background-color: #fff; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment