p5 2.2.3-rc.1 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +4 -5
  2. package/dist/accessibility/color_namer.js +4 -4
  3. package/dist/accessibility/index.js +4 -4
  4. package/dist/app.js +4 -4
  5. package/dist/color/color_conversion.js +4 -4
  6. package/dist/color/index.js +1 -1
  7. package/dist/color/setting.js +1 -1
  8. package/dist/{constants-BUwWryrh.js → constants-BdTiYOQI.js} +1 -1
  9. package/dist/core/constants.js +1 -1
  10. package/dist/core/environment.js +1 -1
  11. package/dist/core/filterShaders.js +1 -1
  12. package/dist/core/friendly_errors/fes_core.js +1 -1
  13. package/dist/core/friendly_errors/file_errors.js +1 -1
  14. package/dist/core/friendly_errors/index.js +1 -1
  15. package/dist/core/friendly_errors/param_validator.js +1 -1
  16. package/dist/core/friendly_errors/sketch_verifier.js +1 -1
  17. package/dist/core/helpers.js +1 -1
  18. package/dist/core/init.js +4 -4
  19. package/dist/core/internationalization.js +1 -1
  20. package/dist/core/legacy.js +4 -4
  21. package/dist/core/main.js +4 -4
  22. package/dist/core/p5.Graphics.js +3 -3
  23. package/dist/core/p5.Renderer.js +2 -2
  24. package/dist/core/p5.Renderer2D.js +4 -4
  25. package/dist/core/p5.Renderer3D.js +3 -3
  26. package/dist/core/rendering.js +3 -3
  27. package/dist/data/local_storage.js +13 -9
  28. package/dist/dom/dom.js +30 -29
  29. package/dist/dom/index.js +1 -1
  30. package/dist/dom/p5.Element.js +3 -3
  31. package/dist/dom/p5.MediaElement.js +4 -5
  32. package/dist/events/pointer.js +1 -1
  33. package/dist/image/const.js +1 -1
  34. package/dist/image/filterRenderer2D.js +3 -3
  35. package/dist/image/image.js +3 -3
  36. package/dist/image/index.js +3 -3
  37. package/dist/image/loading_displaying.js +3 -3
  38. package/dist/image/p5.Image.js +2 -2
  39. package/dist/io/files.js +3 -3
  40. package/dist/io/index.js +3 -3
  41. package/dist/io/p5.XML.js +8 -8
  42. package/dist/{main-DFpoFdvM.js → main-H_nu4eDs.js} +3 -3
  43. package/dist/math/Matrices/Matrix.js +1 -1
  44. package/dist/math/Matrices/MatrixNumjs.js +1 -1
  45. package/dist/math/index.js +1 -1
  46. package/dist/math/p5.Matrix.js +1 -1
  47. package/dist/math/p5.Vector.js +1 -1
  48. package/dist/math/trigonometry.js +1 -1
  49. package/dist/{p5.Renderer-D-EuAodU.js → p5.Renderer-BmD2P6Wv.js} +4 -3
  50. package/dist/{rendering-DE9-Hl7Y.js → rendering-CC8JNTwG.js} +8 -35
  51. package/dist/shape/2d_primitives.js +1 -1
  52. package/dist/shape/attributes.js +1 -1
  53. package/dist/shape/custom_shapes.js +1 -1
  54. package/dist/shape/index.js +1 -1
  55. package/dist/type/index.js +2 -2
  56. package/dist/type/p5.Font.js +2 -2
  57. package/dist/type/textCore.js +2 -2
  58. package/dist/webgl/3d_primitives.js +3 -3
  59. package/dist/webgl/GeometryBuilder.js +1 -1
  60. package/dist/webgl/ShapeBuilder.js +1 -1
  61. package/dist/webgl/enums.js +1 -1
  62. package/dist/webgl/index.js +3 -3
  63. package/dist/webgl/interaction.js +1 -1
  64. package/dist/webgl/light.js +3 -3
  65. package/dist/webgl/loading.js +4 -6
  66. package/dist/webgl/material.js +3 -3
  67. package/dist/webgl/p5.Camera.js +3 -3
  68. package/dist/webgl/p5.Framebuffer.js +3 -3
  69. package/dist/webgl/p5.Geometry.js +1 -1
  70. package/dist/webgl/p5.Quat.js +1 -1
  71. package/dist/webgl/p5.RendererGL.js +3 -3
  72. package/dist/webgl/p5.Texture.js +3 -3
  73. package/dist/webgl/text.js +3 -3
  74. package/dist/webgl/utils.js +3 -3
  75. package/dist/webgpu/index.js +1 -1
  76. package/dist/webgpu/p5.RendererWebGPU.js +1 -1
  77. package/lib/p5.esm.js +68 -92
  78. package/lib/p5.esm.min.js +1 -1
  79. package/lib/p5.js +68 -92
  80. package/lib/p5.min.js +1 -1
  81. package/lib/p5.webgpu.esm.js +1 -1
  82. package/lib/p5.webgpu.js +1 -1
  83. package/lib/p5.webgpu.min.js +1 -1
  84. package/package.json +1 -1
  85. package/types/global.d.ts +601 -623
  86. package/types/p5.d.ts +297 -308
package/types/global.d.ts CHANGED
@@ -965,9 +965,9 @@ BOTTOM: typeof P5.BOTTOM;
965
965
 
966
966
  /**
967
967
  * A system variable that provides direct access to the sketch's
968
- * `<canvas>` element.
968
+ * `<canvas>` element.
969
969
  *
970
- * The `&lt;canvas&gt;` element provides many specialized features that aren't
970
+ * The `<canvas>` element provides many specialized features that aren't
971
971
  * included in the p5.js library. The `drawingContext` system variable
972
972
  * provides access to these features by exposing the sketch's
973
973
  * <a href="https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D">CanvasRenderingContext2D</a>
@@ -2897,6 +2897,26 @@ EXCLUDE: typeof P5.EXCLUDE;
2897
2897
  byte(n: string | boolean | number): number;
2898
2898
  byte(ns: any[]): number[];
2899
2899
 
2900
+ /**
2901
+ * Creates a custom <a href="#/p5.Geometry">p5.Geometry</a> object from
2902
+ * simpler 3D shapes.
2903
+ *
2904
+ * `buildGeometry()` helps with creating complex 3D shapes from simpler ones
2905
+ * such as <a href="#/p5/sphere">sphere()</a>. It can help to make sketches
2906
+ * more performant. For example, if a complex 3D shape doesn’t change while a
2907
+ * sketch runs, then it can be created with `buildGeometry()`. Creating a
2908
+ * <a href="#/p5.Geometry">p5.Geometry</a> object once and then drawing it
2909
+ * will run faster than repeatedly drawing the individual pieces.
2910
+ *
2911
+ * The parameter, `callback`, is a function with the drawing instructions for
2912
+ * the new <a href="#/p5.Geometry">p5.Geometry</a> object. It will be called
2913
+ * once to create the new 3D shape.
2914
+ * Note: `buildGeometry()` can only be used in WebGL mode.
2915
+ * @param callback function that draws the shape.
2916
+ * @returns new 3D shape.
2917
+ */
2918
+ buildGeometry(callback: Function): P5.Geometry;
2919
+
2900
2920
  /**
2901
2921
  * Calculates coordinates along a Bézier curve using interpolation.
2902
2922
  *
@@ -2927,31 +2947,6 @@ EXCLUDE: typeof P5.EXCLUDE;
2927
2947
  */
2928
2948
  bezierPoint(a: number, b: number, c: number, d: number, t: number): number;
2929
2949
 
2930
- /**
2931
- * Creates a custom <a href="#/p5.Geometry">p5.Geometry</a> object from
2932
- * simpler 3D shapes.
2933
- *
2934
- * `buildGeometry()` helps with creating complex 3D shapes from simpler ones
2935
- * such as <a href="#/p5/sphere">sphere()</a>. It can help to make sketches
2936
- * more performant. For example, if a complex 3D shape doesn’t change while a
2937
- * sketch runs, then it can be created with `buildGeometry()`. Creating a
2938
- * <a href="#/p5.Geometry">p5.Geometry</a> object once and then drawing it
2939
- * will run faster than repeatedly drawing the individual pieces.
2940
- *
2941
- * The parameter, `callback`, is a function with the drawing instructions for
2942
- * the new <a href="#/p5.Geometry">p5.Geometry</a> object. It will be called
2943
- * once to create the new 3D shape.
2944
- *
2945
- * See <a href="#/p5/beginGeometry">beginGeometry()</a> and
2946
- * <a href="#/p5/endGeometry">endGeometry()</a> for another way to build 3D
2947
- * shapes.
2948
- *
2949
- * Note: `buildGeometry()` can only be used in WebGL mode.
2950
- * @param callback function that draws the shape.
2951
- * @returns new 3D shape.
2952
- */
2953
- buildGeometry(callback: Function): P5.Geometry;
2954
-
2955
2950
  /**
2956
2951
  * Loads a 3D model to create a
2957
2952
  * <a href="#/p5.Geometry">p5.Geometry</a> object.
@@ -3111,20 +3106,6 @@ EXCLUDE: typeof P5.EXCLUDE;
3111
3106
  */
3112
3107
  smooth(): void;
3113
3108
 
3114
- /**
3115
- * Removes all items in the web browser's local storage.
3116
- *
3117
- * Web browsers can save small amounts of data using the built-in
3118
- * <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage" target="_blank">localStorage object</a>.
3119
- * Data stored in `localStorage` can be retrieved at any point, even after
3120
- * refreshing a page or restarting the browser. Data are stored as key-value
3121
- * pairs. Calling `clearStorage()` removes all data from `localStorage`.
3122
- *
3123
- * Note: Sensitive data such as passwords or personal information shouldn't be
3124
- * stored in `localStorage`.
3125
- */
3126
- clearStorage(): void;
3127
-
3128
3109
  /**
3129
3110
  * Converts a `Number` into a `String` with a plus or minus sign.
3130
3111
  *
@@ -3160,6 +3141,20 @@ EXCLUDE: typeof P5.EXCLUDE;
3160
3141
  nfp(num: number, left?: number, right?: number): string;
3161
3142
  nfp(nums: number[], left?: number, right?: number): string[];
3162
3143
 
3144
+ /**
3145
+ * Removes all items in the web browser's local storage.
3146
+ *
3147
+ * Web browsers can save small amounts of data using the built-in
3148
+ * <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage" target="_blank">localStorage object</a>.
3149
+ * Data stored in `localStorage` can be retrieved at any point, even after
3150
+ * refreshing a page or restarting the browser. Data are stored as key-value
3151
+ * pairs. Calling `clearStorage()` removes all data from `localStorage`.
3152
+ *
3153
+ * Note: Sensitive data such as passwords or personal information shouldn't be
3154
+ * stored in `localStorage`.
3155
+ */
3156
+ clearStorage(): void;
3157
+
3163
3158
  /**
3164
3159
  * Removes all elements created by p5.js, including any event handlers.
3165
3160
  *
@@ -3402,6 +3397,29 @@ EXCLUDE: typeof P5.EXCLUDE;
3402
3397
  frameRate(fps: number): number;
3403
3398
  frameRate(): number;
3404
3399
 
3400
+ /**
3401
+ * Clears a <a href="#/p5.Geometry">p5.Geometry</a> object from the graphics
3402
+ * processing unit (GPU) memory.
3403
+ *
3404
+ * <a href="#/p5.Geometry">p5.Geometry</a> objects can contain lots of data
3405
+ * about their vertices, surface normals, colors, and so on. Complex 3D shapes
3406
+ * can use lots of memory which is a limited resource in many GPUs. Calling
3407
+ * `freeGeometry()` works with <a href="#/p5.Geometry">p5.Geometry</a> objects
3408
+ * created with <a href="#/p5/buildGeometry">buildGeometry()</a> and
3409
+ * <a href="#/p5/loadModel">loadModel()</a>.
3410
+ *
3411
+ * The parameter, `geometry`, is the <a href="#/p5.Geometry">p5.Geometry</a>
3412
+ * object to be freed.
3413
+ *
3414
+ * Note: A <a href="#/p5.Geometry">p5.Geometry</a> object can still be drawn
3415
+ * after its resources are cleared from GPU memory. It may take longer to draw
3416
+ * the first time it’s redrawn.
3417
+ *
3418
+ * Note: `freeGeometry()` can only be used in WebGL mode.
3419
+ * @param geometry 3D shape whose resources should be freed.
3420
+ */
3421
+ freeGeometry(geometry: P5.Geometry): void;
3422
+
3405
3423
  /**
3406
3424
  * Calculates the cosine of an angle.
3407
3425
  *
@@ -3464,14 +3482,14 @@ EXCLUDE: typeof P5.EXCLUDE;
3464
3482
  specularColor(color: P5.Color): void;
3465
3483
 
3466
3484
  /**
3467
- * Creates a `&lt;div&gt;&lt;/div&gt;` element.
3485
+ * Creates a `<div></div>` element.
3468
3486
  *
3469
- * `&lt;div&gt;&lt;/div&gt;` elements are commonly used as containers for
3487
+ * `<div></div>` elements are commonly used as containers for
3470
3488
  * other elements.
3471
3489
  *
3472
3490
  * The parameter `html` is optional. It accepts a string that sets the
3473
- * inner HTML of the new `&lt;div&gt;&lt;/div&gt;`.
3474
- * @param html inner HTML for the new `&lt;div&gt;&lt;/div&gt;` element.
3491
+ * inner HTML of the new `<div></div>`.
3492
+ * @param html inner HTML for the new `<div></div>` element.
3475
3493
  * @returns new <a href="#/p5.Element">p5.Element</a> object.
3476
3494
  */
3477
3495
  createDiv(html?: string): P5.Element;
@@ -3529,27 +3547,6 @@ EXCLUDE: typeof P5.EXCLUDE;
3529
3547
  boolean(n: string | boolean | number): boolean;
3530
3548
  boolean(ns: any[]): boolean[];
3531
3549
 
3532
- /**
3533
- * Removes an item from the web browser's local storage.
3534
- *
3535
- * Web browsers can save small amounts of data using the built-in
3536
- * <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage" target="_blank">localStorage object</a>.
3537
- * Data stored in `localStorage` can be retrieved at any point, even after
3538
- * refreshing a page or restarting the browser. Data are stored as key-value
3539
- * pairs.
3540
- *
3541
- * <a href="#/p5/storeItem">storeItem()</a> makes it easy to store values in
3542
- * `localStorage` and `removeItem()` makes it easy to delete them.
3543
- *
3544
- * The parameter, `key`, is the name of the value to remove as a string. For
3545
- * example, calling `removeItem('size')` removes the item with the key `size`.
3546
- *
3547
- * Note: Sensitive data such as passwords or personal information shouldn't be
3548
- * stored in `localStorage`.
3549
- * @param key name of the value to remove.
3550
- */
3551
- removeItem(key: string): void;
3552
-
3553
3550
  /**
3554
3551
  * Rotates the coordinate system.
3555
3552
  *
@@ -3585,31 +3582,25 @@ EXCLUDE: typeof P5.EXCLUDE;
3585
3582
  rotate(angle: number, axis?: P5.Vector | number[]): void;
3586
3583
 
3587
3584
  /**
3588
- * Clears a <a href="#/p5.Geometry">p5.Geometry</a> object from the graphics
3589
- * processing unit (GPU) memory.
3585
+ * Removes an item from the web browser's local storage.
3590
3586
  *
3591
- * <a href="#/p5.Geometry">p5.Geometry</a> objects can contain lots of data
3592
- * about their vertices, surface normals, colors, and so on. Complex 3D shapes
3593
- * can use lots of memory which is a limited resource in many GPUs. Calling
3594
- * `freeGeometry()` can improve performance by freeing a
3595
- * <a href="#/p5.Geometry">p5.Geometry</a> object’s resources from GPU memory.
3596
- * `freeGeometry()` works with <a href="#/p5.Geometry">p5.Geometry</a> objects
3597
- * created with <a href="#/p5/beginGeometry">beginGeometry()</a> and
3598
- * <a href="#/p5/endGeometry">endGeometry()</a>,
3599
- * <a href="#/p5/buildGeometry">buildGeometry()</a>, and
3600
- * <a href="#/p5/loadModel">loadModel()</a>.
3587
+ * Web browsers can save small amounts of data using the built-in
3588
+ * <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage" target="_blank">localStorage object</a>.
3589
+ * Data stored in `localStorage` can be retrieved at any point, even after
3590
+ * refreshing a page or restarting the browser. Data are stored as key-value
3591
+ * pairs.
3601
3592
  *
3602
- * The parameter, `geometry`, is the <a href="#/p5.Geometry">p5.Geometry</a>
3603
- * object to be freed.
3593
+ * <a href="#/p5/storeItem">storeItem()</a> makes it easy to store values in
3594
+ * `localStorage` and `removeItem()` makes it easy to delete them.
3604
3595
  *
3605
- * Note: A <a href="#/p5.Geometry">p5.Geometry</a> object can still be drawn
3606
- * after its resources are cleared from GPU memory. It may take longer to draw
3607
- * the first time it’s redrawn.
3596
+ * The parameter, `key`, is the name of the value to remove as a string. For
3597
+ * example, calling `removeItem('size')` removes the item with the key `size`.
3608
3598
  *
3609
- * Note: `freeGeometry()` can only be used in WebGL mode.
3610
- * @param geometry 3D shape whose resources should be freed.
3599
+ * Note: Sensitive data such as passwords or personal information shouldn't be
3600
+ * stored in `localStorage`.
3601
+ * @param key name of the value to remove.
3611
3602
  */
3612
- freeGeometry(geometry: P5.Geometry): void;
3603
+ removeItem(key: string): void;
3613
3604
 
3614
3605
  /**
3615
3606
  * The <a href="#/p5/setMoveThreshold">setMoveThreshold()</a> function is used to set the movement threshold for
@@ -3699,11 +3690,11 @@ EXCLUDE: typeof P5.EXCLUDE;
3699
3690
  /**
3700
3691
  * Creates a paragraph element.
3701
3692
  *
3702
- * `&lt;p&gt;&lt;/p&gt;` elements are commonly used for paragraph-length text.
3693
+ * `<p></p>` elements are commonly used for paragraph-length text.
3703
3694
  *
3704
3695
  * The parameter `html` is optional. It accepts a string that sets the
3705
- * inner HTML of the new `&lt;p&gt;&lt;/p&gt;`.
3706
- * @param html inner HTML for the new `&lt;p&gt;&lt;/p&gt;` element.
3696
+ * inner HTML of the new `<p></p>`.
3697
+ * @param html inner HTML for the new `<p></p>` element.
3707
3698
  * @returns new <a href="#/p5.Element">p5.Element</a> object.
3708
3699
  */
3709
3700
  createP(html?: string): P5.Element;
@@ -4137,6 +4128,38 @@ EXCLUDE: typeof P5.EXCLUDE;
4137
4128
  */
4138
4129
  loadTable(filename: string | Request, separator?: string, header?: string, callback?: Function, errorCallback?: Function): Promise<object>;
4139
4130
 
4131
+ /**
4132
+ * Draws a plane.
4133
+ *
4134
+ * A plane is a four-sided, flat shape with every angle measuring 90˚. It’s
4135
+ * similar to a rectangle and offers advanced drawing features in WebGL mode.
4136
+ *
4137
+ * The first parameter, `width`, is optional. If a `Number` is passed, as in
4138
+ * `plane(20)`, it sets the plane’s width and height. By default, `width` is
4139
+ * 50.
4140
+ *
4141
+ * The second parameter, `height`, is also optional. If a `Number` is passed,
4142
+ * as in `plane(20, 30)`, it sets the plane’s height. By default, `height` is
4143
+ * set to the plane’s `width`.
4144
+ *
4145
+ * The third parameter, `detailX`, is also optional. If a `Number` is passed,
4146
+ * as in `plane(20, 30, 5)` it sets the number of triangle subdivisions to use
4147
+ * along the x-axis. All 3D shapes are made by connecting triangles to form
4148
+ * their surfaces. By default, `detailX` is 1.
4149
+ *
4150
+ * The fourth parameter, `detailY`, is also optional. If a `Number` is passed,
4151
+ * as in `plane(20, 30, 5, 7)` it sets the number of triangle subdivisions to
4152
+ * use along the y-axis. All 3D shapes are made by connecting triangles to
4153
+ * form their surfaces. By default, `detailY` is 1.
4154
+ *
4155
+ * Note: `plane()` can only be used in WebGL mode.
4156
+ * @param width width of the plane.
4157
+ * @param height height of the plane.
4158
+ * @param detailX number of triangle subdivisions along the x-axis.
4159
+ * @param detailY number of triangle subdivisions along the y-axis.
4160
+ */
4161
+ plane(width?: number, height?: number, detailX?: number, detailY?: number): void;
4162
+
4140
4163
  /**
4141
4164
  * Gets the red value of a color.
4142
4165
  *
@@ -4222,16 +4245,16 @@ EXCLUDE: typeof P5.EXCLUDE;
4222
4245
  tan(angle: number): number;
4223
4246
 
4224
4247
  /**
4225
- * Creates a `&lt;span&gt;&lt;/span&gt;` element.
4248
+ * Creates a `<span></span>` element.
4226
4249
  *
4227
- * `&lt;span&gt;&lt;/span&gt;` elements are commonly used as containers
4228
- * for inline elements. For example, a `&lt;span&gt;&lt;/span&gt;`
4250
+ * `<span></span>` elements are commonly used as containers
4251
+ * for inline elements. For example, a `<span></span>`
4229
4252
  * can hold part of a sentence that's a
4230
4253
  * <span style="color: deeppink;">different</span> style.
4231
4254
  *
4232
4255
  * The parameter `html` is optional. It accepts a string that sets the
4233
- * inner HTML of the new `&lt;span&gt;&lt;/span&gt;`.
4234
- * @param html inner HTML for the new `&lt;span&gt;&lt;/span&gt;` element.
4256
+ * inner HTML of the new `<span></span>`.
4257
+ * @param html inner HTML for the new `<span></span>` element.
4235
4258
  * @returns new <a href="#/p5.Element">p5.Element</a> object.
4236
4259
  */
4237
4260
  createSpan(html?: string): P5.Element;
@@ -4284,38 +4307,6 @@ EXCLUDE: typeof P5.EXCLUDE;
4284
4307
  */
4285
4308
  loadFilterShader(filename: string, successCallback?: Function, failureCallback?: Function): Promise<P5.Shader>;
4286
4309
 
4287
- /**
4288
- * Draws a plane.
4289
- *
4290
- * A plane is a four-sided, flat shape with every angle measuring 90˚. It’s
4291
- * similar to a rectangle and offers advanced drawing features in WebGL mode.
4292
- *
4293
- * The first parameter, `width`, is optional. If a `Number` is passed, as in
4294
- * `plane(20)`, it sets the plane’s width and height. By default, `width` is
4295
- * 50.
4296
- *
4297
- * The second parameter, `height`, is also optional. If a `Number` is passed,
4298
- * as in `plane(20, 30)`, it sets the plane’s height. By default, `height` is
4299
- * set to the plane’s `width`.
4300
- *
4301
- * The third parameter, `detailX`, is also optional. If a `Number` is passed,
4302
- * as in `plane(20, 30, 5)` it sets the number of triangle subdivisions to use
4303
- * along the x-axis. All 3D shapes are made by connecting triangles to form
4304
- * their surfaces. By default, `detailX` is 1.
4305
- *
4306
- * The fourth parameter, `detailY`, is also optional. If a `Number` is passed,
4307
- * as in `plane(20, 30, 5, 7)` it sets the number of triangle subdivisions to
4308
- * use along the y-axis. All 3D shapes are made by connecting triangles to
4309
- * form their surfaces. By default, `detailY` is 1.
4310
- *
4311
- * Note: `plane()` can only be used in WebGL mode.
4312
- * @param width width of the plane.
4313
- * @param height height of the plane.
4314
- * @param detailX number of triangle subdivisions along the x-axis.
4315
- * @param detailY number of triangle subdivisions along the y-axis.
4316
- */
4317
- plane(width?: number, height?: number, detailX?: number, detailY?: number): void;
4318
-
4319
4310
  /**
4320
4311
  * Creates and a new <a href="#/p5.Framebuffer">p5.Framebuffer</a> object.
4321
4312
  *
@@ -4425,7 +4416,7 @@ EXCLUDE: typeof P5.EXCLUDE;
4425
4416
  map(value: number, start1: number, stop1: number, start2: number, stop2: number, withinBounds?: boolean): number;
4426
4417
 
4427
4418
  /**
4428
- * Creates an `&lt;img&gt;` element that can appear outside of the canvas.
4419
+ * Creates an `<img>` element that can appear outside of the canvas.
4429
4420
  *
4430
4421
  * The first parameter, `src`, is a string with the path to the image file.
4431
4422
  * `src` should be a relative path, as in `'assets/image.png'`, or a URL, as
@@ -4683,6 +4674,42 @@ EXCLUDE: typeof P5.EXCLUDE;
4683
4674
  */
4684
4675
  green(color: P5.Color | number[] | string): number;
4685
4676
 
4677
+ /**
4678
+ * Draws a box (rectangular prism).
4679
+ *
4680
+ * A box is a 3D shape with six faces. Each face makes a 90˚ with four
4681
+ * neighboring faces.
4682
+ *
4683
+ * The first parameter, `width`, is optional. If a `Number` is passed, as in
4684
+ * `box(20)`, it sets the box’s width and height. By default, `width` is 50.
4685
+ *
4686
+ * The second parameter, `height`, is also optional. If a `Number` is passed,
4687
+ * as in `box(20, 30)`, it sets the box’s height. By default, `height` is set
4688
+ * to the box’s `width`.
4689
+ *
4690
+ * The third parameter, `depth`, is also optional. If a `Number` is passed, as
4691
+ * in `box(20, 30, 40)`, it sets the box’s depth. By default, `depth` is set
4692
+ * to the box’s `height`.
4693
+ *
4694
+ * The fourth parameter, `detailX`, is also optional. If a `Number` is passed,
4695
+ * as in `box(20, 30, 40, 5)`, it sets the number of triangle subdivisions to
4696
+ * use along the x-axis. All 3D shapes are made by connecting triangles to
4697
+ * form their surfaces. By default, `detailX` is 1.
4698
+ *
4699
+ * The fifth parameter, `detailY`, is also optional. If a number is passed, as
4700
+ * in `box(20, 30, 40, 5, 7)`, it sets the number of triangle subdivisions to
4701
+ * use along the y-axis. All 3D shapes are made by connecting triangles to
4702
+ * form their surfaces. By default, `detailY` is 1.
4703
+ *
4704
+ * Note: `box()` can only be used in WebGL mode.
4705
+ * @param width width of the box.
4706
+ * @param height height of the box.
4707
+ * @param depth depth of the box.
4708
+ * @param detailX number of triangle subdivisions along the x-axis.
4709
+ * @param detailY number of triangle subdivisions along the y-axis.
4710
+ */
4711
+ box(width?: number, height?: number, depth?: number, detailX?: number, detailY?: number): void;
4712
+
4686
4713
  /**
4687
4714
  * Returns the largest value in a sequence of numbers.
4688
4715
  *
@@ -4733,7 +4760,7 @@ EXCLUDE: typeof P5.EXCLUDE;
4733
4760
  bezierVertex(x: number, y: number, z: number, u?: number, v?: number): void;
4734
4761
 
4735
4762
  /**
4736
- * Creates an `&lt;a&gt;&lt;/a&gt;` element that links to another web page.
4763
+ * Creates an `<a></a>` element that links to another web page.
4737
4764
  *
4738
4765
  * The first parmeter, `href`, is a string that sets the URL of the linked
4739
4766
  * page.
@@ -4891,52 +4918,16 @@ EXCLUDE: typeof P5.EXCLUDE;
4891
4918
  clear(): void;
4892
4919
 
4893
4920
  /**
4894
- * Draws a box (rectangular prism).
4921
+ * Converts a `Number` or `String` to a single-character `String`.
4895
4922
  *
4896
- * A box is a 3D shape with six faces. Each face makes a 90˚ with four
4897
- * neighboring faces.
4923
+ * `char()` converts numbers to their single-character string representations.
4898
4924
  *
4899
- * The first parameter, `width`, is optional. If a `Number` is passed, as in
4900
- * `box(20)`, it sets the box’s width and height. By default, `width` is 50.
4901
- *
4902
- * The second parameter, `height`, is also optional. If a `Number` is passed,
4903
- * as in `box(20, 30)`, it sets the box’s height. By default, `height` is set
4904
- * to the box’s `width`.
4905
- *
4906
- * The third parameter, `depth`, is also optional. If a `Number` is passed, as
4907
- * in `box(20, 30, 40)`, it sets the box’s depth. By default, `depth` is set
4908
- * to the box’s `height`.
4909
- *
4910
- * The fourth parameter, `detailX`, is also optional. If a `Number` is passed,
4911
- * as in `box(20, 30, 40, 5)`, it sets the number of triangle subdivisions to
4912
- * use along the x-axis. All 3D shapes are made by connecting triangles to
4913
- * form their surfaces. By default, `detailX` is 1.
4914
- *
4915
- * The fifth parameter, `detailY`, is also optional. If a number is passed, as
4916
- * in `box(20, 30, 40, 5, 7)`, it sets the number of triangle subdivisions to
4917
- * use along the y-axis. All 3D shapes are made by connecting triangles to
4918
- * form their surfaces. By default, `detailY` is 1.
4919
- *
4920
- * Note: `box()` can only be used in WebGL mode.
4921
- * @param width width of the box.
4922
- * @param height height of the box.
4923
- * @param depth depth of the box.
4924
- * @param detailX number of triangle subdivisions along the x-axis.
4925
- * @param detailY number of triangle subdivisions along the y-axis.
4926
- */
4927
- box(width?: number, height?: number, depth?: number, detailX?: number, detailY?: number): void;
4928
-
4929
- /**
4930
- * Converts a `Number` or `String` to a single-character `String`.
4931
- *
4932
- * `char()` converts numbers to their single-character string representations.
4933
- *
4934
- * The parameter, `n`, is the value to convert. If a number is passed, as in
4935
- * `char(65)`, the corresponding single-character string is returned. If a
4936
- * string is passed, as in `char('65')`, the string is converted to an integer
4937
- * (whole number) and the corresponding single-character string is returned.
4938
- * If an array is passed, as in `char([65, 66, 67])`, an array of
4939
- * single-character strings is returned.
4925
+ * The parameter, `n`, is the value to convert. If a number is passed, as in
4926
+ * `char(65)`, the corresponding single-character string is returned. If a
4927
+ * string is passed, as in `char('65')`, the string is converted to an integer
4928
+ * (whole number) and the corresponding single-character string is returned.
4929
+ * If an array is passed, as in `char([65, 66, 67])`, an array of
4930
+ * single-character strings is returned.
4940
4931
  *
4941
4932
  * See <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode" target="_blank">MDN</a>
4942
4933
  * for more information about conversions.
@@ -5070,7 +5061,7 @@ EXCLUDE: typeof P5.EXCLUDE;
5070
5061
  * (<a href="https://developer.mozilla.org/en-US/docs/Web/XML/XML_introduction" target="_blank">XML</a>)
5071
5062
  * is a standard format for sending data between applications. Like HTML, the
5072
5063
  * XML format is based on tags and attributes, as in
5073
- * `&lt;time units="s"&gt;1234&lt;/time&gt;`.
5064
+ * `<time units="s">1234</time>`.
5074
5065
  *
5075
5066
  * The first parameter, `path`, is always a string with the path to the file.
5076
5067
  * Paths to local files should be relative, as in
@@ -5239,6 +5230,33 @@ EXCLUDE: typeof P5.EXCLUDE;
5239
5230
  angleMode(mode: typeof P5.RADIANS | typeof P5.DEGREES): typeof P5.RADIANS | typeof P5.DEGREES;
5240
5231
  angleMode(): typeof P5.RADIANS | typeof P5.DEGREES;
5241
5232
 
5233
+ /**
5234
+ * Draws a sphere.
5235
+ *
5236
+ * A sphere is a 3D shape with triangular faces that connect to form a round
5237
+ * surface. Spheres with few faces look like crystals. Spheres with many faces
5238
+ * have smooth surfaces and look like balls.
5239
+ *
5240
+ * The first parameter, `radius`, is optional. If a `Number` is passed, as in
5241
+ * `sphere(20)`, it sets the radius of the sphere. By default, `radius` is 50.
5242
+ *
5243
+ * The second parameter, `detailX`, is also optional. If a `Number` is passed,
5244
+ * as in `sphere(20, 5)`, it sets the number of triangle subdivisions to use
5245
+ * along the x-axis. All 3D shapes are made by connecting triangles to form
5246
+ * their surfaces. By default, `detailX` is 24.
5247
+ *
5248
+ * The third parameter, `detailY`, is also optional. If a `Number` is passed,
5249
+ * as in `sphere(20, 5, 2)`, it sets the number of triangle subdivisions to
5250
+ * use along the y-axis. All 3D shapes are made by connecting triangles to
5251
+ * form their surfaces. By default, `detailY` is 16.
5252
+ *
5253
+ * Note: `sphere()` can only be used in WebGL mode.
5254
+ * @param radius radius of the sphere. Defaults to 50.
5255
+ * @param detailX number of triangle subdivisions along the x-axis. Defaults to 24.
5256
+ * @param detailY number of triangle subdivisions along the y-axis. Defaults to 16.
5257
+ */
5258
+ sphere(radius?: number, detailX?: number, detailY?: number): void;
5259
+
5242
5260
  /**
5243
5261
  * Loads the current value of each pixel on the canvas into the
5244
5262
  * <a href="#/p5/pixels">pixels</a> array.
@@ -5423,7 +5441,7 @@ EXCLUDE: typeof P5.EXCLUDE;
5423
5441
  loadBytes(file: string | Request, callback?: Function, errorCallback?: Function): Promise<Uint8Array>;
5424
5442
 
5425
5443
  /**
5426
- * Creates a slider `&lt;input&gt;&lt;/input&gt;` element.
5444
+ * Creates a slider `<input></input>` element.
5427
5445
  *
5428
5446
  * Range sliders are useful for quickly selecting numbers from a given range.
5429
5447
  *
@@ -5460,33 +5478,6 @@ EXCLUDE: typeof P5.EXCLUDE;
5460
5478
  */
5461
5479
  norm(value: number, start: number, stop: number): number;
5462
5480
 
5463
- /**
5464
- * Draws a sphere.
5465
- *
5466
- * A sphere is a 3D shape with triangular faces that connect to form a round
5467
- * surface. Spheres with few faces look like crystals. Spheres with many faces
5468
- * have smooth surfaces and look like balls.
5469
- *
5470
- * The first parameter, `radius`, is optional. If a `Number` is passed, as in
5471
- * `sphere(20)`, it sets the radius of the sphere. By default, `radius` is 50.
5472
- *
5473
- * The second parameter, `detailX`, is also optional. If a `Number` is passed,
5474
- * as in `sphere(20, 5)`, it sets the number of triangle subdivisions to use
5475
- * along the x-axis. All 3D shapes are made by connecting triangles to form
5476
- * their surfaces. By default, `detailX` is 24.
5477
- *
5478
- * The third parameter, `detailY`, is also optional. If a `Number` is passed,
5479
- * as in `sphere(20, 5, 2)`, it sets the number of triangle subdivisions to
5480
- * use along the y-axis. All 3D shapes are made by connecting triangles to
5481
- * form their surfaces. By default, `detailY` is 16.
5482
- *
5483
- * Note: `sphere()` can only be used in WebGL mode.
5484
- * @param radius radius of the sphere. Defaults to 50.
5485
- * @param detailX number of triangle subdivisions along the x-axis. Defaults to 24.
5486
- * @param detailY number of triangle subdivisions along the y-axis. Defaults to 16.
5487
- */
5488
- sphere(radius?: number, detailX?: number, detailY?: number): void;
5489
-
5490
5481
  /**
5491
5482
  * A function that's called once when any key is released.
5492
5483
  *
@@ -5677,7 +5668,7 @@ EXCLUDE: typeof P5.EXCLUDE;
5677
5668
  alpha(color: P5.Color | number[] | string): number;
5678
5669
 
5679
5670
  /**
5680
- * Creates a `&lt;button&gt;&lt;/button&gt;` element.
5671
+ * Creates a `<button></button>` element.
5681
5672
  *
5682
5673
  * The first parameter, `label`, is a string that sets the label displayed on
5683
5674
  * the button.
@@ -5968,7 +5959,7 @@ EXCLUDE: typeof P5.EXCLUDE;
5968
5959
  panorama(img: P5.Image): void;
5969
5960
 
5970
5961
  /**
5971
- * Creates a checkbox `&lt;input&gt;&lt;/input&gt;` element.
5962
+ * Creates a checkbox `<input></input>` element.
5972
5963
  *
5973
5964
  * Checkboxes extend the <a href="#/p5.Element">p5.Element</a> class with a
5974
5965
  * `checked()` method. Calling `myBox.checked()` returns `true` if it the box
@@ -6044,6 +6035,50 @@ EXCLUDE: typeof P5.EXCLUDE;
6044
6035
  */
6045
6036
  hue(color: P5.Color | number[] | string): number;
6046
6037
 
