Skip to content

Commit b47c70f

Browse files
committed
Changes for PShape API
1 parent af60536 commit b47c70f

9 files changed

Lines changed: 34 additions & 27 deletions

content/api_en/PShape_beginContour.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ void setup() {
2121
2222
// Make a shape
2323
s = createShape();
24+
s.beginShape();
2425
s.noStroke();
2526
2627
// Exterior part of shape
@@ -38,7 +39,7 @@ void setup() {
3839
s.endContour();
3940
4041
// Finish off shape
41-
s.end();
42+
s.endShape();
4243
}
4344
4445
void draw() {

content/api_en/PShape_endContour.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ void setup() {
2121
2222
// Make a shape
2323
s = createShape();
24+
s.beginShape();
2425
s.noStroke();
2526
2627
// Exterior part of shape
@@ -38,7 +39,7 @@ void setup() {
3839
s.endContour();
3940
4041
// Finish off shape
41-
s.end();
42+
s.endShape();
4243
}
4344
4445
void draw() {
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ void setup() {
2121
// Creating the PShape as a square. The corner
2222
// is 0,0 so that the center is at 40,40
2323
s = createShape();
24+
s.beginShape();
2425
s.fill(0, 0, 255);
2526
s.noStroke();
2627
s.vertex(0, 0);
2728
s.vertex(0, 50);
2829
s.vertex(50, 0);
29-
s.end();
30+
s.endShape();
3031
}
3132
3233
void draw() {

content/api_en/PShape_getVertex.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ PShape s;
1919
void setup() {
2020
size(100, 100, P2D);
2121
s = createShape();
22+
s.beginShape();
2223
s.vertex(0, 0);
2324
s.vertex(60, 0);
2425
s.vertex(60, 60);
2526
s.vertex(0, 60);
26-
s.end(CLOSE);
27+
s.endShape(CLOSE);
2728
}
2829
2930
void draw() {

content/api_en/PShape_getVertexCount.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ PShape s;
1919
void setup() {
2020
size(100, 100, P2D);
2121
s = createShape();
22+
s.beginShape();
2223
s.vertex(0, 0);
2324
s.vertex(60, 0);
2425
s.vertex(60, 60);
2526
s.vertex(0, 60);
26-
s.end(CLOSE);
27+
s.endShape(CLOSE);
2728
}
2829
2930
void draw() {

content/api_en/PShape_setVertex.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ PShape s;
1919
void setup() {
2020
size(100, 100, P2D);
2121
s = createShape();
22+
s.beginShape();
2223
s.vertex(0, 0);
2324
s.vertex(60, 0);
2425
s.vertex(60, 60);
2526
s.vertex(0, 60);
26-
s.end(CLOSE);
27+
s.endShape(CLOSE);
2728
}
2829
2930
void draw() {

content/api_en/createShape.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void draw() {
105105

106106

107107
<description><![CDATA[
108-
The <b>createShape()</b> function is used to define a new shape. Once created, this shape can be drawn with the <b>shape()</b> function. The basic way to use the function defines new primitive shapes. One of the following parameters are used as the first parameter: <b>ELLIPSE</b>, <b>RECT</b>, <b>ARC</b>, <b>TRIANGLE</b>, <b>SPHERE</b>, <b>BOX</b>, <b>LINE</b>. The parameters for each of these different shapes are the same as their corrsponding functions: <b>ellipse()</b>, <b>rect()</b>, <b>arc()</b>, <b>triangle()</b>, <b>sphere()</b>, <b>box()</b>, and <b>line()</b>. The first example above clarifies how this works.<br />
108+
The <b>createShape()</b> function is used to define a new shape. Once created, this shape can be drawn with the <b>shape()</b> function. The basic way to use the function defines new primitive shapes. One of the following parameters are used as the first parameter: <b>ELLIPSE</b>, <b>RECT</b>, <b>ARC</b>, <b>TRIANGLE</b>, <b>SPHERE</b>, <b>BOX</b>, <b>QUAD</b>, <b>LINE</b>. The parameters for each of these different shapes are the same as their corrsponding functions: <b>ellipse()</b>, <b>rect()</b>, <b>arc()</b>, <b>triangle()</b>, <b>sphere()</b>, <b>box()</b>, and <b>line()</b>. The first example above clarifies how this works.<br />
109109
<br />
110110
Custom, unique shapes can be made by using <b>createShape()</b> without a parameter. After the shape is started, the drawing attributes and geometry can be set directly to the shape. See the second example above for specifics.<br />
111111
<br />

generate/keywords_base.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ALPHA LITERAL2
99
ALPHA_MASK LITERAL2
1010
ALT LITERAL2
1111
AMBIENT LITERAL2
12+
ARC LITERAL2 createShape_
1213
ARROW LITERAL2 cursor_
1314
ARGB LITERAL2
1415
BACKSPACE LITERAL2 keyCode
@@ -18,6 +19,7 @@ BLEND LITERAL2 blend_
1819
BLUE_MASK LITERAL2
1920
BLUR LITERAL2 filter_
2021
BOTTOM LITERAL2 textAlign_
22+
BOX LITERAL2 createShape_
2123
BURN LITERAL2 blend_
2224
CENTER LITERAL2
2325
CHATTER LITERAL2
@@ -61,6 +63,7 @@ DODGE LITERAL2 blend_
6163
DOWN LITERAL2 keyCode
6264
DRAG LITERAL2
6365
DXF LITERAL2 size_
66+
ELLIPSE LITERAL2 createShape_
6467
ENABLE_ACCURATE_2D LITERAL2
6568
ENABLE_DEPTH_MASK LITERAL2
6669
ENABLE_DEPTH_SORT LITERAL2
@@ -92,6 +95,7 @@ INVERT LITERAL2 filter_
9295
JPEG LITERAL2
9396
LEFT LITERAL2 keyCode
9497
LIGHTEST LITERAL2 blend_
98+
LINE LITERAL2 createShape_
9599
LINES LITERAL2 beginShape_
96100
LINUX LITERAL2
97101
MACOSX LITERAL2
@@ -126,12 +130,14 @@ POSTERIZE LITERAL2 filter_
126130
PRESS LITERAL2
127131
PROBLEM LITERAL2
128132
PROJECT LITERAL2 strokeCap_
133+
QUAD LITERAL2 createShape_
129134
QUAD_STRIP LITERAL2 beginShape_
130135
QUADS LITERAL2 beginShape_
131136
QUARTER_PI LITERAL2 QUARTER_PI
132137
RAD_TO_DEG LITERAL2
133138
RADIUS LITERAL2
134139
RADIANS LITERAL2
140+
RECT LITERAL2
135141
RED_MASK LITERAL2
136142
RELEASE LITERAL2
137143
REPEAT LITERAL2
@@ -145,6 +151,7 @@ SECAM LITERAL2
145151
SHAPE LITERAL2 textMode_
146152
SHIFT LITERAL2
147153
SPECULAR LITERAL2
154+
SPHERE LITERAL2 createShape_
148155
SOFT_LIGHT LITERAL2 blend_
149156
SQUARE LITERAL2 strokeCap_
150157
SUBTRACT LITERAL2 blend_
@@ -157,6 +164,7 @@ THIRD_PI LITERAL2
157164
THRESHOLD LITERAL2 filter_
158165
TIFF LITERAL2
159166
TOP LITERAL2 textAlign_
167+
TRIANGLE LITERAL2 createShape_
160168
TRIANGLE_FAN LITERAL2 beginShape_
161169
TRIANGLES LITERAL2 beginShape_
162170
TRIANGLE_STRIP LITERAL2 beginShape_

todo.txt

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
2.0 DESIGN
44

5-
$ New header graphic
6-
$ New splash page / loader graphic
5+
x New header graphic
6+
x New splash page / loader graphic
77
$ New 2.0 icons
88

99
// // // // // // // // // // // // // // // // // // // // //
@@ -23,24 +23,6 @@ NEW LANGUAGE ELEMENTS IN REFERENCE
2323
- other new Table methods
2424

2525
- JSON --SM
26-
27-
28-
- update loadFont() and createFont() to work with NATIVE_FONT decision
29-
30-
- if, for, and catch color coding not working in current build
31-
32-
- Request --CR
33-
- createRequest()
34-
- request.getBytes()
35-
- request.getFont()
36-
- request.getImage()
37-
- request.getShader()
38-
- request.getShape()
39-
- request.getStrings()
40-
- request.getTable()
41-
- request.getXML()
42-
43-
- write reference for getChild() re: OBJ --CR
4426

4527
- potential changes for the PShape methods (endShape(), beginShape())?
4628

@@ -456,6 +438,17 @@ http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/
456438
- Disambiguation pages for things like "copy" in PImage and PVector
457439
- Is there a way to catch for keywords like "run" and "init" in the parser?
458440

441+
- Request --CR
442+
- createRequest()
443+
- request.getBytes()
444+
- request.getFont()
445+
- request.getImage()
446+
- request.getShader()
447+
- request.getShape()
448+
- request.getStrings()
449+
- request.getTable()
450+
- request.getXML()
451+
459452
//
460453

461454
beginShape();

0 commit comments

Comments
 (0)