You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,8 +48,6 @@ If you’re interested in the history of async [read on here](https://dev.to/lim
48
48
49
49
To play around, check out [the example from the p5.js 1.x `preload()` reference](https://p5js.org/reference/p5/preload/), but get a very big file instead of bricks.jpg.
50
50
51
-
52
-
53
51
<table>
54
52
<tr><th>p5.js 1.x</th><th>p5.js 2.x</th></tr>
55
53
<tr><td>Blank “Loading…” screen, then image shown</td><td>Red background while image loads</td></tr>
@@ -101,6 +99,11 @@ async function setup() {
101
99
102
100
If it takes a while to load the image, the sketch will be "paused" on the line `img = await loadImage('/assets/bricks.jpg');` - once the image is loaded, it will resume.
All of the above usages in p5.js 1.x remain available with the [preload.js](https://github.com/processing/p5.js-compatibility/blob/main/src/preload.js) compatibility add-on library.
104
107
105
108
## …using registerPreloadMethod in an add-on libraries
106
109
@@ -319,7 +322,7 @@ Additional shanges to shapes in p5.js 1.x, compared to p5.js 2.0, are as follows
319
322
* p5.js 1.x has separate `curveDetail()` and `bezierDetail()`
320
323
* p5.js 2.0 uses `curveDetail()` to cover both, as the more general function
321
324
322
-
All of the above usages in p5.js 1.x remain available with the shapes.js compatibility add-on library.
325
+
All of the above usages in p5.js 1.x remain available with the [shapes.js](https://github.com/processing/p5.js-compatibility/blob/main/src/shapes.js) compatibility add-on library.
323
326
324
327
## …using data structures and functions that have improved alternatives
325
328
@@ -343,4 +346,10 @@ The below functions are also better supported in JavaScript itself:
343
346
*`splice()`
344
347
*`subset()`
345
348
346
-
Additionally, `touchStarted()/touchEnded()/touchMoved()` have been replaced with mouse events.
349
+
Finally, touch and mouse event handling has been combined to improve sketch consistency across devices:
350
+
351
+
*`touchStarted()`
352
+
*`touchEnded()`
353
+
*`touchMoved()`
354
+
355
+
All of the above usages in p5.js 1.x remain available with the [data.js](https://github.com/processing/p5.js-compatibility/blob/main/src/data.js) compatibility add-on library.
0 commit comments