6038
+ /**
6039
+ * Draws a cylinder.
6040
+ *
6041
+ * A cylinder is a 3D shape with triangular faces that connect a flat bottom
6042
+ * to a flat top. Cylinders with few faces look like boxes. Cylinders with
6043
+ * many faces have smooth surfaces.
6044
+ *
6045
+ * The first parameter, `radius`, is optional. If a `Number` is passed, as in
6046
+ * `cylinder(20)`, it sets the radius of the cylinder’s base. By default,
6047
+ * `radius` is 50.
6048
+ *
6049
+ * The second parameter, `height`, is also optional. If a `Number` is passed,
6050
+ * as in `cylinder(20, 30)`, it sets the cylinder’s height. By default,
6051
+ * `height` is set to the cylinder’s `radius`.
6052
+ *
6053
+ * The third parameter, `detailX`, is also optional. If a `Number` is passed,
6054
+ * as in `cylinder(20, 30, 5)`, it sets the number of edges used to form the
6055
+ * cylinder's top and bottom. Using more edges makes the top and bottom look
6056
+ * more like circles. By default, `detailX` is 24.
6057
+ *
6058
+ * The fourth parameter, `detailY`, is also optional. If a `Number` is passed,
6059
+ * as in `cylinder(20, 30, 5, 2)`, it sets the number of triangle subdivisions
6060
+ * to use along the y-axis, between cylinder's the top and bottom. All 3D
6061
+ * shapes are made by connecting triangles to form their surfaces. By default,
6062
+ * `detailY` is 1.
6063
+ *
6064
+ * The fifth parameter, `bottomCap`, is also optional. If a `false` is passed,
6065
+ * as in `cylinder(20, 30, 5, 2, false)` the cylinder’s bottom won’t be drawn.
6066
+ * By default, `bottomCap` is `true`.
6067
+ *
6068
+ * The sixth parameter, `topCap`, is also optional. If a `false` is passed, as
6069
+ * in `cylinder(20, 30, 5, 2, false, false)` the cylinder’s top won’t be
6070
+ * drawn. By default, `topCap` is `true`.
6071
+ *
6072
+ * Note: `cylinder()` can only be used in WebGL mode.
6073
+ * @param radius radius of the cylinder. Defaults to 50.
6074
+ * @param height height of the cylinder. Defaults to the value of `radius`.
6075
+ * @param detailX number of edges along the top and bottom. Defaults to 24.
6076
+ * @param detailY number of triangle subdivisions along the y-axis. Defaults to 1.
6077
+ * @param bottomCap whether to draw the cylinder's bottom. Defaults to `true`.
6078
+ * @param topCap whether to draw the cylinder's top. Defaults to `true`.
6079
+ */
6080
+ cylinder(radius?: number, height?: number, detailX?: number, detailY?: number, bottomCap?: boolean, topCap?: boolean): void;
6081
+
6047
6082
  /**
6048
6083
  * Scales the coordinate system.
6049
6084
  *
@@ -6163,50 +6198,6 @@ EXCLUDE: typeof P5.EXCLUDE;
6163
6198
  httpPost(path: string | Request, data: object | boolean, callback?: Function, errorCallback?: Function): Promise<any>;
6164
6199
  httpPost(path: string | Request, callback?: Function, errorCallback?: Function): Promise<any>;
6165
6200
 
6166
- /**
6167
- * Draws a cylinder.
6168
- *
6169
- * A cylinder is a 3D shape with triangular faces that connect a flat bottom
6170
- * to a flat top. Cylinders with few faces look like boxes. Cylinders with
6171
- * many faces have smooth surfaces.
6172
- *
6173
- * The first parameter, `radius`, is optional. If a `Number` is passed, as in
6174
- * `cylinder(20)`, it sets the radius of the cylinder’s base. By default,
6175
- * `radius` is 50.
6176
- *
6177
- * The second parameter, `height`, is also optional. If a `Number` is passed,
6178
- * as in `cylinder(20, 30)`, it sets the cylinder’s height. By default,
6179
- * `height` is set to the cylinder’s `radius`.
6180
- *
6181
- * The third parameter, `detailX`, is also optional. If a `Number` is passed,
6182
- * as in `cylinder(20, 30, 5)`, it sets the number of edges used to form the
6183
- * cylinder's top and bottom. Using more edges makes the top and bottom look
6184
- * more like circles. By default, `detailX` is 24.
6185
- *
6186
- * The fourth parameter, `detailY`, is also optional. If a `Number` is passed,
6187
- * as in `cylinder(20, 30, 5, 2)`, it sets the number of triangle subdivisions
6188
- * to use along the y-axis, between cylinder's the top and bottom. All 3D
6189
- * shapes are made by connecting triangles to form their surfaces. By default,
6190
- * `detailY` is 1.
6191
- *
6192
- * The fifth parameter, `bottomCap`, is also optional. If a `false` is passed,
6193
- * as in `cylinder(20, 30, 5, 2, false)` the cylinder’s bottom won’t be drawn.
6194
- * By default, `bottomCap` is `true`.
6195
- *
6196
- * The sixth parameter, `topCap`, is also optional. If a `false` is passed, as
6197
- * in `cylinder(20, 30, 5, 2, false, false)` the cylinder’s top won’t be
6198
- * drawn. By default, `topCap` is `true`.
6199
- *
6200
- * Note: `cylinder()` can only be used in WebGL mode.
6201
- * @param radius radius of the cylinder. Defaults to 50.
6202
- * @param height height of the cylinder. Defaults to the value of `radius`.
6203
- * @param detailX number of edges along the top and bottom. Defaults to 24.
6204
- * @param detailY number of triangle subdivisions along the y-axis. Defaults to 1.
6205
- * @param bottomCap whether to draw the cylinder's bottom. Defaults to `true`.
6206
- * @param topCap whether to draw the cylinder's top. Defaults to `true`.
6207
- */
6208
- cylinder(radius?: number, height?: number, detailX?: number, detailY?: number, bottomCap?: boolean, topCap?: boolean): void;
6209
-
6210
6201
  /**
6211
6202
  * Returns the sketch's current
6212
6203
  * <a href="https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL" target="_blank">URL</a>
@@ -6804,7 +6795,7 @@ EXCLUDE: typeof P5.EXCLUDE;
6804
6795
  * Sets the element's content.
6805
6796
  *
6806
6797
  * An element's content is the text between its tags. For example, the element
6807
- * `&lt;language&gt;JavaScript&lt;/language&gt;` has the content `JavaScript`.
6798
+ * `<language>JavaScript</language>` has the content `JavaScript`.
6808
6799
  *
6809
6800
  * The parameter, `content`, is a string with the element's new content.
6810
6801
  * @param content new content for the element.
@@ -6817,9 +6808,7 @@ EXCLUDE: typeof P5.EXCLUDE;
6817
6808
  * The parameter, `model`, is the
6818
6809
  * <a href="#/p5.Geometry">p5.Geometry</a> object to draw.
6819
6810
  * <a href="#/p5.Geometry">p5.Geometry</a> objects can be built with
6820
- * <a href="#/p5/buildGeometry">buildGeometry()</a>, or
6821
- * <a href="#/p5/beginGeometry">beginGeometry()</a> and
6822
- * <a href="#/p5/endGeometry">endGeometry()</a>. They can also be loaded from
6811
+ * <a href="#/p5/buildGeometry">buildGeometry()</a>. They can also be loaded from
6823
6812
  * a file with <a href="#/p5/loadGeometry">loadGeometry()</a>.
6824
6813
  *
6825
6814
  * Note: `model()` can only be used in WebGL mode.
@@ -6927,11 +6916,11 @@ EXCLUDE: typeof P5.EXCLUDE;
6927
6916
  saturation(color: P5.Color | number[] | string): number;
6928
6917
 
6929
6918
  /**
6930
- * Creates a dropdown menu `&lt;select&gt;&lt;/select&gt;` element.
6919
+ * Creates a dropdown menu `<select></select>` element.
6931
6920
  *
6932
6921
  * The parameter is optional. If `true` is passed, as in
6933
6922
  * `let mySelect = createSelect(true)`, then the dropdown will support
6934
- * multiple selections. If an existing `&lt;select&gt;&lt;/select&gt;` element
6923
+ * multiple selections. If an existing `<select></select>` element
6935
6924
  * is passed, as in `let mySelect = createSelect(otherSelect)`, the existing
6936
6925
  * element will be wrapped in a new <a href="#/p5.Element">p5.Element</a>
6937
6926
  * object.
@@ -6960,20 +6949,6 @@ EXCLUDE: typeof P5.EXCLUDE;
6960
6949
  createSelect(multiple?: boolean): P5.Element;
6961
6950
  createSelect(existing: object): P5.Element;
6962
6951
 
6963
- /**
6964
- * Converts 3D world coordinates to 2D screen coordinates.
6965
- *
6966
- * This function takes a 3D vector and converts its coordinates
6967
- * from the world space to screen space. This can be useful for placing
6968
- * 2D elements in a 3D scene or for determining the screen position
6969
- * of 3D objects.
6970
- * @param x The x coordinate in world space. (Or a vector for all three coordinates.)
6971
- * @param y The y coordinate in world space.
6972
- * @param z The z coordinate in world space.
6973
- * @returns A vector containing the 2D screen coordinates.
6974
- */
6975
- worldToScreen(x: number | P5.Vector, y: number, z?: number): P5.Vector;
6976
-
6977
6952
  /**
6978
6953
  * Draws a cone.
6979
6954
  *
@@ -7012,6 +6987,20 @@ EXCLUDE: typeof P5.EXCLUDE;
7012
6987
  */
7013
6988
  cone(radius?: number, height?: number, detailX?: number, detailY?: number, cap?: boolean): void;
7014
6989
 
6990
+ /**
6991
+ * Converts 3D world coordinates to 2D screen coordinates.
6992
+ *
6993
+ * This function takes a 3D vector and converts its coordinates
6994
+ * from the world space to screen space. This can be useful for placing
6995
+ * 2D elements in a 3D scene or for determining the screen position
6996
+ * of 3D objects.
6997
+ * @param x The x coordinate in world space. (Or a vector for all three coordinates.)
6998
+ * @param y The y coordinate in world space.
6999
+ * @param z The z coordinate in world space.
7000
+ * @returns A vector containing the 2D screen coordinates.
7001
+ */
7002
+ worldToScreen(x: number | P5.Vector, y: number, z?: number): P5.Vector;
7003
+
7015
7004
  /**
7016
7005
  * Load a 3d model from an OBJ or STL string.
7017
7006
  *
@@ -7926,8 +7915,8 @@ EXCLUDE: typeof P5.EXCLUDE;
7926
7915
  *
7927
7916
  * The parameter is optional. If a string is passed, as in
7928
7917
  * `let myRadio = createSelect('food')`, then each radio option will
7929
- * have `"food"` as its `name` parameter: `&lt;input name="food"&gt;&lt;/input&gt;`.
7930
- * If an existing `&lt;div&gt;&lt;/div&gt;` or `&lt;span&gt;&lt;/span&gt;`
7918
+ * have `"food"` as its `name` parameter: `<input name="food"></input>`.
7919
+ * If an existing `<div></div>` or `<span></span>`
7931
7920
  * element is passed, as in `let myRadio = createSelect(container)`, it will
7932
7921
  * become the radio button's parent element.
7933
7922
  *
@@ -7943,8 +7932,8 @@ EXCLUDE: typeof P5.EXCLUDE;
7943
7932
  * - `myRadio.selected(value)` selects the given option and returns it as an <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement" target="_blank">`HTMLInputElement`</a>.
7944
7933
  *
7945
7934
  * - `myRadio.disable(shouldDisable)` enables the entire radio button if `true` is passed and disables it if `false` is passed.
7946
- * @param containerElement container HTML Element, either a `&lt;div&gt;&lt;/div&gt;`
7947
- * or `&lt;span&gt;&lt;/span&gt;`.
7935
+ * @param containerElement container HTML Element, either a `<div></div>`
7936
+ * or `<span></span>`.
7948
7937
  * @returns new <a href="#/p5.Element">p5.Element</a> object.
7949
7938
  */
7950
7939
  createRadio(containerElement?: object): P5.Element;
@@ -7952,7 +7941,7 @@ EXCLUDE: typeof P5.EXCLUDE;
7952
7941
  createRadio(): P5.Element;
7953
7942
 
7954
7943
  /**
7955
- * Creates a `&lt;video&gt;` element for simple audio/video playback.
7944
+ * Creates a `<video>` element for simple audio/video playback.
7956
7945
  *
7957
7946
  * `createVideo()` returns a new
7958
7947
  * <a href="#/p5.MediaElement">p5.MediaElement</a> object. Videos are shown by
@@ -8041,7 +8030,7 @@ EXCLUDE: typeof P5.EXCLUDE;
8041
8030
  lerpColor(c1: P5.Color, c2: P5.Color, amt: number): P5.Color;
8042
8031
 
8043
8032
  /**
8044
- * Creates a hidden `&lt;audio&gt;` element for simple audio playback.
8033
+ * Creates a hidden `<audio>` element for simple audio playback.
8045
8034
  *
8046
8035
  * `createAudio()` returns a new
8047
8036
  * <a href="#/p5.MediaElement">p5.MediaElement</a> object.
@@ -8064,22 +8053,6 @@ EXCLUDE: typeof P5.EXCLUDE;
8064
8053
  */
8065
8054
  createAudio(src?: string | string[], callback?: (video: P5.MediaElement<HTMLAudioElement>) => any): P5.MediaElement<HTMLAudioElement>;
8066
8055
 
8067
- /**
8068
- * Blends multiple colors to find a color between them.
8069
- *
8070
- * The `amt` parameter specifies the amount to interpolate between the color
8071
- * stops which are colors at each `amt` value "location" with `amt` values
8072
- * that are between 2 color stops interpolating between them based on its relative
8073
- * distance to both.
8074
- *
8075
- * The way that colors are interpolated depends on the current
8076
- * <a href="/reference/p5/colorMode/">colorMode()</a>.
8077
- * @param colors_stops color stops to interpolate from
8078
- * @param amt number to use to interpolate relative to color stops
8079
- * @returns interpolated color.
8080
- */
8081
- paletteLerp(colors_stops: [P5.Color | string | number | number[], number][], amt: number): P5.Color;
8082
-
8083
8056
  /**
8084
8057
  * Draws a torus.
8085
8058
  *
@@ -8111,6 +8084,22 @@ EXCLUDE: typeof P5.EXCLUDE;
8111
8084
  */
8112
8085
  torus(radius?: number, tubeRadius?: number, detailX?: number, detailY?: number): void;
8113
8086
 
8087
+ /**
8088
+ * Blends multiple colors to find a color between them.
8089
+ *
8090
+ * The `amt` parameter specifies the amount to interpolate between the color
8091
+ * stops which are colors at each `amt` value "location" with `amt` values
8092
+ * that are between 2 color stops interpolating between them based on its relative
8093
+ * distance to both.
8094
+ *
8095
+ * The way that colors are interpolated depends on the current
8096
+ * <a href="/reference/p5/colorMode/">colorMode()</a>.
8097
+ * @param colors_stops color stops to interpolate from
8098
+ * @param amt number to use to interpolate relative to color stops
8099
+ * @returns interpolated color.
8100
+ */
8101
+ paletteLerp(colors_stops: [P5.Color | string | number | number[], number][], amt: number): P5.Color;
8102
+
8114
8103
  /**
8115
8104
  * Saves the file and closes the print stream.
8116
8105
  */
@@ -8334,7 +8323,7 @@ EXCLUDE: typeof P5.EXCLUDE;
8334
8323
  buildMaterialShader(hooks: object, scope?: object): P5.Shader;
8335
8324
 
