mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-06-08 19:24:15 -04:00
Switch from dist/paper.js to dist/paper-full.js and explain the different versions in the README.
Closes #422.
This commit is contained in:
parent
95bcdac57c
commit
fe064e9cc3
117 changed files with 570 additions and 13184 deletions
examples/JSON
Circle Testing.htmlCompound Path.htmlEmpty Path Testing.htmlGradients.htmlGroup Transform.htmlLine Testing.htmlRandom Path Testing.htmlRaster.htmlRect and Attribute Testing.htmlRotated Primitives.htmlSelection.htmlShapes.htmlSymbols.htmlText Testing.htmlTiger.htmlTransform Test 1.htmlTransform Test 2.html
|
@ -4,20 +4,20 @@
|
|||
<meta charset="UTF-8">
|
||||
<title>Circle Testing</title>
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<script type="text/javascript" src="../../dist/paper.js"></script>
|
||||
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
||||
<script type="text/paperscript" canvas="canvas1">
|
||||
var topLeft = new Point(200, 200);
|
||||
var size = new Size(150, 100);
|
||||
var rectangle = new Rectangle(topLeft, size);
|
||||
var path = new Path.Ellipse(rectangle);
|
||||
path.fillColor = 'black';
|
||||
|
||||
|
||||
var topLeft = new Point(5, 400);
|
||||
var size = new Size(100, 50);
|
||||
var rectangle = new Rectangle(topLeft, size);
|
||||
var path = new Path.Ellipse(rectangle);
|
||||
path.fillColor = 'yellow';
|
||||
|
||||
|
||||
var path = new Path.Circle(new Point(50, 50), 25);
|
||||
path.fillColor = 'red';
|
||||
window._json = project.exportJSON();
|
||||
|
@ -31,4 +31,4 @@
|
|||
<canvas id="canvas1" width="500" height="500"></canvas>
|
||||
<canvas id="canvas2" width="500" height="500"></canvas>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<title>Compound Path</title>
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<script type="text/javascript" src="../../dist/paper.js"></script>
|
||||
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
||||
<script type="text/paperscript" canvas="canvas1">
|
||||
project.currentStyle.fillColor = 'black';
|
||||
var path1 = new Path.Rectangle([200, 200], [100, 100]);
|
||||
|
@ -22,4 +22,4 @@
|
|||
<canvas id="canvas1" width="500" height="500"></canvas>
|
||||
<canvas id="canvas2" width="500" height="500"></canvas>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -4,19 +4,19 @@
|
|||
<meta charset="UTF-8">
|
||||
<title>Empty Path Testing</title>
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<script type="text/javascript" src="../../dist/paper.js"></script>
|
||||
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
||||
<script type="text/paperscript" canvas="canvas1">
|
||||
var path = new Path();
|
||||
path.strokeColor = 'black';
|
||||
path.add(new Point(30, 30));
|
||||
path.add(new Point(100, 100));
|
||||
|
||||
|
||||
var segments = [new Point(30, 90), new Point(100, 150)];
|
||||
var path2 = new Path(segments);
|
||||
path2.strokeColor = 'yellow';
|
||||
|
||||
var path3 = new Path();
|
||||
|
||||
|
||||
window._json = project.exportJSON();
|
||||
console.log(window._json);
|
||||
</script>
|
||||
|
@ -28,4 +28,4 @@
|
|||
<canvas id="canvas1" width="500" height="500"></canvas>
|
||||
<canvas id="canvas2" width="500" height="500"></canvas>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<title>Gradients</title>
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<script type="text/javascript" src="../../dist/paper.js"></script>
|
||||
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
||||
<script type="text/paperscript" canvas="canvas1">
|
||||
var path = new Path.Circle(view.center, view.bounds.height * 0.4);
|
||||
path.fillColor = {
|
||||
|
@ -12,7 +12,7 @@
|
|||
stops: ['yellow', 'red', 'black'],
|
||||
radial: true,
|
||||
origin: path.position,
|
||||
destination: path.bounds.rightCenter
|
||||
destination: path.bounds.rightCenter
|
||||
}
|
||||
path.strokeColor = 'black';
|
||||
window._json = project.exportJSON();
|
||||
|
@ -26,4 +26,4 @@
|
|||
<canvas id="canvas1" width="500" height="500"></canvas>
|
||||
<canvas id="canvas2" width="500" height="500"></canvas>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<title>Group Transform</title>
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<script type="text/javascript" src="../../dist/paper.js"></script>
|
||||
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
||||
<script type="text/paperscript" canvas="canvas1">
|
||||
var circle1 = new Path.Circle(new Point(100, 100), 50);
|
||||
circle1.fillColor = 'red';
|
||||
|
@ -25,4 +25,4 @@
|
|||
<canvas id="canvas1" width="500" height="500"></canvas>
|
||||
<canvas id="canvas2" width="500" height="500"></canvas>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<title>Line Testing</title>
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<script type="text/javascript" src="../../dist/paper.js"></script>
|
||||
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
||||
<script type="text/paperscript" canvas="canvas1">
|
||||
var x1 = 5,
|
||||
x2 = 45,
|
||||
|
@ -13,7 +13,7 @@
|
|||
var line1 = new Path.Line([x1, y1], [x2, y2]);
|
||||
line1.strokeColor = "blue";
|
||||
line1.strokeWidth = "10";
|
||||
|
||||
|
||||
var x3 = 20,
|
||||
x4 = 99,
|
||||
y3 = 20,
|
||||
|
@ -21,7 +21,7 @@
|
|||
var line2 = new Path.Line([x3, y3], [x4, y4]);
|
||||
line2.strokeColor = "red";
|
||||
line2.strokeWidth = "2";
|
||||
|
||||
|
||||
var x5 = 50,
|
||||
x6 = 200,
|
||||
y5 = 55,
|
||||
|
@ -29,7 +29,7 @@
|
|||
var line3 = new Path.Line([x5, y5], [x6, y6]);
|
||||
line3.strokeColor = "yellow";
|
||||
line3.strokeWidth = "5";
|
||||
|
||||
|
||||
window._json = project.exportJSON();
|
||||
console.log(window._json);
|
||||
</script>
|
||||
|
@ -41,4 +41,4 @@
|
|||
<canvas id="canvas1" width="500" height="500"></canvas>
|
||||
<canvas id="canvas2" width="500" height="500"></canvas>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<title>Random Path Testing</title>
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<script type="text/javascript" src="../../dist/paper.js"></script>
|
||||
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
||||
<script type="text/paperscript" canvas="canvas1">
|
||||
var center = new Point(100, 100);
|
||||
var sides = 3;
|
||||
|
@ -14,20 +14,20 @@
|
|||
copy = triangle.clone();
|
||||
copy.strokeColor = 'blue';
|
||||
copy.rotate(45);
|
||||
|
||||
|
||||
var center = new Point(100, 300);
|
||||
var sides = 10;
|
||||
var radius = 50;
|
||||
var decahedron = new Path.RegularPolygon(center, sides, radius);
|
||||
decahedron.fillColor = 'black';
|
||||
|
||||
|
||||
var center = new Point(100, 400);
|
||||
var points = 6;
|
||||
var radius1 = 20;
|
||||
var radius2 = 50;
|
||||
var path = new Path.Star(center, points, radius1, radius2);
|
||||
path.fillColor = 'black';
|
||||
|
||||
|
||||
window._json = project.exportJSON();
|
||||
console.log(window._json);
|
||||
</script>
|
||||
|
@ -39,4 +39,4 @@
|
|||
<canvas id="canvas1" width="500" height="500"></canvas>
|
||||
<canvas id="canvas2" width="500" height="500"></canvas>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<title>Rectangle Testing</title>
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<script type="text/javascript" src="../../dist/paper.js"></script>
|
||||
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
||||
<script type="text/paperscript" canvas="canvas1">
|
||||
var point1 = new Point(10, 10);
|
||||
var size1 = new Size(50, 50);
|
||||
|
@ -17,7 +17,7 @@
|
|||
path1.opacity = ".1";
|
||||
path1.dashArray = [5, 2];
|
||||
path1.dashOffset = "0";
|
||||
|
||||
|
||||
var point2 = new Point(75, 75);
|
||||
var point22 = new Point(100, 100);
|
||||
var path2 = new Path.Rectangle(point2, point22);
|
||||
|
@ -27,13 +27,13 @@
|
|||
path2.id = "square2";
|
||||
path2.strokeCap = "butt";
|
||||
path2.opacity = "1";
|
||||
|
||||
|
||||
var point3 = new Point(150, 150);
|
||||
var size3 = new Size(50, 50);
|
||||
var rectangle3 = new Rectangle(point3, size3);
|
||||
var path3 = new Path.Rectangle(rectangle3);
|
||||
path3.strokeColor = 'blue';
|
||||
|
||||
|
||||
var point4 = new Point(200, 200);
|
||||
var size4 = new Size(100, 100);
|
||||
var rectangle4 = new Rectangle(point4, size4);
|
||||
|
@ -41,7 +41,7 @@
|
|||
var path4 = new Path.Rectangle(rectangle4, cornerSize4);
|
||||
path4.strokeColor= 'yellow';
|
||||
path4.fillColor='purple';
|
||||
|
||||
|
||||
window._json = project.exportJSON();
|
||||
console.log(window._json);
|
||||
</script>
|
||||
|
@ -53,4 +53,4 @@
|
|||
<canvas id="canvas1" width="500" height="500"></canvas>
|
||||
<canvas id="canvas2" width="500" height="500"></canvas>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<title>Rotated Primitives</title>
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<script type="text/javascript" src="../../dist/paper.js"></script>
|
||||
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
||||
<script type="text/paperscript" canvas="canvas1">
|
||||
// This "arbitrary" shape triggered rectangles in the original code,
|
||||
// since point2 is as far from point0 as point3 is from point1.
|
||||
|
@ -52,4 +52,4 @@
|
|||
<canvas id="canvas1" width="500" height="500"></canvas>
|
||||
<canvas id="canvas2" width="500" height="500"></canvas>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<title>Symbols</title>
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<script type="text/javascript" src="../../dist/paper.js"></script>
|
||||
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
||||
<script type="text/paperscript" canvas="canvas1">
|
||||
var path = new Path.Ellipse({
|
||||
from: [10, 10],
|
||||
|
@ -40,4 +40,4 @@
|
|||
<canvas id="canvas1" width="500" height="500"></canvas>
|
||||
<canvas id="canvas2" width="500" height="500"></canvas>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<title>Symbols</title>
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<script type="text/javascript" src="../../dist/paper.js"></script>
|
||||
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
||||
<script type="text/paperscript" canvas="canvas1">
|
||||
var ellipse = new Shape.Ellipse({
|
||||
from: [10, 10],
|
||||
|
@ -36,4 +36,4 @@
|
|||
<canvas id="canvas1" width="500" height="500"></canvas>
|
||||
<canvas id="canvas2" width="500" height="500"></canvas>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<title>Symbols</title>
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<script type="text/javascript" src="../../dist/paper.js"></script>
|
||||
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
||||
<script type="text/paperscript" canvas="canvas1">
|
||||
var ellipse = new Path.Ellipse({
|
||||
from: [0, 0],
|
||||
|
@ -27,4 +27,4 @@
|
|||
<canvas id="canvas1" width="500" height="500"></canvas>
|
||||
<canvas id="canvas2" width="500" height="500"></canvas>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
<meta charset="UTF-8">
|
||||
<title>Text Testing</title>
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<script type="text/javascript" src="../../dist/paper.js"></script>
|
||||
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
||||
<script type="text/paperscript" canvas="canvas1">
|
||||
var text = new PointText(new Point(50, 100));
|
||||
text.fillColor = 'black';
|
||||
text.content = 'This is a test';
|
||||
|
||||
|
||||
var text = new PointText(new Point(100, 150));
|
||||
text.fillColor = 'red';
|
||||
text.strokeWidth = '4';
|
||||
|
@ -35,4 +35,4 @@
|
|||
<canvas id="canvas1" width="500" height="500"></canvas>
|
||||
<canvas id="canvas2" width="500" height="500"></canvas>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<title>Transform Testing</title>
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<script type="text/javascript" src="../../dist/paper.js"></script>
|
||||
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
||||
<script type="text/paperscript" canvas="canvas1">
|
||||
var circlePath = new Path.Circle(new Point(280, 100), 25);
|
||||
circlePath.strokeColor = 'black';
|
||||
|
@ -29,4 +29,4 @@
|
|||
<canvas id="canvas1" width="500" height="500"></canvas>
|
||||
<canvas id="canvas2" width="500" height="500"></canvas>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<title>Rectangle Testing</title>
|
||||
<link rel="stylesheet" href="../css/style.css">
|
||||
<script type="text/javascript" src="../../dist/paper.js"></script>
|
||||
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
||||
<script type="text/paperscript" canvas="canvas1">
|
||||
var path = new Path.Rectangle(new Point(50, 50), new Size(100, 50));
|
||||
path.style = {
|
||||
|
@ -27,4 +27,4 @@
|
|||
<canvas id="canvas1" width="500" height="500"></canvas>
|
||||
<canvas id="canvas2" width="500" height="500"></canvas>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue