Skip to content

Commit 7563201

Browse files
authored
Update README.md with detail on loadTable updates
1 parent ab7f2f3 commit 7563201

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ If you’re interested in the history of async [read on here](https://dev.to/lim
4848

4949
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.
5050

51-
52-
5351
<table>
5452
<tr><th>p5.js 1.x</th><th>p5.js 2.x</th></tr>
5553
<tr><td>Blank “Loading…” screen, then image shown</td><td>Red background while image loads</td></tr>
@@ -101,6 +99,11 @@ async function setup() {
10199

102100
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.
103101

102+
Laslty, some loader functions have been updated:
103+
* The [p5.js 1.x loadTable](https://p5js.org/reference/p5/loadTable/) expects `filename, [extension], [header], [callback], [errorCallback]`
104+
* The [p5.js 2.0 loadTable](https://betap5js.org/reference/p5/loadTable/) expects `filename, [separator], [header], [callback], [errorCallback]`
105+
106+
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.
104107

105108
## …using registerPreloadMethod in an add-on libraries
106109

@@ -319,7 +322,7 @@ Additional shanges to shapes in p5.js 1.x, compared to p5.js 2.0, are as follows
319322
* p5.js 1.x has separate `curveDetail()` and `bezierDetail()`
320323
* p5.js 2.0 uses `curveDetail()` to cover both, as the more general function
321324

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.
323326

324327
## …using data structures and functions that have improved alternatives
325328

@@ -343,4 +346,10 @@ The below functions are also better supported in JavaScript itself:
343346
* `splice()`
344347
* `subset()`
345348

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

Comments
 (0)