paper 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +95 -0
- package/dist/docs/assets/js/paper.js +4565 -733
- package/dist/docs/classes/AreaText.html +720 -242
- package/dist/docs/classes/ChangeFlag.html +1 -1
- package/dist/docs/classes/Color.html +218 -21
- package/dist/docs/classes/CompoundPath.html +1146 -296
- package/dist/docs/classes/Curve.html +1 -1
- package/dist/docs/classes/CurveLocation.html +1 -1
- package/dist/docs/classes/DrawEvent.html +69 -0
- package/dist/docs/classes/Effect.html +434 -0
- package/dist/docs/classes/EffectInstance.html +304 -0
- package/dist/docs/classes/Event.html +1 -1
- package/dist/docs/classes/Gradient.html +1 -1
- package/dist/docs/classes/GradientStop.html +1 -1
- package/dist/docs/classes/Group.html +792 -243
- package/dist/docs/classes/HitResult.html +1 -1
- package/dist/docs/classes/HostItem.html +720 -242
- package/dist/docs/classes/Item.html +777 -242
- package/dist/docs/classes/Key.html +1 -1
- package/dist/docs/classes/KeyEvent.html +1 -1
- package/dist/docs/classes/Layer.html +734 -185
- package/dist/docs/classes/Matrix.html +1 -1
- package/dist/docs/classes/MouseEvent.html +1 -1
- package/dist/docs/classes/PaperScope.html +1 -1
- package/dist/docs/classes/PaperScript.html +4 -2
- package/dist/docs/classes/Path.html +1195 -252
- package/dist/docs/classes/PathItem.html +1148 -298
- package/dist/docs/classes/PathText.html +720 -242
- package/dist/docs/classes/PatternDefinition.html +367 -0
- package/dist/docs/classes/Point.html +1 -1
- package/dist/docs/classes/PointText.html +720 -242
- package/dist/docs/classes/Project.html +177 -7
- package/dist/docs/classes/Raster.html +720 -242
- package/dist/docs/classes/Rectangle.html +1 -1
- package/dist/docs/classes/Segment.html +3 -3
- package/dist/docs/classes/Shape.html +720 -242
- package/dist/docs/classes/Size.html +1 -1
- package/dist/docs/classes/StrokeProfileStop.html +346 -0
- package/dist/docs/classes/Style.html +1 -1
- package/dist/docs/classes/SymbolDefinition.html +28 -2
- package/dist/docs/classes/SymbolItem.html +720 -242
- package/dist/docs/classes/TextItem.html +720 -242
- package/dist/docs/classes/TextRange.html +1 -1
- package/dist/docs/classes/TextStory.html +1 -1
- package/dist/docs/classes/Tool.html +2 -2
- package/dist/docs/classes/ToolEvent.html +1 -1
- package/dist/docs/classes/Tween.html +1 -1
- package/dist/docs/classes/View.html +2 -2
- package/dist/docs/classes/global.html +1 -1
- package/dist/docs/classes/index.html +2 -2
- package/dist/docs/index.html +1 -1
- package/dist/node/browser.js +15 -0
- package/dist/paper-core.js +4476 -674
- package/dist/paper-core.min.js +3 -3
- package/dist/paper-full.js +4565 -733
- package/dist/paper-full.min.js +3 -3
- package/dist/paper-hosted.js +5111 -823
- package/dist/paper.d.ts +898 -47
- package/examples/Paperjs.org/LiveEffects.html +366 -0
- package/examples/Paperjs.org/Offsetting.html +379 -0
- package/examples/Paperjs.org/StrokeProfiles.html +706 -0
- package/examples/Scripts/Patterns.html +57 -0
- package/package.json +5 -3
|
@@ -771,6 +771,91 @@ var shape = new Shape.Ellipse({
|
|
|
771
771
|
<div class="reference-members"><h2>Properties inherited from <a href="../classes/Item.html"><tt>Item</tt></a></h2>
|
|
772
772
|
|
|
773
773
|
|
|
774
|
+
<div id="effects" class="member">
|
|
775
|
+
<div class="member-link">
|
|
776
|
+
<a name="effects" href="#effects"><tt><b>effects</b></tt></a>
|
|
777
|
+
</div>
|
|
778
|
+
<div class="member-description hidden">
|
|
779
|
+
|
|
780
|
+
<div class="member-text">
|
|
781
|
+
<p>The live effects of the item, in the order in which they apply, as the instances of the <tt>Effecteffects</tt> that they use. They derive what is drawn from the item without changing it: drawing draws their output, and <a href="../classes/Item.html#previewbounds"><tt>previewBounds</tt></a> measures it, while hit testing, <a href="../classes/Item.html#bounds"><tt>bounds</tt></a> and <a href="../classes/Item.html#strokebounds"><tt>strokeBounds</tt></a> stay with the item itself. It is set to plain objects describing them, <code>{ type,
|
|
782
|
+
parameters, visible }</code>, with the <code>type</code> of the effect. Changing the returned array directly isn’t tracked, as with <a href="../classes/Path.html#segments"><tt>path.segments</tt></a>.</p>
|
|
783
|
+
<p>Paper.js has these effects, and <a href="../classes/Effect.html"><tt>Effect</tt></a> creates more:</p>
|
|
784
|
+
<ul>
|
|
785
|
+
<li><code>offset</code>: offsets the paths, see <a href="../classes/PathItem.html#offset"><tt>pathItem.offset</tt></a>(), with the parameters <code>distance</code> (<code>0</code>), <code>join</code> (<code>'miter'</code>) and <code>miterLimit</code> (<code>10</code>).</li>
|
|
786
|
+
<li><code>outline</code>: outlines the strokes of the paths as filled areas next to their fills, see <a href="../classes/PathItem.html#outline"><tt>pathItem.outline</tt></a>(), following their <a href="../classes/Path.html#strokeprofile"><tt>path.strokeProfile</tt></a>.</li>
|
|
787
|
+
</ul>
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
<ul class="member-list">
|
|
792
|
+
<h4>Type:</h4>
|
|
793
|
+
<li>
|
|
794
|
+
Array of <a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a> objects
|
|
795
|
+
</li>
|
|
796
|
+
</ul>
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
<h4>Example:</h4>
|
|
800
|
+
|
|
801
|
+
<div class="paperscript split">
|
|
802
|
+
|
|
803
|
+
<div class="buttons">
|
|
804
|
+
<div class="button run">Run</div>
|
|
805
|
+
</div>
|
|
806
|
+
|
|
807
|
+
<script type="text/paperscript" canvas="canvas-13">
|
|
808
|
+
var path = new Path.Star({
|
|
809
|
+
center: view.center,
|
|
810
|
+
points: 5,
|
|
811
|
+
radius1: 20,
|
|
812
|
+
radius2: 40,
|
|
813
|
+
strokeColor: 'black',
|
|
814
|
+
strokeWidth: 8
|
|
815
|
+
});
|
|
816
|
+
path.effects = [
|
|
817
|
+
{ type: 'offset', parameters: { distance: 10, join: 'round' } },
|
|
818
|
+
{ type: 'outline' }
|
|
819
|
+
];
|
|
820
|
+
</script>
|
|
821
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-13"></canvas></div>
|
|
822
|
+
</div>
|
|
823
|
+
|
|
824
|
+
|
|
825
|
+
</div>
|
|
826
|
+
|
|
827
|
+
</div>
|
|
828
|
+
</div>
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
<div id="previewbounds-matrix" class="member">
|
|
832
|
+
<div class="member-link">
|
|
833
|
+
<a name="previewbounds-matrix" href="#previewbounds-matrix"><tt><b>previewBounds</b></tt></a>
|
|
834
|
+
</div>
|
|
835
|
+
<div class="member-description hidden">
|
|
836
|
+
|
|
837
|
+
<div class="member-text">
|
|
838
|
+
<p>The bounds of what the item looks like with its effects, in the coordinate space of its parent: of their output with its strokes, or of its children’s with their effects, and its <a href="../classes/Item.html#strokebounds"><tt>strokeBounds</tt></a> without them, as Illustrator’s “Use Preview Bounds”.</p>
|
|
839
|
+
|
|
840
|
+
<p>Read only.</p>
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
<ul class="member-list">
|
|
845
|
+
<h4>Type:</h4>
|
|
846
|
+
<li>
|
|
847
|
+
<a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
|
|
848
|
+
</li>
|
|
849
|
+
</ul>
|
|
850
|
+
|
|
851
|
+
|
|
852
|
+
|
|
853
|
+
</div>
|
|
854
|
+
|
|
855
|
+
</div>
|
|
856
|
+
</div>
|
|
857
|
+
|
|
858
|
+
|
|
774
859
|
<div id="key" class="member">
|
|
775
860
|
<div class="member-link">
|
|
776
861
|
<a name="key" href="#key"><tt><b>key</b></tt></a>
|
|
@@ -883,7 +968,7 @@ var shape = new Shape.Ellipse({
|
|
|
883
968
|
<div class="button run">Run</div>
|
|
884
969
|
</div>
|
|
885
970
|
|
|
886
|
-
<script type="text/paperscript" canvas="canvas-
|
|
971
|
+
<script type="text/paperscript" canvas="canvas-14">
|
|
887
972
|
var path = new Path.Circle({
|
|
888
973
|
center: [80, 50],
|
|
889
974
|
radius: 35
|
|
@@ -898,7 +983,7 @@ group.addChild(path);
|
|
|
898
983
|
// The path can be accessed by name:
|
|
899
984
|
group.children['example'].fillColor = 'red';
|
|
900
985
|
</script>
|
|
901
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
986
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-14"></canvas></div>
|
|
902
987
|
</div>
|
|
903
988
|
|
|
904
989
|
|
|
@@ -936,7 +1021,7 @@ group.children['example'].fillColor = 'red';
|
|
|
936
1021
|
<div class="button run">Run</div>
|
|
937
1022
|
</div>
|
|
938
1023
|
|
|
939
|
-
<script type="text/paperscript" canvas="canvas-
|
|
1024
|
+
<script type="text/paperscript" canvas="canvas-15">
|
|
940
1025
|
var circle = new Path.Circle({
|
|
941
1026
|
center: [80, 50],
|
|
942
1027
|
radius: 30
|
|
@@ -947,7 +1032,7 @@ circle.style = {
|
|
|
947
1032
|
strokeWidth: 5
|
|
948
1033
|
};
|
|
949
1034
|
</script>
|
|
950
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
1035
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-15"></canvas></div>
|
|
951
1036
|
</div>
|
|
952
1037
|
|
|
953
1038
|
|
|
@@ -959,7 +1044,7 @@ circle.style = {
|
|
|
959
1044
|
<div class="button run">Run</div>
|
|
960
1045
|
</div>
|
|
961
1046
|
|
|
962
|
-
<script type="text/paperscript" canvas="canvas-
|
|
1047
|
+
<script type="text/paperscript" canvas="canvas-16">
|
|
963
1048
|
var path = new Path.Circle({
|
|
964
1049
|
center: [50, 50],
|
|
965
1050
|
radius: 30,
|
|
@@ -974,7 +1059,7 @@ var path2 = new Path.Circle({
|
|
|
974
1059
|
// Copy the path style of path:
|
|
975
1060
|
path2.style = path.style;
|
|
976
1061
|
</script>
|
|
977
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
1062
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-16"></canvas></div>
|
|
978
1063
|
</div>
|
|
979
1064
|
|
|
980
1065
|
|
|
@@ -986,7 +1071,7 @@ path2.style = path.style;
|
|
|
986
1071
|
<div class="button run">Run</div>
|
|
987
1072
|
</div>
|
|
988
1073
|
|
|
989
|
-
<script type="text/paperscript" canvas="canvas-
|
|
1074
|
+
<script type="text/paperscript" canvas="canvas-17">
|
|
990
1075
|
var myStyle = {
|
|
991
1076
|
fillColor: 'red',
|
|
992
1077
|
strokeColor: 'blue',
|
|
@@ -1005,7 +1090,7 @@ var path2 = new Path.Circle({
|
|
|
1005
1090
|
});
|
|
1006
1091
|
path2.style = myStyle;
|
|
1007
1092
|
</script>
|
|
1008
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
1093
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-17"></canvas></div>
|
|
1009
1094
|
</div>
|
|
1010
1095
|
|
|
1011
1096
|
|
|
@@ -1047,7 +1132,7 @@ path2.style = myStyle;
|
|
|
1047
1132
|
<div class="button run">Run</div>
|
|
1048
1133
|
</div>
|
|
1049
1134
|
|
|
1050
|
-
<script type="text/paperscript" canvas="canvas-
|
|
1135
|
+
<script type="text/paperscript" canvas="canvas-18">
|
|
1051
1136
|
var unlockedItem = new Path.Circle({
|
|
1052
1137
|
center: view.center - [35, 0],
|
|
1053
1138
|
radius: 30,
|
|
@@ -1074,7 +1159,7 @@ new PointText({
|
|
|
1074
1159
|
justification: 'center'
|
|
1075
1160
|
});
|
|
1076
1161
|
</script>
|
|
1077
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
1162
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-18"></canvas></div>
|
|
1078
1163
|
</div>
|
|
1079
1164
|
|
|
1080
1165
|
|
|
@@ -1116,7 +1201,7 @@ new PointText({
|
|
|
1116
1201
|
<div class="button run">Run</div>
|
|
1117
1202
|
</div>
|
|
1118
1203
|
|
|
1119
|
-
<script type="text/paperscript" canvas="canvas-
|
|
1204
|
+
<script type="text/paperscript" canvas="canvas-19">
|
|
1120
1205
|
var path = new Path.Circle({
|
|
1121
1206
|
center: [50, 50],
|
|
1122
1207
|
radius: 20,
|
|
@@ -1126,7 +1211,7 @@ var path = new Path.Circle({
|
|
|
1126
1211
|
// Hide the path:
|
|
1127
1212
|
path.visible = false;
|
|
1128
1213
|
</script>
|
|
1129
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
1214
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-19"></canvas></div>
|
|
1130
1215
|
</div>
|
|
1131
1216
|
|
|
1132
1217
|
|
|
@@ -1174,7 +1259,7 @@ path.visible = false;
|
|
|
1174
1259
|
<div class="button run">Run</div>
|
|
1175
1260
|
</div>
|
|
1176
1261
|
|
|
1177
|
-
<script type="text/paperscript" canvas="canvas-
|
|
1262
|
+
<script type="text/paperscript" canvas="canvas-20">
|
|
1178
1263
|
// Create a white rectangle in the background
|
|
1179
1264
|
// with the same dimensions as the view:
|
|
1180
1265
|
var background = new Path.Rectangle(view.bounds);
|
|
@@ -1195,7 +1280,7 @@ var circle2 = new Path.Circle({
|
|
|
1195
1280
|
// Set the blend mode of circle2:
|
|
1196
1281
|
circle2.blendMode = 'multiply';
|
|
1197
1282
|
</script>
|
|
1198
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
1283
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-20"></canvas></div>
|
|
1199
1284
|
</div>
|
|
1200
1285
|
|
|
1201
1286
|
|
|
@@ -1237,7 +1322,7 @@ circle2.blendMode = 'multiply';
|
|
|
1237
1322
|
<div class="button run">Run</div>
|
|
1238
1323
|
</div>
|
|
1239
1324
|
|
|
1240
|
-
<script type="text/paperscript" canvas="canvas-
|
|
1325
|
+
<script type="text/paperscript" canvas="canvas-21">
|
|
1241
1326
|
var circle = new Path.Circle({
|
|
1242
1327
|
center: [80, 50],
|
|
1243
1328
|
radius: 35,
|
|
@@ -1255,7 +1340,7 @@ var circle2 = new Path.Circle({
|
|
|
1255
1340
|
// Make circle2 50% transparent:
|
|
1256
1341
|
circle2.opacity = 0.5;
|
|
1257
1342
|
</script>
|
|
1258
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
1343
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-21"></canvas></div>
|
|
1259
1344
|
</div>
|
|
1260
1345
|
|
|
1261
1346
|
|
|
@@ -1378,14 +1463,14 @@ circle.textWrap = { offset: 10 };</code></pre>
|
|
|
1378
1463
|
<div class="button run">Run</div>
|
|
1379
1464
|
</div>
|
|
1380
1465
|
|
|
1381
|
-
<script type="text/paperscript" canvas="canvas-
|
|
1466
|
+
<script type="text/paperscript" canvas="canvas-22">
|
|
1382
1467
|
var path = new Path.Circle({
|
|
1383
1468
|
center: [80, 50],
|
|
1384
1469
|
radius: 35
|
|
1385
1470
|
});
|
|
1386
1471
|
path.selected = true; // Select the path
|
|
1387
1472
|
</script>
|
|
1388
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
1473
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-22"></canvas></div>
|
|
1389
1474
|
</div>
|
|
1390
1475
|
|
|
1391
1476
|
|
|
@@ -1542,7 +1627,7 @@ console.log(path.data.pets.length); // 1</code></pre>
|
|
|
1542
1627
|
<div class="button run">Run</div>
|
|
1543
1628
|
</div>
|
|
1544
1629
|
|
|
1545
|
-
<script type="text/paperscript" canvas="canvas-
|
|
1630
|
+
<script type="text/paperscript" canvas="canvas-23">
|
|
1546
1631
|
// Create a circle at position { x: 10, y: 10 }
|
|
1547
1632
|
var circle = new Path.Circle({
|
|
1548
1633
|
center: new Point(10, 10),
|
|
@@ -1556,7 +1641,7 @@ circle.position = new Point(20, 20);
|
|
|
1556
1641
|
// Move the circle 100 points to the right and 50 points down
|
|
1557
1642
|
circle.position += new Point(100, 50);
|
|
1558
1643
|
</script>
|
|
1559
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
1644
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-23"></canvas></div>
|
|
1560
1645
|
</div>
|
|
1561
1646
|
|
|
1562
1647
|
|
|
@@ -1568,7 +1653,7 @@ circle.position += new Point(100, 50);
|
|
|
1568
1653
|
<div class="button run">Run</div>
|
|
1569
1654
|
</div>
|
|
1570
1655
|
|
|
1571
|
-
<script type="text/paperscript" canvas="canvas-
|
|
1656
|
+
<script type="text/paperscript" canvas="canvas-24">
|
|
1572
1657
|
// Create a circle at position { x: 20, y: 20 }
|
|
1573
1658
|
var circle = new Path.Circle({
|
|
1574
1659
|
center: new Point(20, 20),
|
|
@@ -1579,7 +1664,7 @@ var circle = new Path.Circle({
|
|
|
1579
1664
|
// Move the circle 100 points to the right
|
|
1580
1665
|
circle.position.x += 100;
|
|
1581
1666
|
</script>
|
|
1582
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
1667
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-24"></canvas></div>
|
|
1583
1668
|
</div>
|
|
1584
1669
|
|
|
1585
1670
|
|
|
@@ -2105,7 +2190,7 @@ console.log(group.children[0] == path); // true</code></pre>
|
|
|
2105
2190
|
<div class="button run">Run</div>
|
|
2106
2191
|
</div>
|
|
2107
2192
|
|
|
2108
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2193
|
+
<script type="text/paperscript" canvas="canvas-25">
|
|
2109
2194
|
var path = new Path.Circle({
|
|
2110
2195
|
center: [80, 50],
|
|
2111
2196
|
radius: 35
|
|
@@ -2118,7 +2203,7 @@ group.addChild(path);
|
|
|
2118
2203
|
// Access the path through the group's children array:
|
|
2119
2204
|
group.children[0].fillColor = 'red';
|
|
2120
2205
|
</script>
|
|
2121
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2206
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-25"></canvas></div>
|
|
2122
2207
|
</div>
|
|
2123
2208
|
|
|
2124
2209
|
|
|
@@ -2130,7 +2215,7 @@ group.children[0].fillColor = 'red';
|
|
|
2130
2215
|
<div class="button run">Run</div>
|
|
2131
2216
|
</div>
|
|
2132
2217
|
|
|
2133
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2218
|
+
<script type="text/paperscript" canvas="canvas-26">
|
|
2134
2219
|
var path = new Path.Circle({
|
|
2135
2220
|
center: [80, 50],
|
|
2136
2221
|
radius: 35
|
|
@@ -2145,7 +2230,7 @@ group.addChild(path);
|
|
|
2145
2230
|
// The path can be accessed by name:
|
|
2146
2231
|
group.children['example'].fillColor = 'orange';
|
|
2147
2232
|
</script>
|
|
2148
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2233
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-26"></canvas></div>
|
|
2149
2234
|
</div>
|
|
2150
2235
|
|
|
2151
2236
|
|
|
@@ -2157,7 +2242,7 @@ group.children['example'].fillColor = 'orange';
|
|
|
2157
2242
|
<div class="button run">Run</div>
|
|
2158
2243
|
</div>
|
|
2159
2244
|
|
|
2160
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2245
|
+
<script type="text/paperscript" canvas="canvas-27">
|
|
2161
2246
|
var path = new Path.Circle({
|
|
2162
2247
|
center: [80, 50],
|
|
2163
2248
|
radius: 35
|
|
@@ -2169,7 +2254,7 @@ group.children = [path];
|
|
|
2169
2254
|
// The path is the first child of the group:
|
|
2170
2255
|
group.firstChild.fillColor = 'green';
|
|
2171
2256
|
</script>
|
|
2172
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2257
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-27"></canvas></div>
|
|
2173
2258
|
</div>
|
|
2174
2259
|
|
|
2175
2260
|
|
|
@@ -2346,7 +2431,7 @@ group.firstChild.fillColor = 'green';
|
|
|
2346
2431
|
<div class="button run">Run</div>
|
|
2347
2432
|
</div>
|
|
2348
2433
|
|
|
2349
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2434
|
+
<script type="text/paperscript" canvas="canvas-28">
|
|
2350
2435
|
// Create a circle shaped path at { x: 80, y: 50 }
|
|
2351
2436
|
// with a radius of 35:
|
|
2352
2437
|
var circle = new Path.Circle({
|
|
@@ -2357,7 +2442,7 @@ var circle = new Path.Circle({
|
|
|
2357
2442
|
// Set its stroke color to RGB red:
|
|
2358
2443
|
circle.strokeColor = new Color(1, 0, 0);
|
|
2359
2444
|
</script>
|
|
2360
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2445
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-28"></canvas></div>
|
|
2361
2446
|
</div>
|
|
2362
2447
|
|
|
2363
2448
|
|
|
@@ -2394,7 +2479,7 @@ circle.strokeColor = new Color(1, 0, 0);
|
|
|
2394
2479
|
<div class="button run">Run</div>
|
|
2395
2480
|
</div>
|
|
2396
2481
|
|
|
2397
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2482
|
+
<script type="text/paperscript" canvas="canvas-29">
|
|
2398
2483
|
// Create a circle shaped path at { x: 80, y: 50 }
|
|
2399
2484
|
// with a radius of 35:
|
|
2400
2485
|
var circle = new Path.Circle({
|
|
@@ -2406,7 +2491,7 @@ var circle = new Path.Circle({
|
|
|
2406
2491
|
// Set its stroke width to 10:
|
|
2407
2492
|
circle.strokeWidth = 10;
|
|
2408
2493
|
</script>
|
|
2409
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2494
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-29"></canvas></div>
|
|
2410
2495
|
</div>
|
|
2411
2496
|
|
|
2412
2497
|
|
|
@@ -2453,7 +2538,7 @@ circle.strokeWidth = 10;
|
|
|
2453
2538
|
<div class="button run">Run</div>
|
|
2454
2539
|
</div>
|
|
2455
2540
|
|
|
2456
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2541
|
+
<script type="text/paperscript" canvas="canvas-30">
|
|
2457
2542
|
var line = new Path({
|
|
2458
2543
|
segments: [[80, 50], [420, 50]],
|
|
2459
2544
|
strokeColor: 'black',
|
|
@@ -2474,7 +2559,7 @@ var line2 = line.clone();
|
|
|
2474
2559
|
line2.position.y += 100;
|
|
2475
2560
|
line2.strokeCap = 'butt';
|
|
2476
2561
|
</script>
|
|
2477
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
2562
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-30"></canvas></div>
|
|
2478
2563
|
</div>
|
|
2479
2564
|
|
|
2480
2565
|
|
|
@@ -2521,7 +2606,7 @@ line2.strokeCap = 'butt';
|
|
|
2521
2606
|
<div class="button run">Run</div>
|
|
2522
2607
|
</div>
|
|
2523
2608
|
|
|
2524
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2609
|
+
<script type="text/paperscript" canvas="canvas-31">
|
|
2525
2610
|
var path = new Path({
|
|
2526
2611
|
segments: [[80, 100], [120, 40], [160, 100]],
|
|
2527
2612
|
strokeColor: 'black',
|
|
@@ -2538,7 +2623,7 @@ var path3 = path2.clone();
|
|
|
2538
2623
|
path3.position.x += path3.bounds.width * 1.5;
|
|
2539
2624
|
path3.strokeJoin = 'bevel';
|
|
2540
2625
|
</script>
|
|
2541
|
-
<div class="canvas"><canvas width="516" height="120" id="canvas-
|
|
2626
|
+
<div class="canvas"><canvas width="516" height="120" id="canvas-31"></canvas></div>
|
|
2542
2627
|
</div>
|
|
2543
2628
|
|
|
2544
2629
|
|
|
@@ -2642,7 +2727,7 @@ path3.strokeJoin = 'bevel';
|
|
|
2642
2727
|
<div class="button run">Run</div>
|
|
2643
2728
|
</div>
|
|
2644
2729
|
|
|
2645
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2730
|
+
<script type="text/paperscript" canvas="canvas-32">
|
|
2646
2731
|
var path = new Path.Circle({
|
|
2647
2732
|
center: [80, 50],
|
|
2648
2733
|
radius: 40,
|
|
@@ -2653,7 +2738,7 @@ var path = new Path.Circle({
|
|
|
2653
2738
|
// Set the dashed stroke to [10pt dash, 4pt gap]:
|
|
2654
2739
|
path.dashArray = [10, 4];
|
|
2655
2740
|
</script>
|
|
2656
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2741
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-32"></canvas></div>
|
|
2657
2742
|
</div>
|
|
2658
2743
|
|
|
2659
2744
|
|
|
@@ -2759,7 +2844,7 @@ path.dashArray = [10, 4];
|
|
|
2759
2844
|
<div class="button run">Run</div>
|
|
2760
2845
|
</div>
|
|
2761
2846
|
|
|
2762
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2847
|
+
<script type="text/paperscript" canvas="canvas-33">
|
|
2763
2848
|
// Create a circle shaped path at { x: 80, y: 50 }
|
|
2764
2849
|
// with a radius of 35:
|
|
2765
2850
|
var circle = new Path.Circle({
|
|
@@ -2770,7 +2855,7 @@ var circle = new Path.Circle({
|
|
|
2770
2855
|
// Set the fill color of the circle to RGB red:
|
|
2771
2856
|
circle.fillColor = new Color(1, 0, 0);
|
|
2772
2857
|
</script>
|
|
2773
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2858
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-33"></canvas></div>
|
|
2774
2859
|
</div>
|
|
2775
2860
|
|
|
2776
2861
|
|
|
@@ -2845,7 +2930,7 @@ circle.fillColor = new Color(1, 0, 0);
|
|
|
2845
2930
|
<div class="button run">Run</div>
|
|
2846
2931
|
</div>
|
|
2847
2932
|
|
|
2848
|
-
<script type="text/paperscript" canvas="canvas-
|
|
2933
|
+
<script type="text/paperscript" canvas="canvas-34">
|
|
2849
2934
|
var circle = new Path.Circle({
|
|
2850
2935
|
center: [80, 50],
|
|
2851
2936
|
radius: 35,
|
|
@@ -2858,7 +2943,7 @@ var circle = new Path.Circle({
|
|
|
2858
2943
|
shadowOffset: new Point(5, 5)
|
|
2859
2944
|
});
|
|
2860
2945
|
</script>
|
|
2861
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
2946
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-34"></canvas></div>
|
|
2862
2947
|
</div>
|
|
2863
2948
|
|
|
2864
2949
|
|
|
@@ -2999,7 +3084,7 @@ var circle = new Path.Circle({
|
|
|
2999
3084
|
<div class="button run">Run</div>
|
|
3000
3085
|
</div>
|
|
3001
3086
|
|
|
3002
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3087
|
+
<script type="text/paperscript" canvas="canvas-35">
|
|
3003
3088
|
// Create a rectangle shaped path with its top left point at:
|
|
3004
3089
|
// {x: 50, y: 25} and a size of {width: 50, height: 50}
|
|
3005
3090
|
var path = new Path.Rectangle(new Point(50, 25), new Size(50, 50));
|
|
@@ -3010,7 +3095,7 @@ path.onFrame = function(event) {
|
|
|
3010
3095
|
this.rotate(3);
|
|
3011
3096
|
}
|
|
3012
3097
|
</script>
|
|
3013
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
3098
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-35"></canvas></div>
|
|
3014
3099
|
</div>
|
|
3015
3100
|
|
|
3016
3101
|
|
|
@@ -3054,7 +3139,7 @@ path.onFrame = function(event) {
|
|
|
3054
3139
|
<div class="button run">Run</div>
|
|
3055
3140
|
</div>
|
|
3056
3141
|
|
|
3057
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3142
|
+
<script type="text/paperscript" canvas="canvas-36">
|
|
3058
3143
|
// Create a circle shaped path at the center of the view:
|
|
3059
3144
|
var path = new Path.Circle({
|
|
3060
3145
|
center: view.center,
|
|
@@ -3068,7 +3153,7 @@ path.onMouseDown = function(event) {
|
|
|
3068
3153
|
this.fillColor = 'red';
|
|
3069
3154
|
}
|
|
3070
3155
|
</script>
|
|
3071
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
3156
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-36"></canvas></div>
|
|
3072
3157
|
</div>
|
|
3073
3158
|
|
|
3074
3159
|
|
|
@@ -3080,7 +3165,7 @@ path.onMouseDown = function(event) {
|
|
|
3080
3165
|
<div class="button run">Run</div>
|
|
3081
3166
|
</div>
|
|
3082
3167
|
|
|
3083
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3168
|
+
<script type="text/paperscript" canvas="canvas-37">
|
|
3084
3169
|
// Loop 30 times:
|
|
3085
3170
|
for (var i = 0; i < 30; i++) {
|
|
3086
3171
|
// Create a circle shaped path at a random position
|
|
@@ -3098,7 +3183,7 @@ for (var i = 0; i < 30; i++) {
|
|
|
3098
3183
|
}
|
|
3099
3184
|
}
|
|
3100
3185
|
</script>
|
|
3101
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
3186
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-37"></canvas></div>
|
|
3102
3187
|
</div>
|
|
3103
3188
|
|
|
3104
3189
|
|
|
@@ -3142,7 +3227,7 @@ for (var i = 0; i < 30; i++) {
|
|
|
3142
3227
|
<div class="button run">Run</div>
|
|
3143
3228
|
</div>
|
|
3144
3229
|
|
|
3145
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3230
|
+
<script type="text/paperscript" canvas="canvas-38">
|
|
3146
3231
|
// Create a circle shaped path at the center of the view:
|
|
3147
3232
|
var path = new Path.Circle({
|
|
3148
3233
|
center: view.center,
|
|
@@ -3155,7 +3240,7 @@ path.onMouseDrag = function(event) {
|
|
|
3155
3240
|
path.position += event.delta;
|
|
3156
3241
|
}
|
|
3157
3242
|
</script>
|
|
3158
|
-
<div class="canvas"><canvas width="516" height="240" id="canvas-
|
|
3243
|
+
<div class="canvas"><canvas width="516" height="240" id="canvas-38"></canvas></div>
|
|
3159
3244
|
</div>
|
|
3160
3245
|
|
|
3161
3246
|
|
|
@@ -3199,7 +3284,7 @@ path.onMouseDrag = function(event) {
|
|
|
3199
3284
|
<div class="button run">Run</div>
|
|
3200
3285
|
</div>
|
|
3201
3286
|
|
|
3202
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3287
|
+
<script type="text/paperscript" canvas="canvas-39">
|
|
3203
3288
|
// Create a circle shaped path at the center of the view:
|
|
3204
3289
|
var path = new Path.Circle({
|
|
3205
3290
|
center: view.center,
|
|
@@ -3213,7 +3298,7 @@ path.onMouseUp = function(event) {
|
|
|
3213
3298
|
this.fillColor = 'red';
|
|
3214
3299
|
}
|
|
3215
3300
|
</script>
|
|
3216
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
3301
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-39"></canvas></div>
|
|
3217
3302
|
</div>
|
|
3218
3303
|
|
|
3219
3304
|
|
|
@@ -3257,7 +3342,7 @@ path.onMouseUp = function(event) {
|
|
|
3257
3342
|
<div class="button run">Run</div>
|
|
3258
3343
|
</div>
|
|
3259
3344
|
|
|
3260
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3345
|
+
<script type="text/paperscript" canvas="canvas-40">
|
|
3261
3346
|
// Create a circle shaped path at the center of the view:
|
|
3262
3347
|
var path = new Path.Circle({
|
|
3263
3348
|
center: view.center,
|
|
@@ -3271,7 +3356,7 @@ path.onClick = function(event) {
|
|
|
3271
3356
|
this.fillColor = 'red';
|
|
3272
3357
|
}
|
|
3273
3358
|
</script>
|
|
3274
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
3359
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-40"></canvas></div>
|
|
3275
3360
|
</div>
|
|
3276
3361
|
|
|
3277
3362
|
|
|
@@ -3283,7 +3368,7 @@ path.onClick = function(event) {
|
|
|
3283
3368
|
<div class="button run">Run</div>
|
|
3284
3369
|
</div>
|
|
3285
3370
|
|
|
3286
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3371
|
+
<script type="text/paperscript" canvas="canvas-41">
|
|
3287
3372
|
// Loop 30 times:
|
|
3288
3373
|
for (var i = 0; i < 30; i++) {
|
|
3289
3374
|
// Create a circle shaped path at a random position
|
|
@@ -3301,7 +3386,7 @@ for (var i = 0; i < 30; i++) {
|
|
|
3301
3386
|
}
|
|
3302
3387
|
}
|
|
3303
3388
|
</script>
|
|
3304
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
3389
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-41"></canvas></div>
|
|
3305
3390
|
</div>
|
|
3306
3391
|
|
|
3307
3392
|
|
|
@@ -3345,7 +3430,7 @@ for (var i = 0; i < 30; i++) {
|
|
|
3345
3430
|
<div class="button run">Run</div>
|
|
3346
3431
|
</div>
|
|
3347
3432
|
|
|
3348
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3433
|
+
<script type="text/paperscript" canvas="canvas-42">
|
|
3349
3434
|
// Create a circle shaped path at the center of the view:
|
|
3350
3435
|
var path = new Path.Circle({
|
|
3351
3436
|
center: view.center,
|
|
@@ -3359,7 +3444,7 @@ path.onDoubleClick = function(event) {
|
|
|
3359
3444
|
this.fillColor = 'red';
|
|
3360
3445
|
}
|
|
3361
3446
|
</script>
|
|
3362
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
3447
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-42"></canvas></div>
|
|
3363
3448
|
</div>
|
|
3364
3449
|
|
|
3365
3450
|
|
|
@@ -3371,7 +3456,7 @@ path.onDoubleClick = function(event) {
|
|
|
3371
3456
|
<div class="button run">Run</div>
|
|
3372
3457
|
</div>
|
|
3373
3458
|
|
|
3374
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3459
|
+
<script type="text/paperscript" canvas="canvas-43">
|
|
3375
3460
|
// Loop 30 times:
|
|
3376
3461
|
for (var i = 0; i < 30; i++) {
|
|
3377
3462
|
// Create a circle shaped path at a random position
|
|
@@ -3389,7 +3474,7 @@ for (var i = 0; i < 30; i++) {
|
|
|
3389
3474
|
}
|
|
3390
3475
|
}
|
|
3391
3476
|
</script>
|
|
3392
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
3477
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-43"></canvas></div>
|
|
3393
3478
|
</div>
|
|
3394
3479
|
|
|
3395
3480
|
|
|
@@ -3433,7 +3518,7 @@ for (var i = 0; i < 30; i++) {
|
|
|
3433
3518
|
<div class="button run">Run</div>
|
|
3434
3519
|
</div>
|
|
3435
3520
|
|
|
3436
|
-
<script type="text/paperscript" canvas="canvas-
|
|
3521
|
+
<script type="text/paperscript" canvas="canvas-44">
|
|
3437
3522
|
// Create a circle shaped path at the center of the view:
|
|
3438
3523
|
var path = new Path.Circle({
|
|
3439
3524
|
center: view.center,
|
|
@@ -3441,180 +3526,567 @@ for (var i = 0; i < 30; i++) {
|
|
|
3441
3526
|
fillColor: 'black'
|
|
3442
3527
|
});
|
|
3443
3528
|
|
|
3444
|
-
// When the mouse moves on top of the item, set its opacity
|
|
3445
|
-
// to a random value between 0 and 1:
|
|
3446
|
-
path.onMouseMove = function(event) {
|
|
3447
|
-
this.opacity = Math.random();
|
|
3448
|
-
}
|
|
3449
|
-
</script>
|
|
3450
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
3451
|
-
</div>
|
|
3529
|
+
// When the mouse moves on top of the item, set its opacity
|
|
3530
|
+
// to a random value between 0 and 1:
|
|
3531
|
+
path.onMouseMove = function(event) {
|
|
3532
|
+
this.opacity = Math.random();
|
|
3533
|
+
}
|
|
3534
|
+
</script>
|
|
3535
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-44"></canvas></div>
|
|
3536
|
+
</div>
|
|
3537
|
+
|
|
3538
|
+
|
|
3539
|
+
</div>
|
|
3540
|
+
|
|
3541
|
+
</div>
|
|
3542
|
+
</div>
|
|
3543
|
+
|
|
3544
|
+
|
|
3545
|
+
<div id="onmouseenter" class="member">
|
|
3546
|
+
<div class="member-link">
|
|
3547
|
+
<a name="onmouseenter" href="#onmouseenter"><tt><b>onMouseEnter</b></tt></a>
|
|
3548
|
+
</div>
|
|
3549
|
+
<div class="member-description hidden">
|
|
3550
|
+
|
|
3551
|
+
<div class="member-text">
|
|
3552
|
+
<p>The function to be called when the mouse moves over the item. This function will only be called again, once the mouse moved outside of the item first. The function receives a <a href="../classes/MouseEvent.html"><tt>MouseEvent</tt></a> object which contains information about the mouse event. Note that such mouse events bubble up the scene graph hierarchy and will reach the view, unless they are stopped with <a href="../classes/Event.html#stoppropagation"><tt>event.stopPropagation</tt></a>() or by returning <code>false</code> from the handler.</p>
|
|
3553
|
+
|
|
3554
|
+
|
|
3555
|
+
|
|
3556
|
+
<ul class="member-list">
|
|
3557
|
+
<h4>Type:</h4>
|
|
3558
|
+
<li>
|
|
3559
|
+
<tt>Function</tt>⟋<tt>null</tt>
|
|
3560
|
+
</li>
|
|
3561
|
+
</ul>
|
|
3562
|
+
|
|
3563
|
+
|
|
3564
|
+
<ul class="member-list">
|
|
3565
|
+
<h4>See also:</h4>
|
|
3566
|
+
|
|
3567
|
+
<li><tt><a href="../classes/View.html#onmouseenter"><tt>view.onMouseEnter</tt></a></tt></li>
|
|
3568
|
+
|
|
3569
|
+
</ul>
|
|
3570
|
+
|
|
3571
|
+
<h4>Example:<span class="description">When you move the mouse over the item, its fill color is set to red. When you move the mouse outside again, its fill color is set back to black.</span></h4>
|
|
3572
|
+
|
|
3573
|
+
<div class="paperscript split">
|
|
3574
|
+
|
|
3575
|
+
<div class="buttons">
|
|
3576
|
+
<div class="button run">Run</div>
|
|
3577
|
+
</div>
|
|
3578
|
+
|
|
3579
|
+
<script type="text/paperscript" canvas="canvas-45">
|
|
3580
|
+
// Create a circle shaped path at the center of the view:
|
|
3581
|
+
var path = new Path.Circle({
|
|
3582
|
+
center: view.center,
|
|
3583
|
+
radius: 25,
|
|
3584
|
+
fillColor: 'black'
|
|
3585
|
+
});
|
|
3586
|
+
|
|
3587
|
+
// When the mouse enters the item, set its fill color to red:
|
|
3588
|
+
path.onMouseEnter = function(event) {
|
|
3589
|
+
this.fillColor = 'red';
|
|
3590
|
+
}
|
|
3591
|
+
|
|
3592
|
+
// When the mouse leaves the item, set its fill color to black:
|
|
3593
|
+
path.onMouseLeave = function(event) {
|
|
3594
|
+
this.fillColor = 'black';
|
|
3595
|
+
}
|
|
3596
|
+
</script>
|
|
3597
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-45"></canvas></div>
|
|
3598
|
+
</div>
|
|
3599
|
+
|
|
3600
|
+
|
|
3601
|
+
<h4>Example:<span class="description">When you click the mouse, you create new circle shaped items. When you move the mouse over the item, its fill color is set to red. When you move the mouse outside again, its fill color is set back to black.</span></h4>
|
|
3602
|
+
|
|
3603
|
+
<div class="paperscript split">
|
|
3604
|
+
|
|
3605
|
+
<div class="buttons">
|
|
3606
|
+
<div class="button run">Run</div>
|
|
3607
|
+
</div>
|
|
3608
|
+
|
|
3609
|
+
<script type="text/paperscript" canvas="canvas-46">
|
|
3610
|
+
function enter(event) {
|
|
3611
|
+
this.fillColor = 'red';
|
|
3612
|
+
}
|
|
3613
|
+
|
|
3614
|
+
function leave(event) {
|
|
3615
|
+
this.fillColor = 'black';
|
|
3616
|
+
}
|
|
3617
|
+
|
|
3618
|
+
// When the mouse is pressed:
|
|
3619
|
+
function onMouseDown(event) {
|
|
3620
|
+
// Create a circle shaped path at the position of the mouse:
|
|
3621
|
+
var path = new Path.Circle(event.point, 25);
|
|
3622
|
+
path.fillColor = 'black';
|
|
3623
|
+
|
|
3624
|
+
// When the mouse enters the item, set its fill color to red:
|
|
3625
|
+
path.onMouseEnter = enter;
|
|
3626
|
+
|
|
3627
|
+
// When the mouse leaves the item, set its fill color to black:
|
|
3628
|
+
path.onMouseLeave = leave;
|
|
3629
|
+
}
|
|
3630
|
+
</script>
|
|
3631
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-46"></canvas></div>
|
|
3632
|
+
</div>
|
|
3633
|
+
|
|
3634
|
+
|
|
3635
|
+
</div>
|
|
3636
|
+
|
|
3637
|
+
</div>
|
|
3638
|
+
</div>
|
|
3639
|
+
|
|
3640
|
+
|
|
3641
|
+
<div id="onmouseleave" class="member">
|
|
3642
|
+
<div class="member-link">
|
|
3643
|
+
<a name="onmouseleave" href="#onmouseleave"><tt><b>onMouseLeave</b></tt></a>
|
|
3644
|
+
</div>
|
|
3645
|
+
<div class="member-description hidden">
|
|
3646
|
+
|
|
3647
|
+
<div class="member-text">
|
|
3648
|
+
<p>The function to be called when the mouse moves out of the item. The function receives a <a href="../classes/MouseEvent.html"><tt>MouseEvent</tt></a> object which contains information about the mouse event. Note that such mouse events bubble up the scene graph hierarchy and will reach the view, unless they are stopped with <a href="../classes/Event.html#stoppropagation"><tt>event.stopPropagation</tt></a>() or by returning <code>false</code> from the handler.</p>
|
|
3649
|
+
|
|
3650
|
+
|
|
3651
|
+
|
|
3652
|
+
<ul class="member-list">
|
|
3653
|
+
<h4>Type:</h4>
|
|
3654
|
+
<li>
|
|
3655
|
+
<tt>Function</tt>⟋<tt>null</tt>
|
|
3656
|
+
</li>
|
|
3657
|
+
</ul>
|
|
3658
|
+
|
|
3659
|
+
|
|
3660
|
+
<ul class="member-list">
|
|
3661
|
+
<h4>See also:</h4>
|
|
3662
|
+
|
|
3663
|
+
<li><tt><a href="../classes/View.html#onmouseleave"><tt>view.onMouseLeave</tt></a></tt></li>
|
|
3664
|
+
|
|
3665
|
+
</ul>
|
|
3666
|
+
|
|
3667
|
+
<h4>Example:<span class="description">Move the mouse over the circle shaped path and then move it out of it again to set its fill color to red:</span></h4>
|
|
3668
|
+
|
|
3669
|
+
<div class="paperscript split">
|
|
3670
|
+
|
|
3671
|
+
<div class="buttons">
|
|
3672
|
+
<div class="button run">Run</div>
|
|
3673
|
+
</div>
|
|
3674
|
+
|
|
3675
|
+
<script type="text/paperscript" canvas="canvas-47">
|
|
3676
|
+
// Create a circle shaped path at the center of the view:
|
|
3677
|
+
var path = new Path.Circle({
|
|
3678
|
+
center: view.center,
|
|
3679
|
+
radius: 25,
|
|
3680
|
+
fillColor: 'black'
|
|
3681
|
+
});
|
|
3682
|
+
|
|
3683
|
+
// When the mouse leaves the item, set its fill color to red:
|
|
3684
|
+
path.onMouseLeave = function(event) {
|
|
3685
|
+
this.fillColor = 'red';
|
|
3686
|
+
}
|
|
3687
|
+
</script>
|
|
3688
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-47"></canvas></div>
|
|
3689
|
+
</div>
|
|
3690
|
+
|
|
3691
|
+
|
|
3692
|
+
</div>
|
|
3693
|
+
|
|
3694
|
+
</div>
|
|
3695
|
+
</div>
|
|
3696
|
+
|
|
3697
|
+
|
|
3698
|
+
<div id="ondraw" class="member">
|
|
3699
|
+
<div class="member-link">
|
|
3700
|
+
<a name="ondraw" href="#ondraw"><tt><b>onDraw</b></tt></a>
|
|
3701
|
+
</div>
|
|
3702
|
+
<div class="member-description hidden">
|
|
3703
|
+
|
|
3704
|
+
<div class="member-text">
|
|
3705
|
+
<p>The function to be called whenever the item is drawn: in views, in <a href="../classes/Item.html#rasterize"><tt>rasterize</tt></a>(), and once for each placement of a symbol whose definition contains it. It is called right before the item’s default drawing, and draws with the canvas API beneath it, or replaces it by returning <code>false</code> or calling <code>event.preventDefault()</code>. The function receives a <a href="../classes/DrawEvent.html"><tt>DrawEvent</tt></a> object with these fields:</p>
|
|
3706
|
+
|
|
3707
|
+
|
|
3708
|
+
|
|
3709
|
+
<ul class="member-list">
|
|
3710
|
+
<h4>Type:</h4>
|
|
3711
|
+
<li>
|
|
3712
|
+
<tt>Function</tt>⟋<tt>null</tt>
|
|
3713
|
+
</li>
|
|
3714
|
+
</ul>
|
|
3715
|
+
<ul class="member-list">
|
|
3716
|
+
<h4>Options:</h4>
|
|
3717
|
+
<li><tt>event.item: <a href="../classes/Item.html"><tt>Item</tt></a></tt> — the item that is drawn</li>
|
|
3718
|
+
<li><tt>event.context: <tt>CanvasRenderingContext2D</tt></tt> — the canvas context, transformed into the item’s coordinates</li>
|
|
3719
|
+
<li><tt>event.matrix: <a href="../classes/Matrix.html"><tt>Matrix</tt></a></tt> — the matrix from the item’s coordinates to the pixels of the view, without its pixel ratio, for drawing things at a size in pixels</li>
|
|
3720
|
+
<li><tt>event.pixelRatio: <tt>Number</tt></tt> — the device pixels per pixel: the view’s pixel ratio, or the resolution divided by 72 in <a href="../classes/Item.html#rasterize"><tt>rasterize</tt></a>()</li>
|
|
3721
|
+
<li><tt>event.view: <a href="../classes/View.html"><tt>View</tt></a></tt> — the view drawn into, or <code>null</code> in <a href="../classes/Item.html#rasterize"><tt>rasterize</tt></a>()
|
|
3722
|
+
What the handler draws isn’t part of the item’s hit testing, its bounds or its SVG export. In buffered groups, it is only called when the group draws its buffer again, see <a href="../classes/Group.html#buffered"><tt>group.buffered</tt></a>.</li>
|
|
3723
|
+
</ul>
|
|
3724
|
+
|
|
3725
|
+
<h4>Example:<span class="description">Draw a hairline cross through the center of a circle, beneath it:</span></h4>
|
|
3726
|
+
|
|
3727
|
+
<div class="paperscript split">
|
|
3728
|
+
|
|
3729
|
+
<div class="buttons">
|
|
3730
|
+
<div class="button run">Run</div>
|
|
3731
|
+
</div>
|
|
3732
|
+
|
|
3733
|
+
<script type="text/paperscript" canvas="canvas-48">
|
|
3734
|
+
var path = new Path.Circle({
|
|
3735
|
+
center: view.center,
|
|
3736
|
+
radius: 25,
|
|
3737
|
+
fillColor: 'rgba(255, 0, 0, 0.5)'
|
|
3738
|
+
});
|
|
3739
|
+
|
|
3740
|
+
path.onDraw = function(event) {
|
|
3741
|
+
var ctx = event.context,
|
|
3742
|
+
center = this.position,
|
|
3743
|
+
scale = event.matrix.scaling.x;
|
|
3744
|
+
ctx.beginPath();
|
|
3745
|
+
ctx.moveTo(center.x - 40, center.y);
|
|
3746
|
+
ctx.lineTo(center.x + 40, center.y);
|
|
3747
|
+
ctx.moveTo(center.x, center.y - 40);
|
|
3748
|
+
ctx.lineTo(center.x, center.y + 40);
|
|
3749
|
+
ctx.lineWidth = 1 / scale;
|
|
3750
|
+
ctx.stroke();
|
|
3751
|
+
}
|
|
3752
|
+
</script>
|
|
3753
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-48"></canvas></div>
|
|
3754
|
+
</div>
|
|
3755
|
+
|
|
3756
|
+
|
|
3757
|
+
</div>
|
|
3758
|
+
|
|
3759
|
+
</div>
|
|
3760
|
+
</div>
|
|
3761
|
+
|
|
3762
|
+
|
|
3763
|
+
<div id="ondrawselection" class="member">
|
|
3764
|
+
<div class="member-link">
|
|
3765
|
+
<a name="ondrawselection" href="#ondrawselection"><tt><b>onDrawSelection</b></tt></a>
|
|
3766
|
+
</div>
|
|
3767
|
+
<div class="member-description hidden">
|
|
3768
|
+
|
|
3769
|
+
<div class="member-text">
|
|
3770
|
+
<p>The function to be called when the selection of the selected item is drawn, over all the content. It is called right before the item’s default selection drawing, and draws with the canvas API beneath it, or replaces it by returning <code>false</code> or calling <code>event.preventDefault()</code>. The function receives a <a href="../classes/DrawEvent.html"><tt>DrawEvent</tt></a> object with these fields:</p>
|
|
3771
|
+
|
|
3772
|
+
|
|
3773
|
+
|
|
3774
|
+
<ul class="member-list">
|
|
3775
|
+
<h4>Type:</h4>
|
|
3776
|
+
<li>
|
|
3777
|
+
<tt>Function</tt>⟋<tt>null</tt>
|
|
3778
|
+
</li>
|
|
3779
|
+
</ul>
|
|
3780
|
+
<ul class="member-list">
|
|
3781
|
+
<h4>Options:</h4>
|
|
3782
|
+
<li><tt>event.item: <a href="../classes/Item.html"><tt>Item</tt></a></tt> — the selected item</li>
|
|
3783
|
+
<li><tt>event.context: <tt>CanvasRenderingContext2D</tt></tt> — the canvas context, in the pixels of the view, with the selection color as its <code>strokeStyle</code> and <code>fillStyle</code>, and a <code>lineWidth</code> of 1</li>
|
|
3784
|
+
<li><tt>event.matrix: <a href="../classes/Matrix.html"><tt>Matrix</tt></a></tt> — the matrix from the item’s coordinates to the pixels of the view</li>
|
|
3785
|
+
<li><tt>event.size: <tt>Number</tt></tt> — the size of the handles, see <a href="../classes/PaperScope.html#settings"><tt>paperScope.settings</tt></a></li>
|
|
3786
|
+
<li><tt>event.color: <a href="../classes/Color.html"><tt>Color</tt></a></tt> — the selection color, see <a href="../classes/Item.html#selectedcolor"><tt>selectedColor</tt></a></li>
|
|
3787
|
+
<li><tt>event.view: <a href="../classes/View.html"><tt>View</tt></a></tt> — the view drawn into
|
|
3788
|
+
What the handler draws isn’t part of the item’s hit testing, its bounds or its SVG export.</li>
|
|
3789
|
+
</ul>
|
|
3790
|
+
|
|
3791
|
+
<h4>Example:<span class="description">Draw the selection of a path as a dot at each segment:</span></h4>
|
|
3792
|
+
|
|
3793
|
+
<div class="paperscript split">
|
|
3794
|
+
|
|
3795
|
+
<div class="buttons">
|
|
3796
|
+
<div class="button run">Run</div>
|
|
3797
|
+
</div>
|
|
3798
|
+
|
|
3799
|
+
<script type="text/paperscript" canvas="canvas-49">
|
|
3800
|
+
var path = new Path.Star({
|
|
3801
|
+
center: view.center,
|
|
3802
|
+
points: 5,
|
|
3803
|
+
radius1: 20,
|
|
3804
|
+
radius2: 40,
|
|
3805
|
+
strokeColor: 'black',
|
|
3806
|
+
selected: true
|
|
3807
|
+
});
|
|
3808
|
+
|
|
3809
|
+
path.onDrawSelection = function(event) {
|
|
3810
|
+
var ctx = event.context;
|
|
3811
|
+
this.segments.forEach(function(segment) {
|
|
3812
|
+
var point = event.matrix.transform(segment.point);
|
|
3813
|
+
ctx.beginPath();
|
|
3814
|
+
ctx.arc(point.x, point.y, event.size, 0, Math.PI * 2);
|
|
3815
|
+
ctx.fill();
|
|
3816
|
+
});
|
|
3817
|
+
return false;
|
|
3818
|
+
}
|
|
3819
|
+
</script>
|
|
3820
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-49"></canvas></div>
|
|
3821
|
+
</div>
|
|
3822
|
+
|
|
3823
|
+
|
|
3824
|
+
</div>
|
|
3825
|
+
|
|
3826
|
+
</div>
|
|
3827
|
+
</div>
|
|
3828
|
+
|
|
3829
|
+
</div>
|
|
3830
|
+
|
|
3831
|
+
|
|
3832
|
+
<!-- =========================== inherited methods ========================= -->
|
|
3833
|
+
<div class="reference-members"><h2>Methods inherited from <a href="../classes/Item.html"><tt>Item</tt></a></h2>
|
|
3834
|
+
|
|
3835
|
+
|
|
3836
|
+
<div id="addeffect-effect" class="member">
|
|
3837
|
+
<div class="member-link">
|
|
3838
|
+
<a name="addeffect-effect" href="#addeffect-effect"><tt><b>addEffect</b>(effect)</tt></a>
|
|
3839
|
+
</div>
|
|
3840
|
+
<div class="member-description hidden">
|
|
3841
|
+
<div class="member-text">
|
|
3842
|
+
<p>Adds an effect at the end of the item’s effects.</p>
|
|
3843
|
+
|
|
3844
|
+
|
|
3845
|
+
<ul class="member-list">
|
|
3846
|
+
<h4>Parameters:</h4>
|
|
3847
|
+
|
|
3848
|
+
<li>
|
|
3849
|
+
<tt>effect:</tt>
|
|
3850
|
+
<tt>Object</tt>
|
|
3851
|
+
— the plain object describing the effect
|
|
3852
|
+
|
|
3853
|
+
</li>
|
|
3854
|
+
|
|
3855
|
+
</ul>
|
|
3856
|
+
|
|
3857
|
+
|
|
3858
|
+
<ul class="member-list">
|
|
3859
|
+
<h4>Returns:</h4>
|
|
3860
|
+
|
|
3861
|
+
<li>
|
|
3862
|
+
<tt><a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a></tt> — the added instance
|
|
3863
|
+
</li>
|
|
3864
|
+
|
|
3865
|
+
|
|
3866
|
+
</ul>
|
|
3867
|
+
|
|
3868
|
+
|
|
3869
|
+
|
|
3870
|
+
|
|
3871
|
+
|
|
3872
|
+
</div>
|
|
3873
|
+
</div>
|
|
3874
|
+
</div>
|
|
3875
|
+
|
|
3876
|
+
|
|
3877
|
+
<div id="inserteffect-index-effect" class="member">
|
|
3878
|
+
<div class="member-link">
|
|
3879
|
+
<a name="inserteffect-index-effect" href="#inserteffect-index-effect"><tt><b>insertEffect</b>(index, effect)</tt></a>
|
|
3880
|
+
</div>
|
|
3881
|
+
<div class="member-description hidden">
|
|
3882
|
+
<div class="member-text">
|
|
3883
|
+
<p>Inserts an effect into the item’s effects at the given index.</p>
|
|
3884
|
+
|
|
3885
|
+
|
|
3886
|
+
<ul class="member-list">
|
|
3887
|
+
<h4>Parameters:</h4>
|
|
3888
|
+
|
|
3889
|
+
<li>
|
|
3890
|
+
<tt>index:</tt>
|
|
3891
|
+
<tt>Number</tt>
|
|
3892
|
+
— the index at which to insert the effect
|
|
3893
|
+
|
|
3894
|
+
</li>
|
|
3895
|
+
|
|
3896
|
+
<li>
|
|
3897
|
+
<tt>effect:</tt>
|
|
3898
|
+
<tt>Object</tt>
|
|
3899
|
+
— the plain object describing the effect
|
|
3900
|
+
|
|
3901
|
+
</li>
|
|
3902
|
+
|
|
3903
|
+
</ul>
|
|
3904
|
+
|
|
3905
|
+
|
|
3906
|
+
<ul class="member-list">
|
|
3907
|
+
<h4>Returns:</h4>
|
|
3908
|
+
|
|
3909
|
+
<li>
|
|
3910
|
+
<tt><a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a></tt> — the inserted instance
|
|
3911
|
+
</li>
|
|
3912
|
+
|
|
3913
|
+
|
|
3914
|
+
</ul>
|
|
3915
|
+
|
|
3916
|
+
|
|
3917
|
+
|
|
3918
|
+
|
|
3919
|
+
|
|
3920
|
+
</div>
|
|
3921
|
+
</div>
|
|
3922
|
+
</div>
|
|
3923
|
+
|
|
3924
|
+
|
|
3925
|
+
<div id="inserteffects-index-effects" class="member">
|
|
3926
|
+
<div class="member-link">
|
|
3927
|
+
<a name="inserteffects-index-effects" href="#inserteffects-index-effects"><tt><b>insertEffects</b>(index, effects)</tt></a>
|
|
3928
|
+
</div>
|
|
3929
|
+
<div class="member-description hidden">
|
|
3930
|
+
<div class="member-text">
|
|
3931
|
+
<p>Inserts effects into the item’s effects at the given index.</p>
|
|
3932
|
+
|
|
3933
|
+
|
|
3934
|
+
<ul class="member-list">
|
|
3935
|
+
<h4>Parameters:</h4>
|
|
3936
|
+
|
|
3937
|
+
<li>
|
|
3938
|
+
<tt>index:</tt>
|
|
3939
|
+
<tt>Number</tt>
|
|
3940
|
+
— the index at which to insert the effects
|
|
3941
|
+
|
|
3942
|
+
</li>
|
|
3943
|
+
|
|
3944
|
+
<li>
|
|
3945
|
+
<tt>effects:</tt>
|
|
3946
|
+
Array of <tt>Object</tt> objects
|
|
3947
|
+
— the plain objects describing the effects
|
|
3948
|
+
|
|
3949
|
+
</li>
|
|
3950
|
+
|
|
3951
|
+
</ul>
|
|
3952
|
+
|
|
3953
|
+
|
|
3954
|
+
<ul class="member-list">
|
|
3955
|
+
<h4>Returns:</h4>
|
|
3956
|
+
|
|
3957
|
+
<li>
|
|
3958
|
+
<tt>Array of <a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a> objects</tt> — the inserted instances
|
|
3959
|
+
</li>
|
|
3960
|
+
|
|
3961
|
+
|
|
3962
|
+
</ul>
|
|
3452
3963
|
|
|
3453
3964
|
|
|
3454
|
-
</div>
|
|
3455
3965
|
|
|
3966
|
+
|
|
3967
|
+
|
|
3968
|
+
</div>
|
|
3456
3969
|
</div>
|
|
3457
3970
|
</div>
|
|
3458
3971
|
|
|
3459
3972
|
|
|
3460
|
-
<div id="
|
|
3973
|
+
<div id="removeeffect-index" class="member">
|
|
3461
3974
|
<div class="member-link">
|
|
3462
|
-
<a name="
|
|
3975
|
+
<a name="removeeffect-index" href="#removeeffect-index"><tt><b>removeEffect</b>(index)</tt></a>
|
|
3463
3976
|
</div>
|
|
3464
3977
|
<div class="member-description hidden">
|
|
3465
|
-
|
|
3466
3978
|
<div class="member-text">
|
|
3467
|
-
<p>
|
|
3979
|
+
<p>Removes the effect at the given index from the item’s effects.</p>
|
|
3980
|
+
|
|
3468
3981
|
|
|
3982
|
+
<ul class="member-list">
|
|
3983
|
+
<h4>Parameters:</h4>
|
|
3469
3984
|
|
|
3985
|
+
<li>
|
|
3986
|
+
<tt>index:</tt>
|
|
3987
|
+
<tt>Number</tt>
|
|
3988
|
+
— the index of the effect to remove
|
|
3989
|
+
|
|
3990
|
+
</li>
|
|
3470
3991
|
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
<li>
|
|
3474
|
-
<tt>Function</tt>⟋<tt>null</tt>
|
|
3475
|
-
</li>
|
|
3476
|
-
</ul>
|
|
3477
|
-
|
|
3992
|
+
</ul>
|
|
3993
|
+
|
|
3478
3994
|
|
|
3479
3995
|
<ul class="member-list">
|
|
3480
|
-
<h4>
|
|
3996
|
+
<h4>Returns:</h4>
|
|
3481
3997
|
|
|
3482
|
-
<li
|
|
3998
|
+
<li>
|
|
3999
|
+
<tt><a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a></tt> — the removed instance, or <code>null</code>
|
|
4000
|
+
</li>
|
|
4001
|
+
|
|
3483
4002
|
|
|
3484
4003
|
</ul>
|
|
3485
4004
|
|
|
3486
|
-
<h4>Example:<span class="description">When you move the mouse over the item, its fill color is set to red. When you move the mouse outside again, its fill color is set back to black.</span></h4>
|
|
3487
4005
|
|
|
3488
|
-
<div class="paperscript split">
|
|
3489
4006
|
|
|
3490
|
-
|
|
3491
|
-
|
|
4007
|
+
|
|
4008
|
+
|
|
3492
4009
|
</div>
|
|
3493
|
-
|
|
3494
|
-
<script type="text/paperscript" canvas="canvas-44">
|
|
3495
|
-
// Create a circle shaped path at the center of the view:
|
|
3496
|
-
var path = new Path.Circle({
|
|
3497
|
-
center: view.center,
|
|
3498
|
-
radius: 25,
|
|
3499
|
-
fillColor: 'black'
|
|
3500
|
-
});
|
|
3501
|
-
|
|
3502
|
-
// When the mouse enters the item, set its fill color to red:
|
|
3503
|
-
path.onMouseEnter = function(event) {
|
|
3504
|
-
this.fillColor = 'red';
|
|
3505
|
-
}
|
|
3506
|
-
|
|
3507
|
-
// When the mouse leaves the item, set its fill color to black:
|
|
3508
|
-
path.onMouseLeave = function(event) {
|
|
3509
|
-
this.fillColor = 'black';
|
|
3510
|
-
}
|
|
3511
|
-
</script>
|
|
3512
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-44"></canvas></div>
|
|
3513
4010
|
</div>
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
<h4>Example:<span class="description">When you click the mouse, you create new circle shaped items. When you move the mouse over the item, its fill color is set to red. When you move the mouse outside again, its fill color is set back to black.</span></h4>
|
|
3517
|
-
|
|
3518
|
-
<div class="paperscript split">
|
|
3519
|
-
|
|
3520
|
-
<div class="buttons">
|
|
3521
|
-
<div class="button run">Run</div>
|
|
3522
4011
|
</div>
|
|
3523
4012
|
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
4013
|
+
|
|
4014
|
+
<div id="removeeffects" class="member">
|
|
4015
|
+
<div class="member-link">
|
|
4016
|
+
<a name="removeeffects" href="#removeeffects"><tt><b>removeEffects</b>([start[, end]])</tt></a>
|
|
4017
|
+
</div>
|
|
4018
|
+
<div class="member-description hidden">
|
|
4019
|
+
<div class="member-text">
|
|
4020
|
+
<p>Removes the effects from the start index to the end index from the item’s effects, or all of them.</p>
|
|
4021
|
+
|
|
4022
|
+
|
|
4023
|
+
<ul class="member-list">
|
|
4024
|
+
<h4>Parameters:</h4>
|
|
4025
|
+
|
|
4026
|
+
<li>
|
|
4027
|
+
<tt>start:</tt>
|
|
4028
|
+
<tt>Number</tt>
|
|
4029
|
+
— the index of the first effect to remove
|
|
4030
|
+
— optional, default: <tt>0</tt>
|
|
4031
|
+
</li>
|
|
4032
|
+
|
|
4033
|
+
<li>
|
|
4034
|
+
<tt>end:</tt>
|
|
4035
|
+
<tt>Number</tt>
|
|
4036
|
+
— the index after the last one
|
|
4037
|
+
— optional, default: <tt>effects.length</tt>
|
|
4038
|
+
</li>
|
|
4039
|
+
|
|
4040
|
+
</ul>
|
|
3532
4041
|
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
4042
|
+
|
|
4043
|
+
<ul class="member-list">
|
|
4044
|
+
<h4>Returns:</h4>
|
|
4045
|
+
|
|
4046
|
+
<li>
|
|
4047
|
+
<tt>Array of <a href="../classes/EffectInstance.html"><tt>EffectInstance</tt></a> objects</tt> — the removed instances
|
|
4048
|
+
</li>
|
|
3538
4049
|
|
|
3539
|
-
|
|
3540
|
-
|
|
4050
|
+
|
|
4051
|
+
</ul>
|
|
3541
4052
|
|
|
3542
|
-
// When the mouse leaves the item, set its fill color to black:
|
|
3543
|
-
path.onMouseLeave = leave;
|
|
3544
|
-
}
|
|
3545
|
-
</script>
|
|
3546
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-45"></canvas></div>
|
|
3547
|
-
</div>
|
|
3548
4053
|
|
|
3549
4054
|
|
|
4055
|
+
|
|
4056
|
+
|
|
3550
4057
|
</div>
|
|
3551
|
-
|
|
3552
4058
|
</div>
|
|
3553
4059
|
</div>
|
|
3554
4060
|
|
|
3555
4061
|
|
|
3556
|
-
<div id="
|
|
4062
|
+
<div id="geteffectoutput" class="member">
|
|
3557
4063
|
<div class="member-link">
|
|
3558
|
-
<a name="
|
|
4064
|
+
<a name="geteffectoutput" href="#geteffectoutput"><tt><b>getEffectOutput</b>()</tt></a>
|
|
3559
4065
|
</div>
|
|
3560
4066
|
<div class="member-description hidden">
|
|
3561
|
-
|
|
3562
4067
|
<div class="member-text">
|
|
3563
|
-
<p>
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
<ul class="member-list">
|
|
3568
|
-
<h4>Type:</h4>
|
|
3569
|
-
<li>
|
|
3570
|
-
<tt>Function</tt>⟋<tt>null</tt>
|
|
3571
|
-
</li>
|
|
3572
|
-
</ul>
|
|
4068
|
+
<p>Returns what the item’s visible effects make of it, in the item’s own coordinates, outside of the scene graph, or <code>null</code> if it has none. It is kept until the item, its content, its effects or the registered effects change, so changing it isn’t tracked.</p>
|
|
3573
4069
|
|
|
3574
4070
|
|
|
4071
|
+
|
|
3575
4072
|
<ul class="member-list">
|
|
3576
|
-
<h4>
|
|
4073
|
+
<h4>Returns:</h4>
|
|
3577
4074
|
|
|
3578
|
-
<li
|
|
4075
|
+
<li>
|
|
4076
|
+
<tt><a href="../classes/Item.html"><tt>Item</tt></a>⟋<tt>null</tt></tt> — the output of the effects
|
|
4077
|
+
</li>
|
|
4078
|
+
|
|
3579
4079
|
|
|
3580
4080
|
</ul>
|
|
3581
4081
|
|
|
3582
|
-
<h4>Example:<span class="description">Move the mouse over the circle shaped path and then move it out of it again to set its fill color to red:</span></h4>
|
|
3583
|
-
|
|
3584
|
-
<div class="paperscript split">
|
|
3585
|
-
|
|
3586
|
-
<div class="buttons">
|
|
3587
|
-
<div class="button run">Run</div>
|
|
3588
|
-
</div>
|
|
3589
|
-
|
|
3590
|
-
<script type="text/paperscript" canvas="canvas-46">
|
|
3591
|
-
// Create a circle shaped path at the center of the view:
|
|
3592
|
-
var path = new Path.Circle({
|
|
3593
|
-
center: view.center,
|
|
3594
|
-
radius: 25,
|
|
3595
|
-
fillColor: 'black'
|
|
3596
|
-
});
|
|
3597
|
-
|
|
3598
|
-
// When the mouse leaves the item, set its fill color to red:
|
|
3599
|
-
path.onMouseLeave = function(event) {
|
|
3600
|
-
this.fillColor = 'red';
|
|
3601
|
-
}
|
|
3602
|
-
</script>
|
|
3603
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-46"></canvas></div>
|
|
3604
|
-
</div>
|
|
3605
|
-
|
|
3606
4082
|
|
|
3607
|
-
</div>
|
|
3608
4083
|
|
|
4084
|
+
|
|
4085
|
+
|
|
3609
4086
|
</div>
|
|
3610
4087
|
</div>
|
|
3611
|
-
|
|
3612
4088
|
</div>
|
|
3613
4089
|
|
|
3614
|
-
|
|
3615
|
-
<!-- =========================== inherited methods ========================= -->
|
|
3616
|
-
<div class="reference-members"><h2>Methods inherited from <a href="../classes/Item.html"><tt>Item</tt></a></h2>
|
|
3617
|
-
|
|
3618
4090
|
|
|
3619
4091
|
<div id="set-props" class="member">
|
|
3620
4092
|
<div class="member-link">
|
|
@@ -3659,7 +4131,7 @@ path.onMouseLeave = function(event) {
|
|
|
3659
4131
|
<div class="button run">Run</div>
|
|
3660
4132
|
</div>
|
|
3661
4133
|
|
|
3662
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4134
|
+
<script type="text/paperscript" canvas="canvas-50">
|
|
3663
4135
|
var circle = new Path.Circle({
|
|
3664
4136
|
center: [80, 50],
|
|
3665
4137
|
radius: 35
|
|
@@ -3672,7 +4144,7 @@ circle.set({
|
|
|
3672
4144
|
selected: true
|
|
3673
4145
|
});
|
|
3674
4146
|
</script>
|
|
3675
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4147
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-50"></canvas></div>
|
|
3676
4148
|
</div>
|
|
3677
4149
|
|
|
3678
4150
|
|
|
@@ -3728,7 +4200,7 @@ circle.set({
|
|
|
3728
4200
|
<div class="button run">Run</div>
|
|
3729
4201
|
</div>
|
|
3730
4202
|
|
|
3731
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4203
|
+
<script type="text/paperscript" canvas="canvas-51">
|
|
3732
4204
|
var circle = new Path.Circle({
|
|
3733
4205
|
center: [50, 50],
|
|
3734
4206
|
radius: 10,
|
|
@@ -3743,7 +4215,7 @@ for (var i = 0; i < 20; i++) {
|
|
|
3743
4215
|
copy.position.x += i * copy.bounds.width;
|
|
3744
4216
|
}
|
|
3745
4217
|
</script>
|
|
3746
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4218
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-51"></canvas></div>
|
|
3747
4219
|
</div>
|
|
3748
4220
|
|
|
3749
4221
|
|
|
@@ -3869,7 +4341,7 @@ for (var i = 0; i < 20; i++) {
|
|
|
3869
4341
|
<div class="button run">Run</div>
|
|
3870
4342
|
</div>
|
|
3871
4343
|
|
|
3872
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4344
|
+
<script type="text/paperscript" canvas="canvas-52">
|
|
3873
4345
|
var circle = new Path.Circle({
|
|
3874
4346
|
center: [50, 50],
|
|
3875
4347
|
radius: 5,
|
|
@@ -3886,7 +4358,7 @@ raster.position.x += 100;
|
|
|
3886
4358
|
circle.scale(5);
|
|
3887
4359
|
raster.scale(5);
|
|
3888
4360
|
</script>
|
|
3889
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4361
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-52"></canvas></div>
|
|
3890
4362
|
</div>
|
|
3891
4363
|
|
|
3892
4364
|
|
|
@@ -3940,7 +4412,7 @@ raster.scale(5);
|
|
|
3940
4412
|
<div class="button run">Run</div>
|
|
3941
4413
|
</div>
|
|
3942
4414
|
|
|
3943
|
-
<script type="text/paperscript" canvas="canvas-
|
|
4415
|
+
<script type="text/paperscript" canvas="canvas-53">
|
|
3944
4416
|
var path = new Path.Star({
|
|
3945
4417
|
center: [50, 50],
|
|
3946
4418
|
points: 12,
|
|
@@ -3961,7 +4433,7 @@ function onMouseDown(event) {
|
|
|
3961
4433
|
}
|
|
3962
4434
|
}
|
|
3963
4435
|
</script>
|
|
3964
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
4436
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-53"></canvas></div>
|
|
3965
4437
|
</div>
|
|
3966
4438
|
|
|
3967
4439
|
|
|
@@ -4479,11 +4951,17 @@ function onMouseDown(event) {
|
|
|
4479
4951
|
</div>
|
|
4480
4952
|
<div class="member-description hidden">
|
|
4481
4953
|
<div class="member-text">
|
|
4482
|
-
<p>Exports the item with its content and child items as an SVG DOM.</p>
|
|
4954
|
+
<p>Exports the item with its content and child items as an SVG DOM. With <code>options.bounds</code> or <code>options.matrix</code>, the item is wrapped in an <code><svg></code> element sized to the bounds, as <a href="../classes/Project.html#exportsvg-options"><tt>project.exportSVG(options)</tt></a> does.</p>
|
|
4483
4955
|
<ul class="member-list">
|
|
4484
4956
|
<h4>Options:</h4>
|
|
4485
|
-
<li
|
|
4486
|
-
|
|
4957
|
+
<li>[options.bounds] {String|Rectangle} the bounds of the area to
|
|
4958
|
+
export, either as a string ({@values 'view', content'}), or a
|
|
4959
|
+
{@link Rectangle} object: `'view'` uses the view bounds,
|
|
4960
|
+
`'content'` uses the stroke bounds of the item</li>
|
|
4961
|
+
<li>[options.matrix] {Matrix} the matrix with which to transform the
|
|
4962
|
+
exported content: If `options.bounds` is set to `'view'`,
|
|
4963
|
+
`paper.view.matrix` is used, for all other settings of
|
|
4964
|
+
`options.bounds` the identity matrix is used.</li>
|
|
4487
4965
|
<li><tt>options.asString: <tt>Boolean</tt></tt> — whether a SVG node or a <code>String</code> is to be returned — default: <tt>false</tt></li>
|
|
4488
4966
|
<li><tt>options.precision: <tt>Number</tt></tt> — the amount of fractional digits in numbers used in SVG data — default: <tt>5</tt></li>
|
|
4489
4967
|
<li><tt>options.matchShapes: <tt>Boolean</tt></tt> — whether path items should tried to be converted to SVG shape items (rect, circle, ellipse, line, polyline, polygon), if their geometries match — default: <tt>false</tt></li>
|
|
@@ -5837,7 +6315,7 @@ Array of <a href="../classes/Item.html"><tt>Item</tt></a> objects
|
|
|
5837
6315
|
<div class="button run">Run</div>
|
|
5838
6316
|
</div>
|
|
5839
6317
|
|
|
5840
|
-
<script type="text/paperscript" canvas="canvas-
|
|
6318
|
+
<script type="text/paperscript" canvas="canvas-54">
|
|
5841
6319
|
// Create a rectangle shaped path with its top left
|
|
5842
6320
|
// point at {x: 80, y: 25} and a size of {width: 50, height: 50}:
|
|
5843
6321
|
var path = new Path.Rectangle(new Point(80, 25), new Size(50, 50));
|
|
@@ -5846,7 +6324,7 @@ path.fillColor = 'black';
|
|
|
5846
6324
|
// Rotate the path by 30 degrees:
|
|
5847
6325
|
path.rotate(30);
|
|
5848
6326
|
</script>
|
|
5849
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
6327
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-54"></canvas></div>
|
|
5850
6328
|
</div>
|
|
5851
6329
|
|
|
5852
6330
|
|
|
@@ -5858,7 +6336,7 @@ path.rotate(30);
|
|
|
5858
6336
|
<div class="button run">Run</div>
|
|
5859
6337
|
</div>
|
|
5860
6338
|
|
|
5861
|
-
<script type="text/paperscript" canvas="canvas-
|
|
6339
|
+
<script type="text/paperscript" canvas="canvas-55">
|
|
5862
6340
|
// Create a rectangle shaped path with its top left
|
|
5863
6341
|
// point at {x: 175, y: 50} and a size of {width: 100, height: 100}:
|
|
5864
6342
|
var topLeft = new Point(175, 50);
|
|
@@ -5880,7 +6358,7 @@ function onFrame(event) {
|
|
|
5880
6358
|
path.rotate(3, view.center);
|
|
5881
6359
|
}
|
|
5882
6360
|
</script>
|
|
5883
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
6361
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-55"></canvas></div>
|
|
5884
6362
|
</div>
|
|
5885
6363
|
|
|
5886
6364
|
|
|
@@ -5929,7 +6407,7 @@ function onFrame(event) {
|
|
|
5929
6407
|
<div class="button run">Run</div>
|
|
5930
6408
|
</div>
|
|
5931
6409
|
|
|
5932
|
-
<script type="text/paperscript" canvas="canvas-
|
|
6410
|
+
<script type="text/paperscript" canvas="canvas-56">
|
|
5933
6411
|
// Create a circle shaped path at { x: 80, y: 50 }
|
|
5934
6412
|
// with a radius of 20:
|
|
5935
6413
|
var circle = new Path.Circle({
|
|
@@ -5941,7 +6419,7 @@ var circle = new Path.Circle({
|
|
|
5941
6419
|
// Scale the path by 150% from its center point
|
|
5942
6420
|
circle.scale(1.5);
|
|
5943
6421
|
</script>
|
|
5944
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
6422
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-56"></canvas></div>
|
|
5945
6423
|
</div>
|
|
5946
6424
|
|
|
5947
6425
|
|
|
@@ -5953,7 +6431,7 @@ circle.scale(1.5);
|
|
|
5953
6431
|
<div class="button run">Run</div>
|
|
5954
6432
|
</div>
|
|
5955
6433
|
|
|
5956
|
-
<script type="text/paperscript" canvas="canvas-
|
|
6434
|
+
<script type="text/paperscript" canvas="canvas-57">
|
|
5957
6435
|
// Create a circle shaped path at { x: 80, y: 50 }
|
|
5958
6436
|
// with a radius of 20:
|
|
5959
6437
|
var circle = new Path.Circle({
|
|
@@ -5965,7 +6443,7 @@ var circle = new Path.Circle({
|
|
|
5965
6443
|
// Scale the path 150% from its bottom left corner
|
|
5966
6444
|
circle.scale(1.5, circle.bounds.bottomLeft);
|
|
5967
6445
|
</script>
|
|
5968
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
6446
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-57"></canvas></div>
|
|
5969
6447
|
</div>
|
|
5970
6448
|
|
|
5971
6449
|
|
|
@@ -6021,7 +6499,7 @@ circle.scale(1.5, circle.bounds.bottomLeft);
|
|
|
6021
6499
|
<div class="button run">Run</div>
|
|
6022
6500
|
</div>
|
|
6023
6501
|
|
|
6024
|
-
<script type="text/paperscript" canvas="canvas-
|
|
6502
|
+
<script type="text/paperscript" canvas="canvas-58">
|
|
6025
6503
|
// Create a circle shaped path at { x: 100, y: 50 }
|
|
6026
6504
|
// with a radius of 20:
|
|
6027
6505
|
var circle = new Path.Circle({
|
|
@@ -6033,7 +6511,7 @@ var circle = new Path.Circle({
|
|
|
6033
6511
|
// Scale the path horizontally by 300%
|
|
6034
6512
|
circle.scale(3, 1);
|
|
6035
6513
|
</script>
|
|
6036
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
6514
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-58"></canvas></div>
|
|
6037
6515
|
</div>
|
|
6038
6516
|
|
|
6039
6517
|
|
|
@@ -6471,7 +6949,7 @@ circle.scale(3, 1);
|
|
|
6471
6949
|
<div class="button run">Run</div>
|
|
6472
6950
|
</div>
|
|
6473
6951
|
|
|
6474
|
-
<script type="text/paperscript" canvas="canvas-
|
|
6952
|
+
<script type="text/paperscript" canvas="canvas-59">
|
|
6475
6953
|
// Create a rectangle shaped path with its top left corner
|
|
6476
6954
|
// at {x: 80, y: 25} and a size of {width: 75, height: 50}:
|
|
6477
6955
|
var path = new Path.Rectangle({
|
|
@@ -6492,7 +6970,7 @@ var circlePath = new Path.Circle({
|
|
|
6492
6970
|
// the rectangular path:
|
|
6493
6971
|
circlePath.fitBounds(path.bounds);
|
|
6494
6972
|
</script>
|
|
6495
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
6973
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-59"></canvas></div>
|
|
6496
6974
|
</div>
|
|
6497
6975
|
|
|
6498
6976
|
|
|
@@ -6504,7 +6982,7 @@ circlePath.fitBounds(path.bounds);
|
|
|
6504
6982
|
<div class="button run">Run</div>
|
|
6505
6983
|
</div>
|
|
6506
6984
|
|
|
6507
|
-
<script type="text/paperscript" canvas="canvas-
|
|
6985
|
+
<script type="text/paperscript" canvas="canvas-60">
|
|
6508
6986
|
// Create a rectangle shaped path with its top left corner
|
|
6509
6987
|
// at {x: 80, y: 25} and a size of {width: 75, height: 50}:
|
|
6510
6988
|
var path = new Path.Rectangle({
|
|
@@ -6525,7 +7003,7 @@ var circlePath = new Path.Circle({
|
|
|
6525
7003
|
// the rectangular path:
|
|
6526
7004
|
circlePath.fitBounds(path.bounds, 'cover');
|
|
6527
7005
|
</script>
|
|
6528
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
7006
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-60"></canvas></div>
|
|
6529
7007
|
</div>
|
|
6530
7008
|
|
|
6531
7009
|
|
|
@@ -6537,7 +7015,7 @@ circlePath.fitBounds(path.bounds, 'cover');
|
|
|
6537
7015
|
<div class="button run">Run</div>
|
|
6538
7016
|
</div>
|
|
6539
7017
|
|
|
6540
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7018
|
+
<script type="text/paperscript" canvas="canvas-61">
|
|
6541
7019
|
var path = new Path.Circle({
|
|
6542
7020
|
center: [80, 50],
|
|
6543
7021
|
radius: 30,
|
|
@@ -6547,7 +7025,7 @@ var path = new Path.Circle({
|
|
|
6547
7025
|
// Fit the path to the bounding rectangle of the view:
|
|
6548
7026
|
path.fitBounds(view.bounds);
|
|
6549
7027
|
</script>
|
|
6550
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
7028
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-61"></canvas></div>
|
|
6551
7029
|
</div>
|
|
6552
7030
|
|
|
6553
7031
|
|
|
@@ -6573,7 +7051,7 @@ path.fitBounds(view.bounds);
|
|
|
6573
7051
|
<li>
|
|
6574
7052
|
<tt>type:</tt>
|
|
6575
7053
|
<tt>String</tt>
|
|
6576
|
-
— the type of event: <tt>‘frame’</tt>, <tt>mousedown’</tt>, <tt>‘mouseup’</tt>, <tt>‘mousedrag’</tt>, <tt>‘click’</tt>, <tt>‘doubleclick’</tt>, <tt>‘mousemove’</tt>, <tt>‘mouseenter’</tt>, <tt>‘mouseleave’</tt>
|
|
7054
|
+
— the type of event: <tt>‘frame’</tt>, <tt>mousedown’</tt>, <tt>‘mouseup’</tt>, <tt>‘mousedrag’</tt>, <tt>‘click’</tt>, <tt>‘doubleclick’</tt>, <tt>‘mousemove’</tt>, <tt>‘mouseenter’</tt>, <tt>‘mouseleave’</tt>, <tt>‘draw’</tt>, <tt>‘drawselection’</tt>
|
|
6577
7055
|
|
|
6578
7056
|
</li>
|
|
6579
7057
|
|
|
@@ -6608,7 +7086,7 @@ path.fitBounds(view.bounds);
|
|
|
6608
7086
|
<div class="button run">Run</div>
|
|
6609
7087
|
</div>
|
|
6610
7088
|
|
|
6611
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7089
|
+
<script type="text/paperscript" canvas="canvas-62">
|
|
6612
7090
|
// Create a circle shaped path at the center of the view:
|
|
6613
7091
|
var path = new Path.Circle({
|
|
6614
7092
|
center: view.center,
|
|
@@ -6626,7 +7104,7 @@ path.on('mouseleave', function() {
|
|
|
6626
7104
|
this.fillColor = 'black';
|
|
6627
7105
|
});
|
|
6628
7106
|
</script>
|
|
6629
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
7107
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-62"></canvas></div>
|
|
6630
7108
|
</div>
|
|
6631
7109
|
|
|
6632
7110
|
|
|
@@ -6650,7 +7128,7 @@ path.on('mouseleave', function() {
|
|
|
6650
7128
|
<li>
|
|
6651
7129
|
<tt>object:</tt>
|
|
6652
7130
|
<tt>Object</tt>
|
|
6653
|
-
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
|
7131
|
+
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>, <tt>draw</tt>, <tt>drawselection</tt>
|
|
6654
7132
|
|
|
6655
7133
|
</li>
|
|
6656
7134
|
|
|
@@ -6678,7 +7156,7 @@ path.on('mouseleave', function() {
|
|
|
6678
7156
|
<div class="button run">Run</div>
|
|
6679
7157
|
</div>
|
|
6680
7158
|
|
|
6681
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7159
|
+
<script type="text/paperscript" canvas="canvas-63">
|
|
6682
7160
|
// Create a circle shaped path at the center of the view:
|
|
6683
7161
|
var path = new Path.Circle({
|
|
6684
7162
|
center: view.center,
|
|
@@ -6696,7 +7174,7 @@ path.on({
|
|
|
6696
7174
|
}
|
|
6697
7175
|
});
|
|
6698
7176
|
</script>
|
|
6699
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
7177
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-63"></canvas></div>
|
|
6700
7178
|
</div>
|
|
6701
7179
|
|
|
6702
7180
|
|
|
@@ -6708,7 +7186,7 @@ path.on({
|
|
|
6708
7186
|
<div class="button run">Run</div>
|
|
6709
7187
|
</div>
|
|
6710
7188
|
|
|
6711
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7189
|
+
<script type="text/paperscript" canvas="canvas-64">
|
|
6712
7190
|
var pathHandlers = {
|
|
6713
7191
|
mouseenter: function(event) {
|
|
6714
7192
|
this.fillColor = 'red';
|
|
@@ -6731,7 +7209,7 @@ function onMouseDown(event) {
|
|
|
6731
7209
|
path.on(pathHandlers);
|
|
6732
7210
|
}
|
|
6733
7211
|
</script>
|
|
6734
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
7212
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-64"></canvas></div>
|
|
6735
7213
|
</div>
|
|
6736
7214
|
|
|
6737
7215
|
|
|
@@ -6755,7 +7233,7 @@ function onMouseDown(event) {
|
|
|
6755
7233
|
<li>
|
|
6756
7234
|
<tt>type:</tt>
|
|
6757
7235
|
<tt>String</tt>
|
|
6758
|
-
— the type of event: <tt>‘frame’</tt>, <tt>mousedown’</tt>, <tt>‘mouseup’</tt>, <tt>‘mousedrag’</tt>, <tt>‘click’</tt>, <tt>‘doubleclick’</tt>, <tt>‘mousemove’</tt>, <tt>‘mouseenter’</tt>, <tt>‘mouseleave’</tt>
|
|
7236
|
+
— the type of event: <tt>‘frame’</tt>, <tt>mousedown’</tt>, <tt>‘mouseup’</tt>, <tt>‘mousedrag’</tt>, <tt>‘click’</tt>, <tt>‘doubleclick’</tt>, <tt>‘mousemove’</tt>, <tt>‘mouseenter’</tt>, <tt>‘mouseleave’</tt>, <tt>‘draw’</tt>, <tt>‘drawselection’</tt>
|
|
6759
7237
|
|
|
6760
7238
|
</li>
|
|
6761
7239
|
|
|
@@ -6803,7 +7281,7 @@ function onMouseDown(event) {
|
|
|
6803
7281
|
<li>
|
|
6804
7282
|
<tt>object:</tt>
|
|
6805
7283
|
<tt>Object</tt>
|
|
6806
|
-
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>
|
|
7284
|
+
— an object containing one or more of the following properties: <tt>frame</tt>, <tt>mousedown</tt>, <tt>mouseup</tt>, <tt>mousedrag</tt>, <tt>click</tt>, <tt>doubleclick</tt>, <tt>mousemove</tt>, <tt>mouseenter</tt>, <tt>mouseleave</tt>, <tt>draw</tt>, <tt>drawselection</tt>
|
|
6807
7285
|
|
|
6808
7286
|
</li>
|
|
6809
7287
|
|
|
@@ -6844,7 +7322,7 @@ function onMouseDown(event) {
|
|
|
6844
7322
|
<li>
|
|
6845
7323
|
<tt>type:</tt>
|
|
6846
7324
|
<tt>String</tt>
|
|
6847
|
-
— the type of event: <tt>‘frame’</tt>, <tt>mousedown’</tt>, <tt>‘mouseup’</tt>, <tt>‘mousedrag’</tt>, <tt>‘click’</tt>, <tt>‘doubleclick’</tt>, <tt>‘mousemove’</tt>, <tt>‘mouseenter’</tt>, <tt>‘mouseleave’</tt>
|
|
7325
|
+
— the type of event: <tt>‘frame’</tt>, <tt>mousedown’</tt>, <tt>‘mouseup’</tt>, <tt>‘mousedrag’</tt>, <tt>‘click’</tt>, <tt>‘doubleclick’</tt>, <tt>‘mousemove’</tt>, <tt>‘mouseenter’</tt>, <tt>‘mouseleave’</tt>, <tt>‘draw’</tt>, <tt>‘drawselection’</tt>
|
|
6848
7326
|
|
|
6849
7327
|
</li>
|
|
6850
7328
|
|
|
@@ -6892,7 +7370,7 @@ function onMouseDown(event) {
|
|
|
6892
7370
|
<li>
|
|
6893
7371
|
<tt>type:</tt>
|
|
6894
7372
|
<tt>String</tt>
|
|
6895
|
-
— the type of event: <tt>‘frame’</tt>, <tt>mousedown’</tt>, <tt>‘mouseup’</tt>, <tt>‘mousedrag’</tt>, <tt>‘click’</tt>, <tt>‘doubleclick’</tt>, <tt>‘mousemove’</tt>, <tt>‘mouseenter’</tt>, <tt>‘mouseleave’</tt>
|
|
7373
|
+
— the type of event: <tt>‘frame’</tt>, <tt>mousedown’</tt>, <tt>‘mouseup’</tt>, <tt>‘mousedrag’</tt>, <tt>‘click’</tt>, <tt>‘doubleclick’</tt>, <tt>‘mousemove’</tt>, <tt>‘mouseenter’</tt>, <tt>‘mouseleave’</tt>, <tt>‘draw’</tt>, <tt>‘drawselection’</tt>
|
|
6896
7374
|
|
|
6897
7375
|
</li>
|
|
6898
7376
|
|
|
@@ -6959,7 +7437,7 @@ function onMouseDown(event) {
|
|
|
6959
7437
|
<div class="button run">Run</div>
|
|
6960
7438
|
</div>
|
|
6961
7439
|
|
|
6962
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7440
|
+
<script type="text/paperscript" canvas="canvas-65">
|
|
6963
7441
|
function onMouseDrag(event) {
|
|
6964
7442
|
// Create a circle shaped path at the mouse position,
|
|
6965
7443
|
// with a radius of 10:
|
|
@@ -6976,7 +7454,7 @@ function onMouseDrag(event) {
|
|
|
6976
7454
|
});
|
|
6977
7455
|
}
|
|
6978
7456
|
</script>
|
|
6979
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
7457
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-65"></canvas></div>
|
|
6980
7458
|
</div>
|
|
6981
7459
|
|
|
6982
7460
|
|
|
@@ -7006,7 +7484,7 @@ function onMouseDrag(event) {
|
|
|
7006
7484
|
<div class="button run">Run</div>
|
|
7007
7485
|
</div>
|
|
7008
7486
|
|
|
7009
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7487
|
+
<script type="text/paperscript" canvas="canvas-66">
|
|
7010
7488
|
function onMouseMove(event) {
|
|
7011
7489
|
// Create a circle shaped path at the mouse position,
|
|
7012
7490
|
// with a radius of 10:
|
|
@@ -7020,7 +7498,7 @@ function onMouseMove(event) {
|
|
|
7020
7498
|
path.removeOnMove();
|
|
7021
7499
|
}
|
|
7022
7500
|
</script>
|
|
7023
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
7501
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-66"></canvas></div>
|
|
7024
7502
|
</div>
|
|
7025
7503
|
|
|
7026
7504
|
|
|
@@ -7050,7 +7528,7 @@ function onMouseMove(event) {
|
|
|
7050
7528
|
<div class="button run">Run</div>
|
|
7051
7529
|
</div>
|
|
7052
7530
|
|
|
7053
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7531
|
+
<script type="text/paperscript" canvas="canvas-67">
|
|
7054
7532
|
function onMouseDown(event) {
|
|
7055
7533
|
// Create a circle shaped path at the mouse position,
|
|
7056
7534
|
// with a radius of 10:
|
|
@@ -7064,7 +7542,7 @@ function onMouseDown(event) {
|
|
|
7064
7542
|
path.removeOnDown();
|
|
7065
7543
|
}
|
|
7066
7544
|
</script>
|
|
7067
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
7545
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-67"></canvas></div>
|
|
7068
7546
|
</div>
|
|
7069
7547
|
|
|
7070
7548
|
|
|
@@ -7094,7 +7572,7 @@ function onMouseDown(event) {
|
|
|
7094
7572
|
<div class="button run">Run</div>
|
|
7095
7573
|
</div>
|
|
7096
7574
|
|
|
7097
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7575
|
+
<script type="text/paperscript" canvas="canvas-68">
|
|
7098
7576
|
function onMouseDrag(event) {
|
|
7099
7577
|
// Create a circle shaped path at the mouse position,
|
|
7100
7578
|
// with a radius of 10:
|
|
@@ -7108,7 +7586,7 @@ function onMouseDrag(event) {
|
|
|
7108
7586
|
path.removeOnDrag();
|
|
7109
7587
|
}
|
|
7110
7588
|
</script>
|
|
7111
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
7589
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-68"></canvas></div>
|
|
7112
7590
|
</div>
|
|
7113
7591
|
|
|
7114
7592
|
|
|
@@ -7138,7 +7616,7 @@ function onMouseDrag(event) {
|
|
|
7138
7616
|
<div class="button run">Run</div>
|
|
7139
7617
|
</div>
|
|
7140
7618
|
|
|
7141
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7619
|
+
<script type="text/paperscript" canvas="canvas-69">
|
|
7142
7620
|
function onMouseDown(event) {
|
|
7143
7621
|
// Create a circle shaped path at the mouse position,
|
|
7144
7622
|
// with a radius of 10:
|
|
@@ -7152,7 +7630,7 @@ function onMouseDown(event) {
|
|
|
7152
7630
|
path.removeOnUp();
|
|
7153
7631
|
}
|
|
7154
7632
|
</script>
|
|
7155
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
7633
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-69"></canvas></div>
|
|
7156
7634
|
</div>
|
|
7157
7635
|
|
|
7158
7636
|
|
|
@@ -7225,7 +7703,7 @@ function onMouseDown(event) {
|
|
|
7225
7703
|
<div class="button run">Run</div>
|
|
7226
7704
|
</div>
|
|
7227
7705
|
|
|
7228
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7706
|
+
<script type="text/paperscript" canvas="canvas-70">
|
|
7229
7707
|
var path = new Path.Circle({
|
|
7230
7708
|
radius: view.bounds.height * 0.4,
|
|
7231
7709
|
center: view.center
|
|
@@ -7236,7 +7714,7 @@ path.tween(
|
|
|
7236
7714
|
3000
|
|
7237
7715
|
);
|
|
7238
7716
|
</script>
|
|
7239
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
7717
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-70"></canvas></div>
|
|
7240
7718
|
</div>
|
|
7241
7719
|
|
|
7242
7720
|
|
|
@@ -7248,7 +7726,7 @@ path.tween(
|
|
|
7248
7726
|
<div class="button run">Run</div>
|
|
7249
7727
|
</div>
|
|
7250
7728
|
|
|
7251
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7729
|
+
<script type="text/paperscript" canvas="canvas-71">
|
|
7252
7730
|
var path = new Shape.Rectangle({
|
|
7253
7731
|
fillColor: 'red',
|
|
7254
7732
|
center: [50, view.center.y],
|
|
@@ -7263,7 +7741,7 @@ path.tween({
|
|
|
7263
7741
|
duration: 2000
|
|
7264
7742
|
});
|
|
7265
7743
|
</script>
|
|
7266
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
7744
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-71"></canvas></div>
|
|
7267
7745
|
</div>
|
|
7268
7746
|
|
|
7269
7747
|
|
|
@@ -7329,7 +7807,7 @@ path.tween({
|
|
|
7329
7807
|
<div class="button run">Run</div>
|
|
7330
7808
|
</div>
|
|
7331
7809
|
|
|
7332
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7810
|
+
<script type="text/paperscript" canvas="canvas-72">
|
|
7333
7811
|
var path = new Path.Rectangle({
|
|
7334
7812
|
size: [100, 100],
|
|
7335
7813
|
position: view.center,
|
|
@@ -7343,7 +7821,7 @@ path.tween({
|
|
|
7343
7821
|
'segments[2].point.x': '-= 50'
|
|
7344
7822
|
}, 3000);
|
|
7345
7823
|
</script>
|
|
7346
|
-
<div class="canvas"><canvas width="516" height="200" id="canvas-
|
|
7824
|
+
<div class="canvas"><canvas width="516" height="200" id="canvas-72"></canvas></div>
|
|
7347
7825
|
</div>
|
|
7348
7826
|
|
|
7349
7827
|
|
|
@@ -7402,7 +7880,7 @@ path.tween({
|
|
|
7402
7880
|
<div class="button run">Run</div>
|
|
7403
7881
|
</div>
|
|
7404
7882
|
|
|
7405
|
-
<script type="text/paperscript" canvas="canvas-
|
|
7883
|
+
<script type="text/paperscript" canvas="canvas-73">
|
|
7406
7884
|
var path = new Path.Circle({
|
|
7407
7885
|
fillColor: 'blue',
|
|
7408
7886
|
radius: view.bounds.height * 0.4,
|
|
@@ -7418,7 +7896,7 @@ path.tween(2000).onUpdate = function(event) {
|
|
|
7418
7896
|
path.interpolate(pathFrom, pathTo, event.factor)
|
|
7419
7897
|
};
|
|
7420
7898
|
</script>
|
|
7421
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
7899
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-73"></canvas></div>
|
|
7422
7900
|
</div>
|
|
7423
7901
|
|
|
7424
7902
|
|
|
@@ -7539,7 +8017,7 @@ path.tween(2000).onUpdate = function(event) {
|
|
|
7539
8017
|
<div class="button run">Run</div>
|
|
7540
8018
|
</div>
|
|
7541
8019
|
|
|
7542
|
-
<script type="text/paperscript" canvas="canvas-
|
|
8020
|
+
<script type="text/paperscript" canvas="canvas-74">
|
|
7543
8021
|
var path = new Path.Circle({
|
|
7544
8022
|
fillColor: 'blue',
|
|
7545
8023
|
radius: view.bounds.height * 0.4,
|
|
@@ -7547,7 +8025,7 @@ var path = new Path.Circle({
|
|
|
7547
8025
|
});
|
|
7548
8026
|
path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
|
|
7549
8027
|
</script>
|
|
7550
|
-
<div class="canvas"><canvas width="516" height="100" id="canvas-
|
|
8028
|
+
<div class="canvas"><canvas width="516" height="100" id="canvas-74"></canvas></div>
|
|
7551
8029
|
</div>
|
|
7552
8030
|
|
|
7553
8031
|
|
|
@@ -7561,7 +8039,7 @@ path.tweenFrom({ fillColor: 'red' }, { duration: 1000 });
|
|
|
7561
8039
|
|
|
7562
8040
|
<!-- =========================== copyright notice ========================== -->
|
|
7563
8041
|
<p class="footer">
|
|
7564
|
-
Paper.js v0.
|
|
8042
|
+
Paper.js v0.17.0<br>
|
|
7565
8043
|
Copyright © 2011—2026 <a href="http://www.lehni.org" target="_blank">Jürg Lehni</a> & <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
|
|
7566
8044
|
<div class="content-end"></div>
|
|
7567
8045
|
|