2013-10-16 17:10:03 -04:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2014-08-16 13:24:54 -04:00
|
|
|
<meta charset="UTF-8">
|
|
|
|
<title>Shapes</title>
|
|
|
|
<link rel="stylesheet" href="../css/style.css">
|
|
|
|
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
|
|
|
<script type="text/paperscript" canvas="canvas">
|
|
|
|
var circle = new Shape.Circle({
|
|
|
|
center: [100, 100],
|
|
|
|
radius: 50,
|
|
|
|
fillColor: 'red'
|
|
|
|
});
|
2013-10-16 17:10:03 -04:00
|
|
|
|
2014-08-16 13:24:54 -04:00
|
|
|
var ellipse = new Shape.Ellipse({
|
|
|
|
center: [100, 200],
|
|
|
|
radius: [50, 25],
|
|
|
|
fillColor: 'blue',
|
|
|
|
strokeColor: 'black',
|
|
|
|
strokeWidth: 10,
|
|
|
|
rotation: 20
|
|
|
|
});
|
2013-10-16 17:10:03 -04:00
|
|
|
|
2014-08-16 13:24:54 -04:00
|
|
|
var rect = new Shape.Rectangle({
|
|
|
|
center: [100, 300],
|
|
|
|
size: [100, 50],
|
|
|
|
fillColor: 'green',
|
|
|
|
strokeColor: 'black',
|
|
|
|
strokeWidth: 10,
|
|
|
|
rotation: -20
|
|
|
|
});
|
2013-10-16 17:10:03 -04:00
|
|
|
|
2014-08-16 13:24:54 -04:00
|
|
|
var roundRect = new Shape.Rectangle({
|
|
|
|
center: [100, 400],
|
|
|
|
size: [50, 100],
|
|
|
|
radius: [15, 20],
|
|
|
|
fillColor: 'orange',
|
|
|
|
strokeColor: 'black',
|
|
|
|
strokeWidth: 10,
|
|
|
|
rotation: 20
|
|
|
|
});
|
2014-05-13 07:38:51 -04:00
|
|
|
|
2014-08-16 13:24:54 -04:00
|
|
|
[circle, ellipse, rect, roundRect].forEach(function(shape) {
|
|
|
|
var path = shape.toPath();
|
|
|
|
path.position += [200, 0];
|
|
|
|
var shape2 = path.toShape();
|
|
|
|
shape2.position += [200, 0];
|
|
|
|
})
|
|
|
|
</script>
|
2013-10-16 17:10:03 -04:00
|
|
|
</head>
|
|
|
|
<body>
|
2014-08-16 13:24:54 -04:00
|
|
|
<canvas id="canvas" resize></canvas>
|
2013-10-16 17:10:03 -04:00
|
|
|
</body>
|
2014-01-05 16:20:53 -05:00
|
|
|
</html>
|