working with JavaScript directly on Paper.js

by jeffgw

HTML

<canvas id="myCanvas" resize></canvas>

JavaScript

// Only executed our code once the DOM is ready.
	window.onload = function() {
		// Get a reference to the canvas object
		var canvas = document.getElementById('myCanvas');
		// Create an empty project and a view for the canvas:
		paper.setup(canvas);
		// Create a Paper.js Path to draw a line into it:
		var circle = new Path.Circle(new Point(80, 50), 35);
circle.fillColor = 'red';
		paper.view.draw();
	}