@@ -857,12 +857,10 @@ function loadingDisplaying(p5, fn){
857
857
* ```js example
858
858
* let img;
859
859
*
860
- * // Load the image.
861
- * function preload() {
862
- * img = loadImage('assets/laDefense.jpg');
863
- * }
860
+ * async function setup() {
861
+ * // Load the image.
862
+ * img = await loadImage('assets/laDefense.jpg');
864
863
*
865
- * function setup() {
866
864
* createCanvas(100, 100);
867
865
*
868
866
* background(50);
@@ -916,12 +914,10 @@ function loadingDisplaying(p5, fn){
916
914
* <code>
917
915
* let img;
918
916
*
919
- * // Load the image.
920
- * function preload() {
921
- * img = loadImage('assets/laDefense.jpg');
922
- * }
917
+ * async function setup() {
918
+ * // Load the image.
919
+ * img = await loadImage('assets/laDefense.jpg');
923
920
*
924
- * function setup() {
925
921
* createCanvas(100, 100);
926
922
*
927
923
* background(50);
@@ -938,12 +934,10 @@ function loadingDisplaying(p5, fn){
938
934
* <code>
939
935
* let img;
940
936
*
941
- * // Load the image.
942
- * function preload() {
943
- * img = loadImage('assets/laDefense.jpg');
944
- * }
937
+ * async function setup() {
938
+ * // Load the image.
939
+ * img = await loadImage('assets/laDefense.jpg');
945
940
*
946
- * function setup() {
947
941
* createCanvas(100, 100);
948
942
*
949
943
* background(50);
@@ -960,12 +954,10 @@ function loadingDisplaying(p5, fn){
960
954
* <code>
961
955
* let img;
962
956
*
963
- * // Load the image.
964
- * function preload() {
965
- * img = loadImage('assets/laDefense.jpg');
966
- * }
957
+ * async function setup() {
958
+ * // Load the image.
959
+ * img = await loadImage('assets/laDefense.jpg');
967
960
*
968
- * function setup() {
969
961
* createCanvas(100, 100);
970
962
*
971
963
* background(50);
@@ -982,12 +974,9 @@ function loadingDisplaying(p5, fn){
982
974
* <code>
983
975
* let img;
984
976
*
985
- * // Load the image.
986
- * function preload() {
987
- * img = loadImage('assets/moonwalk.jpg');
988
- * }
989
- *
990
- * function setup() {
977
+ * async function setup() {
978
+ * // Load the image.
979
+ * img = await loadImage('assets/moonwalk.jpg');
991
980
* createCanvas(100, 100);
992
981
*
993
982
* background(50);
@@ -1004,13 +993,10 @@ function loadingDisplaying(p5, fn){
1004
993
* <code>
1005
994
* let img;
1006
995
*
1007
- * // Load the image.
1008
- * function preload() {
1009
- * // Image is 50 x 50 pixels.
1010
- * img = loadImage('assets/laDefense50.png');
1011
- * }
996
+ * async function setup() {
997
+ * // Load the image.
998
+ * img = await loadImage('assets/laDefense50.jpg');
1012
999
*
1013
- * function setup() {
1014
1000
* createCanvas(100, 100);
1015
1001
*
1016
1002
* background(50);
@@ -1171,12 +1157,10 @@ function loadingDisplaying(p5, fn){
1171
1157
* <code>
1172
1158
* let img;
1173
1159
*
1174
- * // Load the image.
1175
- * function preload() {
1176
- * img = loadImage('assets/laDefense.jpg');
1177
- * }
1160
+ * async function setup() {
1161
+ * // Load the image.
1162
+ * img = await loadImage('assets/laDefense.jpg');
1178
1163
*
1179
- * function setup() {
1180
1164
* createCanvas(100, 100);
1181
1165
*
1182
1166
* // Left image.
@@ -1196,12 +1180,10 @@ function loadingDisplaying(p5, fn){
1196
1180
* <code>
1197
1181
* let img;
1198
1182
*
1199
- * // Load the image.
1200
- * function preload() {
1201
- * img = loadImage('assets/laDefense.jpg');
1202
- * }
1183
+ * async function setup() {
1184
+ * // Load the image.
1185
+ * img = await loadImage('assets/laDefense.jpg');
1203
1186
*
1204
- * function setup() {
1205
1187
* createCanvas(100, 100);
1206
1188
*
1207
1189
* // Left image.
@@ -1220,13 +1202,11 @@ function loadingDisplaying(p5, fn){
1220
1202
* <div>
1221
1203
* <code>
1222
1204
* let img;
1205
+ **
1206
+ * async function setup() {
1207
+ * // Load the image.
1208
+ * img = await loadImage('assets/laDefense.jpg');
1223
1209
*
1224
- * // Load the image.
1225
- * function preload() {
1226
- * img = loadImage('assets/laDefense.jpg');
1227
- * }
1228
- *
1229
- * function setup() {
1230
1210
* createCanvas(100, 100);
1231
1211
*
1232
1212
* // Left.
@@ -1246,12 +1226,10 @@ function loadingDisplaying(p5, fn){
1246
1226
* <code>
1247
1227
* let img;
1248
1228
*
1249
- * // Load the image.
1250
- * function preload() {
1251
- * img = loadImage('assets/laDefense.jpg');
1252
- * }
1229
+ * async function setup() {
1230
+ * // Load the image.
1231
+ * img = await loadImage('assets/laDefense.jpg');
1253
1232
*
1254
- * function setup() {
1255
1233
* createCanvas(100, 100);
1256
1234
*
1257
1235
* // Left.
@@ -1306,12 +1284,10 @@ function loadingDisplaying(p5, fn){
1306
1284
* <code>
1307
1285
* let img;
1308
1286
*
1309
- * // Load the image.
1310
- * function preload() {
1311
- * img = loadImage('assets/laDefense.jpg');
1312
- * }
1287
+ * async function setup() {
1288
+ * // Load the image.
1289
+ * img = await loadImage('assets/laDefense.jpg');
1313
1290
*
1314
- * function setup() {
1315
1291
* createCanvas(100, 100);
1316
1292
*
1317
1293
* // Left.
@@ -1371,12 +1347,10 @@ function loadingDisplaying(p5, fn){
1371
1347
* <code>
1372
1348
* let img;
1373
1349
*
1374
- * // Load the image.
1375
- * function preload() {
1376
- * img = loadImage('assets/bricks.jpg');
1377
- * }
1350
+ * async function setup() {
1351
+ * // Load the image.
1352
+ * img = await loadImage('assets/bricks.jpg');
1378
1353
*
1379
- * function setup() {
1380
1354
* createCanvas(100, 100);
1381
1355
*
1382
1356
* background(200);
@@ -1396,12 +1370,10 @@ function loadingDisplaying(p5, fn){
1396
1370
* <code>
1397
1371
* let img;
1398
1372
*
1399
- * // Load the image.
1400
- * function preload() {
1401
- * img = loadImage('assets/bricks.jpg');
1402
- * }
1373
+ * async function setup() {
1374
+ * // Load the image.
1375
+ * img = await loadImage('assets/bricks.jpg');
1403
1376
*
1404
- * function setup() {
1405
1377
* createCanvas(100, 100);
1406
1378
*
1407
1379
* background(200);
@@ -1421,12 +1393,10 @@ function loadingDisplaying(p5, fn){
1421
1393
* <code>
1422
1394
* let img;
1423
1395
*
1424
- * // Load the image.
1425
- * function preload() {
1426
- * img = loadImage('assets/bricks.jpg');
1427
- * }
1396
+ * async function setup() {
1397
+ * // Load the image.
1398
+ * img = await loadImage('assets/bricks.jpg');
1428
1399
*
1429
- * function setup() {
1430
1400
* createCanvas(100, 100);
1431
1401
*
1432
1402
* background(200);
0 commit comments