forked from processing-js/processing-js.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPShape.html
More file actions
122 lines (102 loc) · 3.66 KB
/
Copy pathPShape.html
File metadata and controls
122 lines (102 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
---
layout: default
---
<table cellpadding="0" cellspacing="0" border="0" class="ref-item">
<tr class="name-row">
<th scope="row">Name</th>
<td><h3>PShape</h3></td>
</tr>
<tr class="">
<th scope="row">Examples</th>
<td><div class="example"><img src="/reference/svg.jpg" alt="example pic" /><pre class="margin">PShape s;
s = loadShape("bot.svg");
smooth();
shape(s, 10, 10, 80, 80);</pre></div></td>
</tr>
<tr class="">
<th scope="row">Description</th>
<td><p>Datatype for storing shapes. Processing can currently load and display SVG (Scalable Vector Graphics) shapes.
Before a shape is used, it must be loaded with the <b>loadShape()</b> function. The shape() function is used to draw the shape to the display window.
The <b>PShape</b> object contain a group of methods, linked below, that can operate on the shape data. </p>
<p>The <b>loadShape()</b> method supports SVG files created with Inkscape and Adobe Illustrator.
It is not a full SVG implementation, but offers some straightforward support for handling vector data.</p></td>
</tr>
<tr class="">
<th scope="row">Fields</th>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr class="">
<th scope="row"><a href="../reference/PShape_width">width</a></th>
<td>Shape document width</td>
</tr>
<tr class="">
<th scope="row"><a href="../reference/PShape_height">height</a></th>
<td>Shape document width</td>
</tr>
</table>
</td>
</tr>
<tr class="">
<th scope="row">Methods</th>
<td><table cellpadding="0" cellspacing="0" border="0">
<tr class="">
<th scope="row"><a href="../reference/PShape_isVisible_">isVisible()</a></th>
<td>Returns a boolean value "true" if the image is set to be visible, "false" if not</td>
</tr>
<tr class="">
<th scope="row"><a href="../reference/PShape_setVisible_">setVisible()</a></th>
<td>Sets the shape to be visible or invisible</td>
</tr>
<tr class="">
<th scope="row"><a href="../reference/PShape_disableStyle_">disableStyle()</a></th>
<td>Disables the shape's style data and uses Processing styles</td>
</tr>
<tr class="">
<th scope="row"><a href="../reference/PShape_enableStyle_">enableStyle()</a></th>
<td>Enables the shape's style data and ignores the Processing styles</td>
</tr>
<tr class="">
<th scope="row"><a href="../reference/PShape_getChild_">getChild()</a></th>
<td>Returns a child element of a shape as a PShape object</td>
</tr>
<tr class="">
<th scope="row"><a href="../reference/PShape_translate_">translate()</a></th>
<td>Displaces the shape</td>
</tr>
<tr class="">
<th scope="row"><a href="../reference/PShape_rotate_">rotate()</a></th>
<td>Rotates the shape</td>
</tr>
<tr class="">
<th scope="row"><a href="../reference/PShape_rotateX_">rotateX()</a></th>
<td>Rotates the shape around the x-axis</td>
</tr>
<tr class="">
<th scope="row"><a href="../reference/PShape_rotateY_">rotateY()</a></th>
<td>Rotates the shape around the y-axis</td>
</tr>
<tr class="">
<th scope="row"><a href="../reference/PShape_rotateZ_">rotateZ()</a></th>
<td>Rotates the shape around the z-axis</td>
</tr>
<tr class="">
<th scope="row"><a href="../reference/PShape_scale_">scale()</a></th>
<td>Increases and decreases the size of a shape</td>
</tr>
</table></td>
</tr>
<tr class="">
<th scope="row"><!--*-->Constructor<!--*--></th>
<td><pre>PShape()</pre></td>
</tr>
<tr class="">
<th scope="row">Usage</th>
<td>Web & Application</td>
</tr>
<tr class="">
<th scope="row">Related</th>
<td><a href="../reference/shape_">shape()</a><br />
<a href="../reference/loadShape_">loadShape()</a><br />
<a href="../reference/shapeMode_">shapeMode()</a></td>
</tr>
</table>