Skip to content

Commit 8457c4d

Browse files
committed
Getting keyword color up and running
1 parent cf0cfdb commit 8457c4d

File tree

11 files changed

+63
-27
lines changed

11 files changed

+63
-27
lines changed

core/src/processing/core/PApplet.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11541,9 +11541,9 @@ public void smooth() {
1154111541

1154211542

1154311543
/**
11544-
*
11544+
*
1154511545
* @param level either 2, 4, or 8
11546-
*/
11546+
*/
1154711547
public void smooth(int level) {
1154811548
if (recorder != null) recorder.smooth(level);
1154911549
g.smooth(level);

java/examples/Basics/Input/Clock/Clock.pde

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ void draw() {
5555
strokeWeight(2);
5656
beginShape(POINTS);
5757
for (int a = 0; a < 360; a+=6) {
58-
float x = cx + cos(radians(a)) * secondsRadius;
59-
float y = cy + sin(radians(a)) * secondsRadius;
58+
float angle = radians(a);
59+
float x = cx + cos(angle) * secondsRadius;
60+
float y = cy + sin(angle) * secondsRadius;
6061
vertex(x, y);
6162
}
6263
endShape();

java/examples/Basics/Input/Easing/Easing.pde

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,23 @@
1111

1212
float x;
1313
float y;
14-
float targetX, targetY;
1514
float easing = 0.05;
1615

17-
void setup()
18-
{
16+
void setup() {
1917
size(640, 360);
2018
noStroke();
2119
}
2220

23-
void draw()
24-
{
21+
void draw() {
2522
background(51);
2623

27-
targetX = mouseX;
24+
float targetX = mouseX;
2825
float dx = targetX - x;
2926
if(abs(dx) > 1) {
3027
x += dx * easing;
3128
}
3229

33-
targetY = mouseY;
30+
float targetY = mouseY;
3431
float dy = targetY - y;
3532
if(abs(dy) > 1) {
3633
y += dy * easing;

java/examples/Basics/Input/KeyboardFunctions/KeyboardFunctions.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ void setup()
2626
{
2727
size(640, 360);
2828
noStroke();
29-
colorMode(RGB, numChars);
29+
colorMode(HSB, numChars);
3030
background(numChars/2);
3131
// Set a gray value for each key
32-
for(int i=0; i<numChars; i++) {
33-
colors[i] = color(i);
32+
for(int i = 0; i < numChars; i++) {
33+
colors[i] = color(i, numChars, numChars);
3434
}
3535
}
3636

java/examples/Basics/Input/MousePress/MousePress.pde

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
void setup() {
1010
size(640, 360);
11+
noSmooth();
1112
fill(126);
1213
background(102);
1314
}

java/examples/Basics/Input/MouseSignals/MouseSignals.pde

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ int[] bvals;
1414
void setup()
1515
{
1616
size(640, 360);
17+
noSmooth();
1718
xvals = new int[width];
1819
yvals = new int[width];
1920
bvals = new int[width];

java/examples/Topics/Shaders/Deform/Deform.pde

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
/**
2+
* Deform
3+
*/
4+
15
PImage tex;
26
PShader deform;
37

48
void setup() {
5-
size(512, 384, P2D);
9+
size(640, 360, P2D);
610

7-
textureWrap(REPEAT);
811
tex = loadImage("tex1.jpg");
912

1013
deform = loadShader("deform.glsl");
@@ -16,4 +19,4 @@ void draw() {
1619
deform.set("mouse", float(mouseX), float(mouseY));
1720
shader(deform);
1821
image(tex, 0, 0, width, height);
19-
}
22+
}

java/examples/Topics/Shaders/Monjori/Monjori.pde

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
PShader monjori;
1+
/**
2+
* Monjori
3+
*/
4+
5+
PShader monjori;
26

37
void setup() {
4-
size(512, 384, P2D);
8+
size(640, 360, P2D);
59
noStroke();
610

711
monjori = loadShader("monjori.glsl");
@@ -15,4 +19,4 @@ void draw() {
1519
shader(monjori);
1620
rect(0, 0, width, height);
1721
}
18-
22+

java/examples/Topics/Shaders/Nebula/Nebula.pde

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
/**
2+
* Nebula
3+
*/
4+
15
PShader nebula;
26

37
void setup() {
4-
size(320, 240, P3D);
8+
size(640, 360, P2D);
59
noStroke();
610

711
nebula = loadShader("nebula.glsl");
@@ -14,4 +18,4 @@ void draw() {
1418
fill(0);
1519
rect(0, 0, width, height);
1620
}
17-
21+

java/keywords.txt

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,31 @@ substring KEYWORD3 String_substring_
286286
toLowerCase KEYWORD3 String_toLowerCase_
287287
toUpperCase KEYWORD3 String_toUpperCase_
288288

289+
# Temporary additions 3 September 2012 as the reference is getting updated
290+
PShape KEYWORD1
291+
createShape KEYWORD2
292+
beginContour KEYWORD2
293+
endContour KEYWORD2
294+
end KEYWORD2
295+
addChild KEYWORD2
296+
297+
PShader KEYWORD1
298+
loadShader KEYWORD2
299+
resetShader KEYWORD2
300+
bind KEYWORD2
301+
shader KEYWORD2
302+
303+
blendMode KEYWORD2
304+
305+
selectInput KEYWORD2
306+
selectOutput KEYWORD2
307+
selectFolder KEYWORD2
308+
309+
saveType KEYWORD2
310+
loadType KEYWORD2
311+
clip KEYWORD2
312+
noClip KEYWORD2
313+
289314

290315
# Operators are without KEYWORDS
291316

@@ -384,7 +409,7 @@ day KEYWORD2 day_
384409
degrees KEYWORD2 degrees_
385410
directionalLight KEYWORD2 directionalLight_
386411
displayHeight KEYWORD5 displayHeight
387-
width KEYWORD5 displayWidth
412+
displayWidth KEYWORD5 displayWidth
388413
dist KEYWORD2 dist_
389414
draw KEYWORD2 draw_
390415
ellipse KEYWORD2 ellipse_
@@ -488,15 +513,13 @@ blend KEYWORD3 PImage_blend_
488513
copy KEYWORD3 PImage_copy_
489514
filter KEYWORD3 PImage_filter_
490515
get KEYWORD3 PImage_get_
491-
height KEYWORD4 PImage_height
492516
loadPixels KEYWORD3 PImage_loadPixels_
493517
mask KEYWORD3 PImage_mask_
494518
pixels KEYWORD4 PImage_pixels
495519
resize KEYWORD3 PImage_resize_
496520
save KEYWORD3 PImage_save_
497521
set KEYWORD3 PImage_set_
498522
updatePixels KEYWORD3 PImage_updatePixels_
499-
width KEYWORD4 PImage_width
500523
pixels KEYWORD5 pixels
501524
pmouseX KEYWORD5 pmouseX
502525
pmouseY KEYWORD5 pmouseY
@@ -514,7 +537,6 @@ PShape KEYWORD1 PShape
514537
disableStyle KEYWORD3 PShape_disableStyle_
515538
enableStyle KEYWORD3 PShape_enableStyle_
516539
getChild KEYWORD3 PShape_getChild_
517-
height KEYWORD4 PShape_height
518540
isVisible KEYWORD3 PShape_isVisible_
519541
resetMatrix KEYWORD3 PShape_resetMatrix_
520542
rotate KEYWORD3 PShape_rotate_
@@ -524,7 +546,6 @@ rotateZ KEYWORD3 PShape_rotateZ_
524546
scale KEYWORD3 PShape_scale_
525547
setVisible KEYWORD3 PShape_setVisible_
526548
translate KEYWORD3 PShape_translate_
527-
width KEYWORD4 PShape_width
528549
pushMatrix KEYWORD2 pushMatrix_
529550
pushStyle KEYWORD2 pushStyle_
530551
PVector KEYWORD1 PVector

0 commit comments

Comments
 (0)