8336
8325
  /**
8337
- * Creates a `&lt;video&gt;` element that "captures" the audio/video stream from
8326
+ * Creates a `<video>` element that "captures" the audio/video stream from
8338
8327
  * the webcam and microphone.
8339
8328
  *
8340
8329
  * `createCapture()` returns a new
@@ -8647,7 +8636,7 @@ EXCLUDE: typeof P5.EXCLUDE;
8647
8636
  noErase(): void;
8648
8637
 
8649
8638
  /**
8650
- * Creates a text `&lt;input&gt;&lt;/input&gt;` element.
8639
+ * Creates a text `<input></input>` element.
8651
8640
  *
8652
8641
  * Call `myInput.size()` to set the length of the text box.
8653
8642
  *
@@ -8995,7 +8984,7 @@ EXCLUDE: typeof P5.EXCLUDE;
8995
8984
  pop(): void;
8996
8985
 
8997
8986
  /**
8998
- * Creates an `&lt;input&gt;&lt;/input&gt;` element of type `'file'`.
8987
+ * Creates an `<input></input>` element of type `'file'`.
8999
8988
  *
9000
8989
  * `createFileInput()` allows users to select local files for use in a sketch.
9001
8990
  * It returns a <a href="#/p5.File">p5.File</a> object.
@@ -9975,6 +9964,20 @@ EXCLUDE: typeof P5.EXCLUDE;
9975
9964
  vertex(x: number, y: number, u?: number, v?: number): void;
9976
9965
  vertex(x: number, y: number, z: number, u?: number, v?: number): void;
9977
9966
 
9967
+ /**
9968
+ * Sets the number of segments used to draw spline curves in WebGL mode.
9969
+ *
9970
+ * In WebGL mode, smooth shapes are drawn using many flat segments. Adding
9971
+ * more flat segments makes shapes appear smoother.
9972
+ *
9973
+ * The parameter, `detail`, is the density of segments to use while drawing a
9974
+ * spline curve.
9975
+ *
9976
+ * Note: `curveDetail()` has no effect in 2D mode.
9977
+ * @param resolution number of segments to use. Default is 1/4
9978
+ */
9979
+ curveDetail(resolution: number): void;
9980
+
9978
9981
  /**
9979
9982
  * Sets the frustum of the current camera in a 3D sketch.
9980
9983
  *
@@ -10014,20 +10017,6 @@ EXCLUDE: typeof P5.EXCLUDE;
10014
10017
  */
10015
10018
  frustum(left?: number, right?: number, bottom?: number, top?: number, near?: number, far?: number): void;
10016
10019
 
10017
- /**
10018
- * Sets the number of segments used to draw spline curves in WebGL mode.
10019
- *
10020
- * In WebGL mode, smooth shapes are drawn using many flat segments. Adding
10021
- * more flat segments makes shapes appear smoother.
10022
- *
10023
- * The parameter, `detail`, is the density of segments to use while drawing a
10024
- * spline curve.
10025
- *
10026
- * Note: `curveDetail()` has no effect in 2D mode.
10027
- * @param resolution number of segments to use. Default is 1/4
10028
- */
10029
- curveDetail(resolution: number): void;
10030
-
10031
10020
  /**
10032
10021
  * Creates a new <a href="#/p5.Camera">p5.Camera</a> object.
10033
10022
  *
@@ -12426,9 +12415,9 @@ const BOTTOM: typeof P5.BOTTOM;
12426
12415
 
12427
12416
  /**
12428
12417
  * A system variable that provides direct access to the sketch's
12429
- * `&lt;canvas&gt;` element.
12418
+ * `<canvas>` element.
12430
12419
  *
12431
- * The `&lt;canvas&gt;` element provides many specialized features that aren't
12420
+ * The `<canvas>` element provides many specialized features that aren't
12432
12421
  * included in the p5.js library. The `drawingContext` system variable
12433
12422
  * provides access to these features by exposing the sketch's
12434
12423
  * <a href="https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D">CanvasRenderingContext2D</a>
@@ -14358,6 +14347,26 @@ function str(n: string | boolean | number): string;
14358
14347
  function byte(n: string | boolean | number): number;
14359
14348
  function byte(ns: any[]): number[];
14360
14349
 
14350
+ /**
14351
+ * Creates a custom <a href="#/p5.Geometry">p5.Geometry</a> object from
14352
+ * simpler 3D shapes.
14353
+ *
14354
+ * `buildGeometry()` helps with creating complex 3D shapes from simpler ones
14355
+ * such as <a href="#/p5/sphere">sphere()</a>. It can help to make sketches
14356
+ * more performant. For example, if a complex 3D shape doesn’t change while a
14357
+ * sketch runs, then it can be created with `buildGeometry()`. Creating a
14358
+ * <a href="#/p5.Geometry">p5.Geometry</a> object once and then drawing it
14359
+ * will run faster than repeatedly drawing the individual pieces.
14360
+ *
14361
+ * The parameter, `callback`, is a function with the drawing instructions for
14362
+ * the new <a href="#/p5.Geometry">p5.Geometry</a> object. It will be called
14363
+ * once to create the new 3D shape.
14364
+ * Note: `buildGeometry()` can only be used in WebGL mode.
14365
+ * @param callback function that draws the shape.
14366
+ * @returns new 3D shape.
14367
+ */
14368
+ function buildGeometry(callback: Function): P5.Geometry;
14369
+
14361
14370
  /**
14362
14371
  * Calculates coordinates along a Bézier curve using interpolation.
14363
14372
  *
@@ -14388,31 +14397,6 @@ function byte(ns: any[]): number[];
14388
14397
  */
14389
14398
  function bezierPoint(a: number, b: number, c: number, d: number, t: number): number;
14390
14399
 
14391
- /**
14392
- * Creates a custom <a href="#/p5.Geometry">p5.Geometry</a> object from
14393
- * simpler 3D shapes.
14394
- *
14395
- * `buildGeometry()` helps with creating complex 3D shapes from simpler ones
14396
- * such as <a href="#/p5/sphere">sphere()</a>. It can help to make sketches
14397
- * more performant. For example, if a complex 3D shape doesn’t change while a
14398
- * sketch runs, then it can be created with `buildGeometry()`. Creating a
14399
- * <a href="#/p5.Geometry">p5.Geometry</a> object once and then drawing it
14400
- * will run faster than repeatedly drawing the individual pieces.
14401
- *
14402
- * The parameter, `callback`, is a function with the drawing instructions for
14403
- * the new <a href="#/p5.Geometry">p5.Geometry</a> object. It will be called
14404
- * once to create the new 3D shape.
14405
- *
14406
- * See <a href="#/p5/beginGeometry">beginGeometry()</a> and
14407
- * <a href="#/p5/endGeometry">endGeometry()</a> for another way to build 3D
14408
- * shapes.
14409
- *
14410
- * Note: `buildGeometry()` can only be used in WebGL mode.
14411
- * @param callback function that draws the shape.
14412
- * @returns new 3D shape.
14413
- */
14414
- function buildGeometry(callback: Function): P5.Geometry;
14415
-
14416
14400
  /**
14417
14401
  * Loads a 3D model to create a
14418
14402
  * <a href="#/p5.Geometry">p5.Geometry</a> object.
@@ -14572,20 +14556,6 @@ function atan2(y: number, x: number): number;
14572
14556
  */
14573
14557
  function smooth(): void;
14574
14558
 
14575
- /**
14576
- * Removes all items in the web browser's local storage.
14577
- *
14578
- * Web browsers can save small amounts of data using the built-in
14579
- * <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage" target="_blank">localStorage object</a>.
14580
- * Data stored in `localStorage` can be retrieved at any point, even after
14581
- * refreshing a page or restarting the browser. Data are stored as key-value
14582
- * pairs. Calling `clearStorage()` removes all data from `localStorage`.
14583
- *
14584
- * Note: Sensitive data such as passwords or personal information shouldn't be
14585
- * stored in `localStorage`.
14586
- */
14587
- function clearStorage(): void;
14588
-
14589
14559
  /**
14590
14560
  * Converts a `Number` into a `String` with a plus or minus sign.
14591
14561
  *
@@ -14621,6 +14591,20 @@ function clearStorage(): void;
14621
14591
  function nfp(num: number, left?: number, right?: number): string;
14622
14592
  function nfp(nums: number[], left?: number, right?: number): string[];
14623
14593
 
14594
+ /**
14595
+ * Removes all items in the web browser's local storage.
14596
+ *
14597
+ * Web browsers can save small amounts of data using the built-in
14598
+ * <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage" target="_blank">localStorage object</a>.
14599
+ * Data stored in `localStorage` can be retrieved at any point, even after
14600
+ * refreshing a page or restarting the browser. Data are stored as key-value
14601
+ * pairs. Calling `clearStorage()` removes all data from `localStorage`.
14602
+ *
14603
+ * Note: Sensitive data such as passwords or personal information shouldn't be
14604
+ * stored in `localStorage`.
14605
+ */
14606
+ function clearStorage(): void;
14607
+
14624
14608
  /**
14625
14609
  * Removes all elements created by p5.js, including any event handlers.
14626
14610
  *
@@ -14863,6 +14847,29 @@ function lerp(start: number, stop: number, amt: number): number;
14863
14847
  function frameRate(fps: number): number;
14864
14848
  function frameRate(): number;
14865
14849
 
14850
+ /**
14851
+ * Clears a <a href="#/p5.Geometry">p5.Geometry</a> object from the graphics
14852
+ * processing unit (GPU) memory.
14853
+ *
14854
+ * <a href="#/p5.Geometry">p5.Geometry</a> objects can contain lots of data
14855
+ * about their vertices, surface normals, colors, and so on. Complex 3D shapes
14856
+ * can use lots of memory which is a limited resource in many GPUs. Calling
14857
+ * `freeGeometry()` works with <a href="#/p5.Geometry">p5.Geometry</a> objects
14858
+ * created with <a href="#/p5/buildGeometry">buildGeometry()</a> and
14859
+ * <a href="#/p5/loadModel">loadModel()</a>.
14860
+ *
14861
+ * The parameter, `geometry`, is the <a href="#/p5.Geometry">p5.Geometry</a>
14862
+ * object to be freed.
14863
+ *
14864
+ * Note: A <a href="#/p5.Geometry">p5.Geometry</a> object can still be drawn
14865
+ * after its resources are cleared from GPU memory. It may take longer to draw
14866
+ * the first time it’s redrawn.
14867
+ *
14868
+ * Note: `freeGeometry()` can only be used in WebGL mode.
14869
+ * @param geometry 3D shape whose resources should be freed.
14870
+ */
14871
+ function freeGeometry(geometry: P5.Geometry): void;
14872
+
14866
14873
  /**
14867
14874
  * Calculates the cosine of an angle.
14868
14875
  *
@@ -14925,14 +14932,14 @@ function specularColor(values: number[]): void;
14925
14932
  function specularColor(color: P5.Color): void;
14926
14933
 
14927
14934
  /**
14928
- * Creates a `&lt;div&gt;&lt;/div&gt;` element.
14935
+ * Creates a `<div></div>` element.
14929
14936
  *
14930
- * `&lt;div&gt;&lt;/div&gt;` elements are commonly used as containers for
14937
+ * `<div></div>` elements are commonly used as containers for
14931
14938
  * other elements.
14932
14939
  *
14933
14940
  * The parameter `html` is optional. It accepts a string that sets the
14934
- * inner HTML of the new `&lt;div&gt;&lt;/div&gt;`.
14935
- * @param html inner HTML for the new `&lt;div&gt;&lt;/div&gt;` element.
14941
+ * inner HTML of the new `<div></div>`.
14942
+ * @param html inner HTML for the new `<div></div>` element.
14936
14943
  * @returns new <a href="#/p5.Element">p5.Element</a> object.
14937
14944
  */
14938
14945
  function createDiv(html?: string): P5.Element;
