@@ -58,15 +58,14 @@ To play around, check out [the example from the p5.js 1.x `preload()` reference]
58
58
``` js
59
59
let img;
60
60
61
- // Load an image and create a p5.Image object.
62
61
function preload () {
63
- img = loadImage (' /assets/ bricks.jpg' );
62
+ img = loadImage (' bricks.jpg' );
64
63
}
65
64
66
65
function setup () {
67
66
createCanvas (100 , 100 );
68
-
69
- // Make a red background - will not actually see this in 1.x
67
+
68
+ // Red backgorund is ignored
70
69
background (255 , 0 , 0 );
71
70
72
71
// Draw the image.
@@ -84,10 +83,11 @@ let img;
84
83
async function setup () {
85
84
createCanvas (100 , 100 );
86
85
87
- // Make a red background - in 2.0 will be shown while the image loads
86
+ // Red background while asset loads
88
87
background (255 , 0 , 0 );
89
88
90
- img = await loadImage (' /assets/bricks.jpg' );
89
+ // Wait for the image to load
90
+ img = await loadImage (' bricks.jpg' );
91
91
92
92
// Draw the image.
93
93
image (img, 0 , 0 );
@@ -184,7 +184,7 @@ function draw() {
184
184
bezierVertex (50 , 0 , 0 , 50 , 0 , 100 );
185
185
186
186
// Bottom-left curve.
187
- bezierVertex ( 0 , 50 , - 50 , 0 , - 100 , 0 );
187
+ bezierVertex (0 , 50 , - 50 , 0 , - 100 , 0 );
188
188
189
189
// Top-left curve.
190
190
bezierVertex (- 50 , 0 , 0 ,- 50 , 0 ,- 100 );
@@ -205,9 +205,6 @@ function draw() {
205
205
206
206
// Draw the curved star shape.
207
207
beginShape ();
208
-
209
- // Because the order is three, the curves should be
210
- // defined in sets of three after the original anchor
211
208
bezierOrder (3 );
212
209
213
210
// Original anchor at top.
0 commit comments