forked from jdf/processing-py-site
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPShape.xml
More file actions
45 lines (36 loc) · 1.71 KB
/
PShape.xml
File metadata and controls
45 lines (36 loc) · 1.71 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
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>PShape</name>
<category>Shape</category>
<subcategory></subcategory>
<type></type>
<example>
<image />
<code><![CDATA[
size(100, 100)
# The file "apple.svg" must be in the data folder
# of the current sketch to load successfully
s = loadShape("apple.svg")
shape(s, 10, 10, 80, 80)
]]></code>
</example>
<example>
<image />
<code><![CDATA[
size(100, 100, P2D)
# Creating the PShape as a square. The corner
# is 0,0 so that the center is at 40,40
square = createShape(RECT, 0, 0, 80, 80)
shape(square, 10, 10)
]]></code>
</example>
<description><![CDATA[
Datatype for storing shapes. Before a shape is used, it must be loaded with the <b>loadShape()</b> or created with the <b>createShape()</b>. The <b>shape()</b> function is used to draw the shape to the display window. Processing can currently load and display SVG (Scalable Vector Graphics) and OBJ shapes. OBJ files can only be opened using the <b>P3D</b> renderer and <b>createShape()</b> is only available with the <b>P2D</b> and <b>P3D</b> renderers. The <b>loadShape()</b> function 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.
<br /><br>
The <b>PShape</b> object contains a group of methods that can operate on the shape data. Some of the methods are listed below, but the full list used for creating and modifying shapes is <a href="http://www.processing.org/reference/javadoc/core/processing/core/PShape.html">available here in the Processing Javadoc</a>.
]]></description>
<type>class</type>
<related>loadShape</related>
<related>createShape</related>
<related>shapeMode</related>
</root>