@@ -14990,27 +14997,6 @@ function loadStrings(path: string | Request, successCallback?: Function, errorCa
14990
14997
  function boolean(n: string | boolean | number): boolean;
14991
14998
  function boolean(ns: any[]): boolean[];
14992
14999
 
14993
- /**
14994
- * Removes an item from the web browser's local storage.
14995
- *
14996
- * Web browsers can save small amounts of data using the built-in
14997
- * <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage" target="_blank">localStorage object</a>.
14998
- * Data stored in `localStorage` can be retrieved at any point, even after
14999
- * refreshing a page or restarting the browser. Data are stored as key-value
15000
- * pairs.
15001
- *
15002
- * <a href="#/p5/storeItem">storeItem()</a> makes it easy to store values in
15003
- * `localStorage` and `removeItem()` makes it easy to delete them.
15004
- *
15005
- * The parameter, `key`, is the name of the value to remove as a string. For
15006
- * example, calling `removeItem('size')` removes the item with the key `size`.
15007
- *
15008
- * Note: Sensitive data such as passwords or personal information shouldn't be
15009
- * stored in `localStorage`.
15010
- * @param key name of the value to remove.
15011
- */
15012
- function removeItem(key: string): void;
15013
-
15014
15000
  /**
15015
15001
  * Rotates the coordinate system.
15016
15002
  *
@@ -15046,31 +15032,25 @@ function removeItem(key: string): void;
15046
15032
  function rotate(angle: number, axis?: P5.Vector | number[]): void;
15047
15033
 
15048
15034
  /**
15049
- * Clears a <a href="#/p5.Geometry">p5.Geometry</a> object from the graphics
15050
- * processing unit (GPU) memory.
15035
+ * Removes an item from the web browser's local storage.
15051
15036
  *
15052
- * <a href="#/p5.Geometry">p5.Geometry</a> objects can contain lots of data
15053
- * about their vertices, surface normals, colors, and so on. Complex 3D shapes
15054
- * can use lots of memory which is a limited resource in many GPUs. Calling
15055
- * `freeGeometry()` can improve performance by freeing a
15056
- * <a href="#/p5.Geometry">p5.Geometry</a> object’s resources from GPU memory.
15057
- * `freeGeometry()` works with <a href="#/p5.Geometry">p5.Geometry</a> objects
15058
- * created with <a href="#/p5/beginGeometry">beginGeometry()</a> and
15059
- * <a href="#/p5/endGeometry">endGeometry()</a>,
15060
- * <a href="#/p5/buildGeometry">buildGeometry()</a>, and
15061
- * <a href="#/p5/loadModel">loadModel()</a>.
15037
+ * Web browsers can save small amounts of data using the built-in
15038
+ * <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage" target="_blank">localStorage object</a>.
15039
+ * Data stored in `localStorage` can be retrieved at any point, even after
15040
+ * refreshing a page or restarting the browser. Data are stored as key-value
15041
+ * pairs.
15062
15042
  *
15063
- * The parameter, `geometry`, is the <a href="#/p5.Geometry">p5.Geometry</a>
15064
- * object to be freed.
15043
+ * <a href="#/p5/storeItem">storeItem()</a> makes it easy to store values in
15044
+ * `localStorage` and `removeItem()` makes it easy to delete them.
15065
15045
  *
15066
- * Note: A <a href="#/p5.Geometry">p5.Geometry</a> object can still be drawn
15067
- * after its resources are cleared from GPU memory. It may take longer to draw
15068
- * the first time it’s redrawn.
15046
+ * The parameter, `key`, is the name of the value to remove as a string. For
15047
+ * example, calling `removeItem('size')` removes the item with the key `size`.
15069
15048
  *
15070
- * Note: `freeGeometry()` can only be used in WebGL mode.
15071
- * @param geometry 3D shape whose resources should be freed.
15049
+ * Note: Sensitive data such as passwords or personal information shouldn't be
15050
+ * stored in `localStorage`.
15051
+ * @param key name of the value to remove.
15072
15052
  */
15073
- function freeGeometry(geometry: P5.Geometry): void;
15053
+ function removeItem(key: string): void;
15074
15054
 
15075
15055
  /**
15076
15056
  * The <a href="#/p5/setMoveThreshold">setMoveThreshold()</a> function is used to set the movement threshold for
@@ -15160,11 +15140,11 @@ function log(n: number): number;
15160
15140
  /**
15161
15141
  * Creates a paragraph element.
15162
15142
  *
15163
- * `&lt;p&gt;&lt;/p&gt;` elements are commonly used for paragraph-length text.
15143
+ * `<p></p>` elements are commonly used for paragraph-length text.
15164
15144
  *
15165
15145
  * The parameter `html` is optional. It accepts a string that sets the
15166
- * inner HTML of the new `&lt;p&gt;&lt;/p&gt;`.
15167
- * @param html inner HTML for the new `&lt;p&gt;&lt;/p&gt;` element.
15146
+ * inner HTML of the new `<p></p>`.
15147
+ * @param html inner HTML for the new `<p></p>` element.
15168
15148
  * @returns new <a href="#/p5.Element">p5.Element</a> object.
15169
15149
  */
15170
15150
  function createP(html?: string): P5.Element;
@@ -15598,6 +15578,38 @@ function mag(x: number, y: number): number;
15598
15578
  */
15599
15579
  function loadTable(filename: string | Request, separator?: string, header?: string, callback?: Function, errorCallback?: Function): Promise<object>;
15600
15580
 
15581
+ /**
15582
+ * Draws a plane.
15583
+ *
15584
+ * A plane is a four-sided, flat shape with every angle measuring 90˚. It’s
15585
+ * similar to a rectangle and offers advanced drawing features in WebGL mode.
15586
+ *
15587
+ * The first parameter, `width`, is optional. If a `Number` is passed, as in
15588
+ * `plane(20)`, it sets the plane’s width and height. By default, `width` is
15589
+ * 50.
15590
+ *
15591
+ * The second parameter, `height`, is also optional. If a `Number` is passed,
15592
+ * as in `plane(20, 30)`, it sets the plane’s height. By default, `height` is
15593
+ * set to the plane’s `width`.
15594
+ *
15595
+ * The third parameter, `detailX`, is also optional. If a `Number` is passed,
15596
+ * as in `plane(20, 30, 5)` it sets the number of triangle subdivisions to use
15597
+ * along the x-axis. All 3D shapes are made by connecting triangles to form
15598
+ * their surfaces. By default, `detailX` is 1.
15599
+ *
15600
+ * The fourth parameter, `detailY`, is also optional. If a `Number` is passed,
15601
+ * as in `plane(20, 30, 5, 7)` it sets the number of triangle subdivisions to
15602
+ * use along the y-axis. All 3D shapes are made by connecting triangles to
15603
+ * form their surfaces. By default, `detailY` is 1.
15604
+ *
15605
+ * Note: `plane()` can only be used in WebGL mode.
15606
+ * @param width width of the plane.
15607
+ * @param height height of the plane.
15608
+ * @param detailX number of triangle subdivisions along the x-axis.
15609
+ * @param detailY number of triangle subdivisions along the y-axis.
15610
+ */
15611
+ function plane(width?: number, height?: number, detailX?: number, detailY?: number): void;
15612
+
15601
15613
  /**
15602
15614
  * Gets the red value of a color.
15603
15615
  *
@@ -15683,16 +15695,16 @@ function filter(shaderFilter: P5.Shader): void;
15683
15695
  function tan(angle: number): number;
15684
15696
 
15685
15697
  /**
15686
- * Creates a `&lt;span&gt;&lt;/span&gt;` element.
15698
+ * Creates a `<span></span>` element.
15687
15699
  *
15688
- * `&lt;span&gt;&lt;/span&gt;` elements are commonly used as containers
15689
- * for inline elements. For example, a `&lt;span&gt;&lt;/span&gt;`
15700
+ * `<span></span>` elements are commonly used as containers
15701
+ * for inline elements. For example, a `<span></span>`
15690
15702
  * can hold part of a sentence that's a
15691
15703
  * <span style="color: deeppink;">different</span> style.
15692
15704
  *
15693
15705
  * The parameter `html` is optional. It accepts a string that sets the
15694
- * inner HTML of the new `&lt;span&gt;&lt;/span&gt;`.
15695
- * @param html inner HTML for the new `&lt;span&gt;&lt;/span&gt;` element.
15706
+ * inner HTML of the new `<span></span>`.
15707
+ * @param html inner HTML for the new `<span></span>` element.
15696
15708
  * @returns new <a href="#/p5.Element">p5.Element</a> object.
15697
15709
  */
15698
15710
  function createSpan(html?: string): P5.Element;
@@ -15745,38 +15757,6 @@ function createSpan(html?: string): P5.Element;
15745
15757
  */
15746
15758
  function loadFilterShader(filename: string, successCallback?: Function, failureCallback?: Function): Promise<P5.Shader>;
15747
15759
 
15748
- /**
15749
- * Draws a plane.
15750
- *
15751
- * A plane is a four-sided, flat shape with every angle measuring 90˚. It’s
15752
- * similar to a rectangle and offers advanced drawing features in WebGL mode.
15753
- *
15754
- * The first parameter, `width`, is optional. If a `Number` is passed, as in
15755
- * `plane(20)`, it sets the plane’s width and height. By default, `width` is
15756
- * 50.
15757
- *
15758
- * The second parameter, `height`, is also optional. If a `Number` is passed,
15759
- * as in `plane(20, 30)`, it sets the plane’s height. By default, `height` is
15760
- * set to the plane’s `width`.
15761
- *
15762
- * The third parameter, `detailX`, is also optional. If a `Number` is passed,
15763
- * as in `plane(20, 30, 5)` it sets the number of triangle subdivisions to use
15764
- * along the x-axis. All 3D shapes are made by connecting triangles to form
15765
- * their surfaces. By default, `detailX` is 1.
15766
- *
15767
- * The fourth parameter, `detailY`, is also optional. If a `Number` is passed,
15768
- * as in `plane(20, 30, 5, 7)` it sets the number of triangle subdivisions to
15769
- * use along the y-axis. All 3D shapes are made by connecting triangles to
15770
- * form their surfaces. By default, `detailY` is 1.
15771
- *
15772
- * Note: `plane()` can only be used in WebGL mode.
15773
- * @param width width of the plane.
15774
- * @param height height of the plane.
15775
- * @param detailX number of triangle subdivisions along the x-axis.
15776
- * @param detailY number of triangle subdivisions along the y-axis.
15777
- */
15778
- function plane(width?: number, height?: number, detailX?: number, detailY?: number): void;
15779
-
15780
15760
  /**
15781
15761
  * Creates and a new <a href="#/p5.Framebuffer">p5.Framebuffer</a> object.
15782
15762
  *
@@ -15886,7 +15866,7 @@ function rotateX(angle: number): void;
15886
15866
  function map(value: number, start1: number, stop1: number, start2: number, stop2: number, withinBounds?: boolean): number;
15887
15867
 
15888
15868
  /**
15889
- * Creates an `&lt;img&gt;` element that can appear outside of the canvas.
15869
+ * Creates an `<img>` element that can appear outside of the canvas.
15890
15870
  *
15891
15871
  * The first parameter, `src`, is a string with the path to the image file.
15892
15872
  * `src` should be a relative path, as in `'assets/image.png'`, or a URL, as
@@ -16144,6 +16124,42 @@ function keyPressed(event?: KeyboardEvent): void;
16144
16124
  */
16145
16125
  function green(color: P5.Color | number[] | string): number;
16146
16126
 
16127
+ /**
16128
+ * Draws a box (rectangular prism).
16129
+ *
16130
+ * A box is a 3D shape with six faces. Each face makes a 90˚ with four
16131
+ * neighboring faces.
16132
+ *
16133
+ * The first parameter, `width`, is optional. If a `Number` is passed, as in
16134
+ * `box(20)`, it sets the box’s width and height. By default, `width` is 50.
16135
+ *
16136
+ * The second parameter, `height`, is also optional. If a `Number` is passed,
16137
+ * as in `box(20, 30)`, it sets the box’s height. By default, `height` is set
16138
+ * to the box’s `width`.
16139
+ *
16140
+ * The third parameter, `depth`, is also optional. If a `Number` is passed, as
16141
+ * in `box(20, 30, 40)`, it sets the box’s depth. By default, `depth` is set
16142
+ * to the box’s `height`.
16143
+ *
16144
+ * The fourth parameter, `detailX`, is also optional. If a `Number` is passed,
16145
+ * as in `box(20, 30, 40, 5)`, it sets the number of triangle subdivisions to
16146
+ * use along the x-axis. All 3D shapes are made by connecting triangles to
16147
+ * form their surfaces. By default, `detailX` is 1.
16148
+ *
16149
+ * The fifth parameter, `detailY`, is also optional. If a number is passed, as
16150
+ * in `box(20, 30, 40, 5, 7)`, it sets the number of triangle subdivisions to
16151
+ * use along the y-axis. All 3D shapes are made by connecting triangles to
16152
+ * form their surfaces. By default, `detailY` is 1.
16153
+ *
16154
+ * Note: `box()` can only be used in WebGL mode.
16155
+ * @param width width of the box.
16156
+ * @param height height of the box.
16157
+ * @param depth depth of the box.
16158
+ * @param detailX number of triangle subdivisions along the x-axis.
16159
+ * @param detailY number of triangle subdivisions along the y-axis.
16160
+ */
16161
+ function box(width?: number, height?: number, depth?: number, detailX?: number, detailY?: number): void;
16162
+
16147
16163
  /**
16148
16164
  * Returns the largest value in a sequence of numbers.
16149
16165
  *
@@ -16194,7 +16210,7 @@ function bezierVertex(x: number, y: number, u?: number, v?: number): void;
16194
16210
  function bezierVertex(x: number, y: number, z: number, u?: number, v?: number): void;
16195
16211
 
16196
16212
  /**
16197
- * Creates an `&lt;a&gt;&lt;/a&gt;` element that links to another web page.
16213
+ * Creates an `<a></a>` element that links to another web page.
16198
16214
  *
16199
16215
  * The first parmeter, `href`, is a string that sets the URL of the linked
16200
16216
  * page.
@@ -16329,63 +16345,27 @@ function setup(): void;
16329
16345
  */
16330
16346
  function draw(): void;
16331
16347
 
16332
- /**
16333
- * Clears the pixels on the canvas.
16334
- *
16335
- * `clear()` makes every pixel 100% transparent. Calling `clear()` doesn't
16336
- * clear objects created by `createX()` functions such as
16337
- * <a href="#/p5/createGraphics">createGraphics()</a>,
16338
- * <a href="#/p5/createVideo">createVideo()</a>, and
16339
- * <a href="#/p5/createImg">createImg()</a>. These objects will remain
16340
- * unchanged after calling `clear()` and can be redrawn.
16341
- *
16342
- * In WebGL mode, this function can clear the screen to a specific color. It
16343
- * interprets four numeric parameters as normalized RGBA color values. It also
16344
- * clears the depth buffer. If you are not using the WebGL renderer, these
16345
- * parameters will have no effect.
16346
- * @param r normalized red value.
16347
- * @param g normalized green value.
16348
- * @param b normalized blue value.
16349
- * @param a normalized alpha value.
16350
- */
16351
- function clear(r?: number, g?: number, b?: number, a?: number): void;
16352
- function clear(): void;
16353
-
16354
- /**
16355
- * Draws a box (rectangular prism).
16356
- *
16357
- * A box is a 3D shape with six faces. Each face makes a 90˚ with four
16358
- * neighboring faces.
16359
- *
16360
- * The first parameter, `width`, is optional. If a `Number` is passed, as in
16361
- * `box(20)`, it sets the box’s width and height. By default, `width` is 50.
16362
- *
16363
- * The second parameter, `height`, is also optional. If a `Number` is passed,
16364
- * as in `box(20, 30)`, it sets the box’s height. By default, `height` is set
16365
- * to the box’s `width`.
16366
- *
16367
- * The third parameter, `depth`, is also optional. If a `Number` is passed, as
16368
- * in `box(20, 30, 40)`, it sets the box’s depth. By default, `depth` is set
16369
- * to the box’s `height`.
16370
- *
16371
- * The fourth parameter, `detailX`, is also optional. If a `Number` is passed,
16372
- * as in `box(20, 30, 40, 5)`, it sets the number of triangle subdivisions to
16373
- * use along the x-axis. All 3D shapes are made by connecting triangles to
16374
- * form their surfaces. By default, `detailX` is 1.
16375
- *
16376
- * The fifth parameter, `detailY`, is also optional. If a number is passed, as
16377
- * in `box(20, 30, 40, 5, 7)`, it sets the number of triangle subdivisions to
16378
- * use along the y-axis. All 3D shapes are made by connecting triangles to
16379
- * form their surfaces. By default, `detailY` is 1.
16348
+ /**
16349
+ * Clears the pixels on the canvas.
16380
16350
  *
16381
- * Note: `box()` can only be used in WebGL mode.
16382
- * @param width width of the box.
16383
- * @param height height of the box.
16384
- * @param depth depth of the box.
16385
- * @param detailX number of triangle subdivisions along the x-axis.
16386
- * @param detailY number of triangle subdivisions along the y-axis.
16351
+ * `clear()` makes every pixel 100% transparent. Calling `clear()` doesn't
16352
+ * clear objects created by `createX()` functions such as
16353
+ * <a href="#/p5/createGraphics">createGraphics()</a>,
16354
+ * <a href="#/p5/createVideo">createVideo()</a>, and
16355
+ * <a href="#/p5/createImg">createImg()</a>. These objects will remain
16356
+ * unchanged after calling `clear()` and can be redrawn.
16357
+ *
16358
+ * In WebGL mode, this function can clear the screen to a specific color. It
16359
+ * interprets four numeric parameters as normalized RGBA color values. It also
16360
+ * clears the depth buffer. If you are not using the WebGL renderer, these
16361
+ * parameters will have no effect.
16362
+ * @param r normalized red value.
16363
+ * @param g normalized green value.
16364
+ * @param b normalized blue value.
16365
+ * @param a normalized alpha value.
16387
16366
  */
16388
- function box(width?: number, height?: number, depth?: number, detailX?: number, detailY?: number): void;
16367
+ function clear(r?: number, g?: number, b?: number, a?: number): void;
16368
+ function clear(): void;
16389
16369
 
16390
16370
  /**
16391
16371
  * Converts a `Number` or `String` to a single-character `String`.
@@ -16531,7 +16511,7 @@ function spline(x1: number, y1: number, z1: number, x2: number, y2: number, z2:
16531
16511
  * (<a href="https://developer.mozilla.org/en-US/docs/Web/XML/XML_introduction" target="_blank">XML</a>)
16532
16512
  * is a standard format for sending data between applications. Like HTML, the
16533
16513
  * XML format is based on tags and attributes, as in
16534
- * `&lt;time units="s"&gt;1234&lt;/time&gt;`.
16514
+ * `<time units="s">1234</time>`.
16535
16515
  *
16536
16516
  * The first parameter, `path`, is always a string with the path to the file.
16537
16517
  * Paths to local files should be relative, as in
@@ -16700,6 +16680,33 @@ function unchar(ns: string[]): number[];
16700
16680
  function angleMode(mode: typeof P5.RADIANS | typeof P5.DEGREES): typeof P5.RADIANS | typeof P5.DEGREES;
16701
16681
  function angleMode(): typeof P5.RADIANS | typeof P5.DEGREES;
16702
16682
 
16683
+ /**
16684
+ * Draws a sphere.
16685
+ *
16686
+ * A sphere is a 3D shape with triangular faces that connect to form a round
16687
+ * surface. Spheres with few faces look like crystals. Spheres with many faces
16688
+ * have smooth surfaces and look like balls.
16689
+ *
16690
+ * The first parameter, `radius`, is optional. If a `Number` is passed, as in
16691
+ * `sphere(20)`, it sets the radius of the sphere. By default, `radius` is 50.
16692
+ *
16693
+ * The second parameter, `detailX`, is also optional. If a `Number` is passed,
16694
+ * as in `sphere(20, 5)`, it sets the number of triangle subdivisions to use
16695
+ * along the x-axis. All 3D shapes are made by connecting triangles to form
16696
+ * their surfaces. By default, `detailX` is 24.
16697
+ *
16698
+ * The third parameter, `detailY`, is also optional. If a `Number` is passed,
16699
+ * as in `sphere(20, 5, 2)`, it sets the number of triangle subdivisions to
16700
+ * use along the y-axis. All 3D shapes are made by connecting triangles to
16701
+ * form their surfaces. By default, `detailY` is 16.
16702
+ *
16703
+ * Note: `sphere()` can only be used in WebGL mode.
16704
+ * @param radius radius of the sphere. Defaults to 50.
16705
+ * @param detailX number of triangle subdivisions along the x-axis. Defaults to 24.
16706
+ * @param detailY number of triangle subdivisions along the y-axis. Defaults to 16.
16707
+ */
16708
+ function sphere(radius?: number, detailX?: number, detailY?: number): void;
16709
+
16703
16710
  /**
16704
16711
  * Loads the current value of each pixel on the canvas into the
16705
16712
  * <a href="#/p5/pixels">pixels</a> array.
@@ -16884,7 +16891,7 @@ function buildFilterShader(hooks: object, scope?: object): P5.Shader;
16884
16891
  function loadBytes(file: string | Request, callback?: Function, errorCallback?: Function): Promise<Uint8Array>;
16885
16892
 
16886
16893
  /**
16887
- * Creates a slider `&lt;input&gt;&lt;/input&gt;` element.
16894
+ * Creates a slider `<input></input>` element.
16888
16895
  *
16889
16896
  * Range sliders are useful for quickly selecting numbers from a given range.
16890
16897
  *
@@ -16921,33 +16928,6 @@ function createSlider(min: number, max: number, value?: number, step?: number):
16921
16928
  */
16922
16929
  function norm(value: number, start: number, stop: number): number;
16923
16930
 
16924
- /**
16925
- * Draws a sphere.
16926
- *
16927
- * A sphere is a 3D shape with triangular faces that connect to form a round
16928
- * surface. Spheres with few faces look like crystals. Spheres with many faces
16929
- * have smooth surfaces and look like balls.
16930
- *
16931
- * The first parameter, `radius`, is optional. If a `Number` is passed, as in
16932
- * `sphere(20)`, it sets the radius of the sphere. By default, `radius` is 50.
16933
- *
16934
- * The second parameter, `detailX`, is also optional. If a `Number` is passed,
16935
- * as in `sphere(20, 5)`, it sets the number of triangle subdivisions to use
16936
- * along the x-axis. All 3D shapes are made by connecting triangles to form
16937
- * their surfaces. By default, `detailX` is 24.
16938
- *
16939
- * The third parameter, `detailY`, is also optional. If a `Number` is passed,
16940
- * as in `sphere(20, 5, 2)`, it sets the number of triangle subdivisions to
16941
- * use along the y-axis. All 3D shapes are made by connecting triangles to
16942
- * form their surfaces. By default, `detailY` is 16.
16943
- *
16944
- * Note: `sphere()` can only be used in WebGL mode.
16945
- * @param radius radius of the sphere. Defaults to 50.
16946
- * @param detailX number of triangle subdivisions along the x-axis. Defaults to 24.
16947
- * @param detailY number of triangle subdivisions along the y-axis. Defaults to 16.
16948
- */
16949
- function sphere(radius?: number, detailX?: number, detailY?: number): void;
16950
-
16951
16931
  /**
16952
16932
  * A function that's called once when any key is released.
16953
16933
  *
@@ -17138,7 +17118,7 @@ function point(coordinateVector: P5.Vector): void;
17138
17118
  function alpha(color: P5.Color | number[] | string): number;
17139
17119
 
17140
17120
  /**
17141
- * Creates a `&lt;button&gt;&lt;/button&gt;` element.
17121
+ * Creates a `<button></button>` element.
17142
17122
  *
17143
17123
  * The first parameter, `label`, is a string that sets the label displayed on
17144
17124
  * the button.
@@ -17429,7 +17409,7 @@ function displayDensity(): number;
17429
17409
  function panorama(img: P5.Image): void;
17430
17410
 
17431
17411
  /**
17432
- * Creates a checkbox `&lt;input&gt;&lt;/input&gt;` element.
17412
+ * Creates a checkbox `<input></input>` element.
17433
17413
  *
17434
17414
  * Checkboxes extend the <a href="#/p5.Element">p5.Element</a> class with a
17435
17415
  * `checked()` method. Calling `myBox.checked()` returns `true` if it the box
@@ -17505,6 +17485,50 @@ function keyTyped(event?: KeyboardEvent): void;
17505
17485
  */
17506
17486
  function hue(color: P5.Color | number[] | string): number;
17507
17487
 
17488
+ /**
17489
+ * Draws a cylinder.
17490
+ *
17491
+ * A cylinder is a 3D shape with triangular faces that connect a flat bottom
17492
+ * to a flat top. Cylinders with few faces look like boxes. Cylinders with
17493
+ * many faces have smooth surfaces.
17494
+ *
17495
+ * The first parameter, `radius`, is optional. If a `Number` is passed, as in
17496
+ * `cylinder(20)`, it sets the radius of the cylinder’s base. By default,
17497
+ * `radius` is 50.
17498
+ *
17499
+ * The second parameter, `height`, is also optional. If a `Number` is passed,
17500
+ * as in `cylinder(20, 30)`, it sets the cylinder’s height. By default,
17501
+ * `height` is set to the cylinder’s `radius`.
17502
+ *
17503
+ * The third parameter, `detailX`, is also optional. If a `Number` is passed,
17504
+ * as in `cylinder(20, 30, 5)`, it sets the number of edges used to form the
17505
+ * cylinder's top and bottom. Using more edges makes the top and bottom look
17506
+ * more like circles. By default, `detailX` is 24.
17507
+ *
17508
+ * The fourth parameter, `detailY`, is also optional. If a `Number` is passed,
17509
+ * as in `cylinder(20, 30, 5, 2)`, it sets the number of triangle subdivisions
17510
+ * to use along the y-axis, between cylinder's the top and bottom. All 3D
17511
+ * shapes are made by connecting triangles to form their surfaces. By default,
17512
+ * `detailY` is 1.
17513
+ *
17514
+ * The fifth parameter, `bottomCap`, is also optional. If a `false` is passed,
17515
+ * as in `cylinder(20, 30, 5, 2, false)` the cylinder’s bottom won’t be drawn.
17516
+ * By default, `bottomCap` is `true`.
17517
+ *
17518
+ * The sixth parameter, `topCap`, is also optional. If a `false` is passed, as
17519
+ * in `cylinder(20, 30, 5, 2, false, false)` the cylinder’s top won’t be
17520
+ * drawn. By default, `topCap` is `true`.
17521
+ *
17522
+ * Note: `cylinder()` can only be used in WebGL mode.
17523
+ * @param radius radius of the cylinder. Defaults to 50.
17524
+ * @param height height of the cylinder. Defaults to the value of `radius`.
17525
+ * @param detailX number of edges along the top and bottom. Defaults to 24.
17526
+ * @param detailY number of triangle subdivisions along the y-axis. Defaults to 1.
17527
+ * @param bottomCap whether to draw the cylinder's bottom. Defaults to `true`.
17528
+ * @param topCap whether to draw the cylinder's top. Defaults to `true`.
17529
+ */
17530
+ function cylinder(radius?: number, height?: number, detailX?: number, detailY?: number, bottomCap?: boolean, topCap?: boolean): void;
17531
+
17508
17532
  /**
17509
17533
  * Scales the coordinate system.
17510
17534
  *
@@ -17624,50 +17648,6 @@ function httpPost(path: string | Request, data?: object | boolean, datatype?: st
17624
17648
  function httpPost(path: string | Request, data: object | boolean, callback?: Function, errorCallback?: Function): Promise<any>;
17625
17649
  function httpPost(path: string | Request, callback?: Function, errorCallback?: Function): Promise<any>;
17626
17650
 
17627
- /**
17628
- * Draws a cylinder.
17629
- *
17630
- * A cylinder is a 3D shape with triangular faces that connect a flat bottom
17631
- * to a flat top. Cylinders with few faces look like boxes. Cylinders with
17632
- * many faces have smooth surfaces.
17633
- *
17634
- * The first parameter, `radius`, is optional. If a `Number` is passed, as in
17635
- * `cylinder(20)`, it sets the radius of the cylinder’s base. By default,
17636
- * `radius` is 50.
17637
- *
17638
- * The second parameter, `height`, is also optional. If a `Number` is passed,
17639
- * as in `cylinder(20, 30)`, it sets the cylinder’s height. By default,
17640
- * `height` is set to the cylinder’s `radius`.
17641
- *
17642
- * The third parameter, `detailX`, is also optional. If a `Number` is passed,
17643
- * as in `cylinder(20, 30, 5)`, it sets the number of edges used to form the
17644
- * cylinder's top and bottom. Using more edges makes the top and bottom look
17645
- * more like circles. By default, `detailX` is 24.
17646
- *
17647
- * The fourth parameter, `detailY`, is also optional. If a `Number` is passed,
17648
- * as in `cylinder(20, 30, 5, 2)`, it sets the number of triangle subdivisions
17649
- * to use along the y-axis, between cylinder's the top and bottom. All 3D
17650
- * shapes are made by connecting triangles to form their surfaces. By default,
17651
- * `detailY` is 1.
17652
- *
17653
- * The fifth parameter, `bottomCap`, is also optional. If a `false` is passed,
17654
- * as in `cylinder(20, 30, 5, 2, false)` the cylinder’s bottom won’t be drawn.
17655
- * By default, `bottomCap` is `true`.
17656
- *
17657
- * The sixth parameter, `topCap`, is also optional. If a `false` is passed, as
17658
- * in `cylinder(20, 30, 5, 2, false, false)` the cylinder’s top won’t be
17659
- * drawn. By default, `topCap` is `true`.
17660
- *
17661
- * Note: `cylinder()` can only be used in WebGL mode.
17662
- * @param radius radius of the cylinder. Defaults to 50.
17663
- * @param height height of the cylinder. Defaults to the value of `radius`.
17664
- * @param detailX number of edges along the top and bottom. Defaults to 24.
17665
- * @param detailY number of triangle subdivisions along the y-axis. Defaults to 1.
17666
- * @param bottomCap whether to draw the cylinder's bottom. Defaults to `true`.
17667
- * @param topCap whether to draw the cylinder's top. Defaults to `true`.
17668
- */
17669
- function cylinder(radius?: number, height?: number, detailX?: number, detailY?: number, bottomCap?: boolean, topCap?: boolean): void;
17670
-
17671
17651
  /**
17672
17652
  * Returns the sketch's current
17673
17653
  * <a href="https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL" target="_blank">URL</a>
@@ -18265,7 +18245,7 @@ function keyIsDown(code: number | string): boolean;
18265
18245
  * Sets the element's content.
18266
18246
  *
18267
18247
  * An element's content is the text between its tags. For example, the element
18268
- * `&lt;language&gt;JavaScript&lt;/language&gt;` has the content `JavaScript`.
18248
+ * `<language>JavaScript</language>` has the content `JavaScript`.
18269
18249
  *
18270
18250
  * The parameter, `content`, is a string with the element's new content.
18271
18251
  * @param content new content for the element.
@@ -18278,9 +18258,7 @@ function setContent(content: string): void;
18278
18258
  * The parameter, `model`, is the
18279
18259
  * <a href="#/p5.Geometry">p5.Geometry</a> object to draw.
18280
18260
  * <a href="#/p5.Geometry">p5.Geometry</a> objects can be built with
18281
- * <a href="#/p5/buildGeometry">buildGeometry()</a>, or
18282
- * <a href="#/p5/beginGeometry">beginGeometry()</a> and
18283
- * <a href="#/p5/endGeometry">endGeometry()</a>. They can also be loaded from
18261
+ * <a href="#/p5/buildGeometry">buildGeometry()</a>. They can also be loaded from
18284
18262
  * a file with <a href="#/p5/loadGeometry">loadGeometry()</a>.
18285
18263
  *
18286
18264
  * Note: `model()` can only be used in WebGL mode.
@@ -18388,11 +18366,11 @@ function shearY(angle: number): void;
18388
18366
  function saturation(color: P5.Color | number[] | string): number;
18389
18367
 
18390
18368
  /**
18391
- * Creates a dropdown menu `&lt;select&gt;&lt;/select&gt;` element.
18369
+ * Creates a dropdown menu `<select></select>` element.
18392
18370
  *
18393
18371
  * The parameter is optional. If `true` is passed, as in
18394
18372
  * `let mySelect = createSelect(true)`, then the dropdown will support
18395
- * multiple selections. If an existing `&lt;select&gt;&lt;/select&gt;` element
18373
+ * multiple selections. If an existing `<select></select>` element
18396
18374
  * is passed, as in `let mySelect = createSelect(otherSelect)`, the existing
18397
18375
  * element will be wrapped in a new <a href="#/p5.Element">p5.Element</a>
18398
18376
  * object.
@@ -18421,20 +18399,6 @@ function saturation(color: P5.Color | number[] | string): number;
18421
18399
  function createSelect(multiple?: boolean): P5.Element;
18422
18400
  function createSelect(existing: object): P5.Element;
18423
18401
 
18424
- /**
18425
- * Converts 3D world coordinates to 2D screen coordinates.
18426
- *
18427
- * This function takes a 3D vector and converts its coordinates
18428
- * from the world space to screen space. This can be useful for placing
18429
- * 2D elements in a 3D scene or for determining the screen position
18430
- * of 3D objects.
18431
- * @param x The x coordinate in world space. (Or a vector for all three coordinates.)
18432
- * @param y The y coordinate in world space.
18433
- * @param z The z coordinate in world space.
18434
- * @returns A vector containing the 2D screen coordinates.
18435
- */
18436
- function worldToScreen(x: number | P5.Vector, y: number, z?: number): P5.Vector;
18437
-
18438
18402
  /**
18439
18403
  * Draws a cone.
18440
18404
  *
@@ -18473,6 +18437,20 @@ function worldToScreen(x: number | P5.Vector, y: number, z?: number): P5.Vector;
18473
18437
  */
18474
18438
  function cone(radius?: number, height?: number, detailX?: number, detailY?: number, cap?: boolean): void;
18475
18439
 
18440
+ /**
18441
+ * Converts 3D world coordinates to 2D screen coordinates.
18442
+ *
18443
+ * This function takes a 3D vector and converts its coordinates
18444
+ * from the world space to screen space. This can be useful for placing
18445
+ * 2D elements in a 3D scene or for determining the screen position
18446
+ * of 3D objects.
18447
+ * @param x The x coordinate in world space. (Or a vector for all three coordinates.)
18448
+ * @param y The y coordinate in world space.
18449
+ * @param z The z coordinate in world space.
18450
+ * @returns A vector containing the 2D screen coordinates.
18451
+ */
18452
+ function worldToScreen(x: number | P5.Vector, y: number, z?: number): P5.Vector;
18453
+
18476
18454
  /**
18477
18455
  * Load a 3d model from an OBJ or STL string.
18478
18456
  *
@@ -19387,8 +19365,8 @@ function noStroke(): void;
19387
19365
  *
19388
19366
  * The parameter is optional. If a string is passed, as in
19389
19367
  * `let myRadio = createSelect('food')`, then each radio option will
19390
- * have `"food"` as its `name` parameter: `&lt;input name="food"&gt;&lt;/input&gt;`.
19391
- * If an existing `&lt;div&gt;&lt;/div&gt;` or `&lt;span&gt;&lt;/span&gt;`
19368
+ * have `"food"` as its `name` parameter: `<input name="food"></input>`.
19369
+ * If an existing `<div></div>` or `<span></span>`
19392
19370
  * element is passed, as in `let myRadio = createSelect(container)`, it will
19393
19371
  * become the radio button's parent element.
19394
19372
  *
@@ -19404,8 +19382,8 @@ function noStroke(): void;
19404
19382
  * - `myRadio.selected(value)` selects the given option and returns it as an <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement" target="_blank">`HTMLInputElement`</a>.
19405
19383
  *
19406
19384
  * - `myRadio.disable(shouldDisable)` enables the entire radio button if `true` is passed and disables it if `false` is passed.
19407
- * @param containerElement container HTML Element, either a `&lt;div&gt;&lt;/div&gt;`
19408
- * or `&lt;span&gt;&lt;/span&gt;`.
19385
+ * @param containerElement container HTML Element, either a `<div></div>`
19386
+ * or `<span></span>`.
19409
19387
  * @returns new <a href="#/p5.Element">p5.Element</a> object.
19410
19388
  */
19411
19389
  function createRadio(containerElement?: object): P5.Element;
@@ -19413,7 +19391,7 @@ function createRadio(name?: string): P5.Element;
19413
19391
  function createRadio(): P5.Element;
19414
19392
 
19415
19393
  /**
19416
- * Creates a `&lt;video&gt;` element for simple audio/video playback.
19394
+ * Creates a `<video>` element for simple audio/video playback.
19417
19395
  *
19418
19396
  * `createVideo()` returns a new
19419
19397
  * <a href="#/p5.MediaElement">p5.MediaElement</a> object. Videos are shown by
@@ -19502,7 +19480,7 @@ function loadFont(path: string, successCallback?: (font: P5.Font) => any, failur
19502
19480
  function lerpColor(c1: P5.Color, c2: P5.Color, amt: number): P5.Color;
19503
19481
 
19504
19482
  /**
19505
- * Creates a hidden `&lt;audio&gt;` element for simple audio playback.
19483
+ * Creates a hidden `<audio>` element for simple audio playback.
19506
19484
  *
19507
19485
  * `createAudio()` returns a new
19508
19486
  * <a href="#/p5.MediaElement">p5.MediaElement</a> object.
@@ -19525,22 +19503,6 @@ function lerpColor(c1: P5.Color, c2: P5.Color, amt: number): P5.Color;
19525
19503
  */
19526
19504
  function createAudio(src?: string | string[], callback?: (video: P5.MediaElement<HTMLAudioElement>) => any): P5.MediaElement<HTMLAudioElement>;
19527
19505
 
19528
- /**
19529
- * Blends multiple colors to find a color between them.
19530
- *
19531
- * The `amt` parameter specifies the amount to interpolate between the color
19532
- * stops which are colors at each `amt` value "location" with `amt` values
19533
- * that are between 2 color stops interpolating between them based on its relative
19534
- * distance to both.
19535
- *
19536
- * The way that colors are interpolated depends on the current
19537
- * <a href="/reference/p5/colorMode/">colorMode()</a>.
19538
- * @param colors_stops color stops to interpolate from
19539
- * @param amt number to use to interpolate relative to color stops
19540
- * @returns interpolated color.
19541
- */
19542
- function paletteLerp(colors_stops: [P5.Color | string | number | number[], number][], amt: number): P5.Color;
19543
-
19544
19506
  /**
19545
19507
  * Draws a torus.
19546
19508
  *
@@ -19572,6 +19534,22 @@ function paletteLerp(colors_stops: [P5.Color | string | number | number[], numbe
19572
19534
  */
19573
19535
  function torus(radius?: number, tubeRadius?: number, detailX?: number, detailY?: number): void;
19574
19536
 
19537
+ /**
19538
+ * Blends multiple colors to find a color between them.
19539
+ *
19540
+ * The `amt` parameter specifies the amount to interpolate between the color
19541
+ * stops which are colors at each `amt` value "location" with `amt` values
19542
+ * that are between 2 color stops interpolating between them based on its relative
19543
+ * distance to both.
19544
+ *
19545
+ * The way that colors are interpolated depends on the current
19546
+ * <a href="/reference/p5/colorMode/">colorMode()</a>.
19547
+ * @param colors_stops color stops to interpolate from
19548
+ * @param amt number to use to interpolate relative to color stops
19549
+ * @returns interpolated color.
19550
+ */
19551
+ function paletteLerp(colors_stops: [P5.Color | string | number | number[], number][], amt: number): P5.Color;
19552
+
19575
19553
  /**
19576
19554
  * Saves the file and closes the print stream.
19577
19555
  */
@@ -19795,7 +19773,7 @@ function buildMaterialShader(callback: Function, scope?: object): P5.Shader;
19795
19773
  function buildMaterialShader(hooks: object, scope?: object): P5.Shader;
19796
19774
 
19797
19775
  /**
19798
- * Creates a `&lt;video&gt;` element that "captures" the audio/video stream from
19776
+ * Creates a `<video>` element that "captures" the audio/video stream from
19799
19777
  * the webcam and microphone.
19800
19778
  *
19801
19779
  * `createCapture()` returns a new
@@ -20108,7 +20086,7 @@ function erase(strengthFill?: number, strengthStroke?: number): void;
20108
20086
  function noErase(): void;
20109
20087
 
20110
20088
  /**
20111
- * Creates a text `&lt;input&gt;&lt;/input&gt;` element.
20089
+ * Creates a text `<input></input>` element.
20112
20090
  *
20113
20091
  * Call `myInput.size()` to set the length of the text box.
20114
20092
  *
@@ -20456,7 +20434,7 @@ function saveJSON(json: any[] | object, filename: string, optimize?: boolean): v
20456
20434
  function pop(): void;
20457
20435
 
20458
20436
  /**
20459
- * Creates an `&lt;input&gt;&lt;/input&gt;` element of type `'file'`.
20437
+ * Creates an `<input></input>` element of type `'file'`.
20460
20438
  *
20461
20439
  * `createFileInput()` allows users to select local files for use in a sketch.
20462
20440
  * It returns a <a href="#/p5.File">p5.File</a> object.
@@ -21436,6 +21414,20 @@ function vertex(x: number, y: number): void;
21436
21414
  function vertex(x: number, y: number, u?: number, v?: number): void;
21437
21415
  function vertex(x: number, y: number, z: number, u?: number, v?: number): void;
21438
21416
 
21417
+ /**
21418
+ * Sets the number of segments used to draw spline curves in WebGL mode.
21419
+ *
21420
+ * In WebGL mode, smooth shapes are drawn using many flat segments. Adding
21421
+ * more flat segments makes shapes appear smoother.
21422
+ *
21423
+ * The parameter, `detail`, is the density of segments to use while drawing a
21424
+ * spline curve.
21425
+ *
21426
+ * Note: `curveDetail()` has no effect in 2D mode.
21427
+ * @param resolution number of segments to use. Default is 1/4
21428
+ */
21429
+ function curveDetail(resolution: number): void;
21430
+
21439
21431
  /**
21440
21432
  * Sets the frustum of the current camera in a 3D sketch.
21441
21433
  *
@@ -21475,20 +21467,6 @@ function vertex(x: number, y: number, z: number, u?: number, v?: number): void;
21475
21467
  */
21476
21468
  function frustum(left?: number, right?: number, bottom?: number, top?: number, near?: number, far?: number): void;
21477
21469
 
21478
- /**
21479
- * Sets the number of segments used to draw spline curves in WebGL mode.
21480
- *
21481
- * In WebGL mode, smooth shapes are drawn using many flat segments. Adding
21482
- * more flat segments makes shapes appear smoother.
21483
- *
21484
- * The parameter, `detail`, is the density of segments to use while drawing a
21485
- * spline curve.
21486
- *
21487
- * Note: `curveDetail()` has no effect in 2D mode.
21488
- * @param resolution number of segments to use. Default is 1/4
21489
- */
21490
- function curveDetail(resolution: number): void;
21491
-
21492
21470
  /**
21493
21471
  * Creates a new <a href="#/p5.Camera">p5.Camera</a> object.
21494
21472
  *