Skip to content

Commit d82646b

Browse files
authored
Merge pull request #57 from processing/proofreading
Apply documentation changes from proofreader
2 parents 17f4e1d + 0189d0c commit d82646b

41 files changed

Lines changed: 108 additions & 105 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/01_Shapes_And_Color/01_Color.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
* sets the color for the inside of shapes.
1111
* <a href="https://p5js.org/reference/#/p5/noFill" target="_blank">noStroke()</a> and
1212
* <a href="https://p5js.org/reference/#/p5/noFill" target="_blank">noFill()</a>
13-
* turns off line color or inner color respectively.
13+
* turn off line color and inner color, respectively.
1414
*
15-
* Colors can be represented in many different ways. This examples demonstrate several options.
15+
* Colors can be represented in many different ways. This example demonstrates several options.
1616
*/
1717

1818
function setup() {
@@ -23,7 +23,7 @@ function setup() {
2323
angleMode(DEGREES);
2424

2525
// CSS color name
26-
// For a list of available color names see:
26+
// For a list of available color names, see:
2727
// https://www.w3.org/wiki/CSS/Properties/color/keywords
2828
background('steelblue');
2929

@@ -43,8 +43,8 @@ function setup() {
4343
// Dark red
4444
stroke(100, 20, 20);
4545

46-
// The rectangle uses the last set fill color
47-
// which is light blue set before drawing the square
46+
// The rectangle uses the last set fill color,
47+
// which is light blue, set before drawing the square
4848
rect(100, 40, 200, 100);
4949

5050
// Hue, saturation, and brightness values

examples/02_Animation_And_Variables/00_Drawing_Lines.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function setup() {
2828
// Set width of the lines
2929
strokeWeight(10);
3030

31-
// Set color mode to hue-saturation-value (HSB)
31+
// Set color mode to hue-saturation-brightness (HSB)
3232
colorMode(HSB);
3333

3434
// Set screen reader accessible description

examples/02_Animation_And_Variables/01_Animation_With_Events.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* <a href="https://p5js.org/reference/#/p5/noLoop">noLoop()</a>
77
* to pause and resume the animation.
88
*
9-
* Clicking the mouse toggles the animation loop. If the animation
9+
* Clicking the mouse toggles the animation loop. If the animation
1010
* loop is stopped, the user can press any key to advance one frame.
1111
* Note: the user must click to set the focus on the canvas for
1212
* key presses to be registered.

examples/02_Animation_And_Variables/03_Conditions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @frame 400,400
44
* @description If and else statements allow a
55
* <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/block" target="_blank">block of code</a>
6-
* to only run when a certain condition is true. This example only
6+
* to run only when a certain condition is true. This example only
77
* animates when the mouse is held down. This is because of the if
88
* statement on line 59. You can read more about if and else statements
99
* <a href="https://p5js.org/reference/#/p5/if-else">in the p5 reference</a>
@@ -23,7 +23,7 @@
2323
* 45, which checks that the circle's x position is at least 100 and also
2424
* no more than 300.
2525
* <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR" target="_blank">||</a>
26-
* checks that at least one of the conditions are true. The circle reverses horizontal
26+
* checks that at least one of the conditions is true. The circle reverses horizontal
2727
* speed when it reaches the left or right edge of the canvas because of the if statement
2828
* on line 75.
2929
*/

examples/03_Imported_Media/00_Words.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let font;
1111
let fontsize = 40;
1212

1313
function preload() {
14-
// Preload the font's file in the canvas' assets directory.
14+
// Preload the font's file in the canvas's assets directory.
1515
// loadFont() accepts .ttf or .otf files.
1616
font = loadFont('assets/SourceSansPro-Regular.otf');
1717
}

examples/03_Imported_Media/01_Copy_Image_Data.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,33 @@
22
* @name Copy Image Data
33
* @frame 600,400
44
* @description Using the <a href="https://p5js.org/reference/#/p5/copy" target="_blank">copy()</a> method,
5-
* you can simulate coloring an image in by copying an image of the colored image on top of the black and
5+
* you can simulate coloring an image in by copying an image of the colored image on top of the black-and-
66
* white image wherever the cursor is dragged.
77
*/
88

99
// Define the global variables: bottomImg and topImg.
1010
let bottomImg, topImg;
1111

1212
function preload() {
13-
// Preload the images from the canvas' assets directory.
13+
// Preload the images from the canvas's assets directory.
1414
// The bottomImg is the photograph with color,
1515
// and the topImg is the black-and-white photograph.
1616
bottomImg = loadImage('assets/parrot-color.png');
1717
topImg = loadImage('assets/parrot-bw.png');
1818
}
1919
function setup() {
2020
describe(
21-
'Black and white photograph of a parrot. The cursor, when dragged across the canvas, adds color to the photograph.'
21+
'Black-and-white photograph of a parrot. The cursor, when dragged across the canvas, adds color to the photograph.'
2222
);
2323

2424
createCanvas(720, 400);
2525

2626
// Hide the cursor and replace it with a picture of
27-
// a paint brush.
27+
// a paintbrush.
2828
noCursor();
2929
cursor('assets/brush.png', 20, -10);
3030

31-
// Load the top image (the black and white image).
31+
// Load the top image (the black-and-white image).
3232
image(topImg, 0, 0);
3333
}
3434
function mouseDragged() {

examples/03_Imported_Media/02_Alpha_Mask.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @description Using the <a href="https://p5js.org/reference/#/p5/mask" target="_blank">mask()</a> method,
44
* you can create a mask for an image to specify the transparency in
55
* different parts of the image. To run this example locally, you will need two
6-
* image files, and a running <a href="https://github.com/processing/p5.js/wiki/Local-server">
6+
* image files and a running <a href="https://github.com/processing/p5.js/wiki/Local-server">
77
* local server</a>.
88
*/
99
// Preload the image assets from the canvas
@@ -18,15 +18,15 @@ function preload() {
1818

1919
function setup() {
2020
describe(
21-
'Two photos, the one on the left labeled with "Masked Image," and the one on the right labeled with "Mask."'
21+
'Two photos, the one on the left labeled with "Masked Image" and the one on the right labeled with "Mask."'
2222
);
2323
createCanvas(710, 400);
2424

2525
// Use the mask() method to apply imgMask photo as a
2626
// mask for img.
2727
img.mask(imgMask);
2828

29-
//Set the alignment of the text labels.
29+
// Set the alignment of the text labels.
3030
textAlign(LEFT, TOP);
3131
}
3232

@@ -47,7 +47,7 @@ function draw() {
4747
);
4848
image(imgMask, 350, 0, 350, 350);
4949

50-
//Add labels to explain the images shown.
50+
// Add labels to explain the images shown.
5151
textSize(24);
5252
fill(0);
5353
text('Masked Image', 10, 10);

examples/03_Imported_Media/03_Image_Transparency.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* <a href="https://p5js.org/reference/#/p5/tint" target="_blank">tint()</a>
66
* function. Move the cursor left and right across the canvas to change the
77
* image's position. To run this example
8-
* locally, you will need an image file, and a running
8+
* locally, you will need an image file and a running
99
* <a href="https://github.com/processing/p5.js/wiki/Local-server">local server</a>.
1010
*/
1111
// Define the global variables: img, offset, and easing.
@@ -16,13 +16,13 @@ let offset = 0;
1616
let easing = 0.05;
1717

1818
function preload() {
19-
// Load the bottom image from the canvas' assets directory.
19+
// Load the bottom image from the canvas's assets directory.
2020
img = loadImage('assets/moonwalk.jpg');
2121
}
2222

2323
function setup() {
2424
describe(
25-
"An astronaut on planet as the background with a slightly transparent version of this image on top that moves with the horizontal direction of the user's mouse."
25+
"An astronaut on a planet as the background with a slightly transparent version of this image on top that moves with the horizontal direction of the user's mouse."
2626
);
2727

2828
createCanvas(720, 400);

examples/03_Imported_Media/05_Video.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function setup() {
1717
// Use the noCanvas() function to remove the canvas.
1818
noCanvas();
1919

20-
// Upload the video in the canvas' assets directory, and
20+
// Upload the video in the canvas's assets directory, and
2121
// use the createVideo() function to load in the video to the code.
2222
// This createVideo() function will build a p5.MediaElement class.
2323
// It's best to upload multiple video formats so the video

examples/03_Imported_Media/06_Video_Canvas.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let playing = false;
1616
function setup() {
1717
createCanvas(710, 400);
1818

19-
// Upload the video in the canvas' assets directory, and
19+
// Upload the video in the canvas's assets directory, and
2020
// use the createVideo() function to load the video into the code.
2121
// It's best to upload multiple video formats so the video
2222
// is visible within different browsers.
@@ -49,11 +49,11 @@ function draw() {
4949

5050
function mousePressed() {
5151
// When the canvas is clicked, check to see if the videos are
52-
// paused or playing. If it is playing, pause the videos.
52+
// paused or playing. If they are playing, pause the videos.
5353
if (playing) {
5454
video.pause();
5555
} else {
56-
// If it is paused, play the videos.
56+
// If they are paused, play the videos.
5757
video.loop();
5858
}
5959

0 commit comments

Comments
 (0)