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.
- package/README.md +4 -5
- package/dist/accessibility/color_namer.js +4 -4
- package/dist/accessibility/index.js +4 -4
- package/dist/app.js +4 -4
- package/dist/color/color_conversion.js +4 -4
- package/dist/color/index.js +1 -1
- package/dist/color/setting.js +1 -1
- package/dist/{constants-BUwWryrh.js → constants-BdTiYOQI.js} +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/environment.js +1 -1
- package/dist/core/filterShaders.js +1 -1
- package/dist/core/friendly_errors/fes_core.js +1 -1
- package/dist/core/friendly_errors/file_errors.js +1 -1
- package/dist/core/friendly_errors/index.js +1 -1
- package/dist/core/friendly_errors/param_validator.js +1 -1
- package/dist/core/friendly_errors/sketch_verifier.js +1 -1
- package/dist/core/helpers.js +1 -1
- package/dist/core/init.js +4 -4
- package/dist/core/internationalization.js +1 -1
- package/dist/core/legacy.js +4 -4
- package/dist/core/main.js +4 -4
- package/dist/core/p5.Graphics.js +3 -3
- package/dist/core/p5.Renderer.js +2 -2
- package/dist/core/p5.Renderer2D.js +4 -4
- package/dist/core/p5.Renderer3D.js +3 -3
- package/dist/core/rendering.js +3 -3
- package/dist/data/local_storage.js +13 -9
- package/dist/dom/dom.js +30 -29
- package/dist/dom/index.js +1 -1
- package/dist/dom/p5.Element.js +3 -3
- package/dist/dom/p5.MediaElement.js +4 -5
- package/dist/events/pointer.js +1 -1
- package/dist/image/const.js +1 -1
- package/dist/image/filterRenderer2D.js +3 -3
- package/dist/image/image.js +3 -3
- package/dist/image/index.js +3 -3
- package/dist/image/loading_displaying.js +3 -3
- package/dist/image/p5.Image.js +2 -2
- package/dist/io/files.js +3 -3
- package/dist/io/index.js +3 -3
- package/dist/io/p5.XML.js +8 -8
- package/dist/{main-DFpoFdvM.js → main-H_nu4eDs.js} +3 -3
- package/dist/math/Matrices/Matrix.js +1 -1
- package/dist/math/Matrices/MatrixNumjs.js +1 -1
- package/dist/math/index.js +1 -1
- package/dist/math/p5.Matrix.js +1 -1
- package/dist/math/p5.Vector.js +1 -1
- package/dist/math/trigonometry.js +1 -1
- package/dist/{p5.Renderer-D-EuAodU.js → p5.Renderer-BmD2P6Wv.js} +4 -3
- package/dist/{rendering-DE9-Hl7Y.js → rendering-CC8JNTwG.js} +8 -35
- package/dist/shape/2d_primitives.js +1 -1
- package/dist/shape/attributes.js +1 -1
- package/dist/shape/custom_shapes.js +1 -1
- package/dist/shape/index.js +1 -1
- package/dist/type/index.js +2 -2
- package/dist/type/p5.Font.js +2 -2
- package/dist/type/textCore.js +2 -2
- package/dist/webgl/3d_primitives.js +3 -3
- package/dist/webgl/GeometryBuilder.js +1 -1
- package/dist/webgl/ShapeBuilder.js +1 -1
- package/dist/webgl/enums.js +1 -1
- package/dist/webgl/index.js +3 -3
- package/dist/webgl/interaction.js +1 -1
- package/dist/webgl/light.js +3 -3
- package/dist/webgl/loading.js +4 -6
- package/dist/webgl/material.js +3 -3
- package/dist/webgl/p5.Camera.js +3 -3
- package/dist/webgl/p5.Framebuffer.js +3 -3
- package/dist/webgl/p5.Geometry.js +1 -1
- package/dist/webgl/p5.Quat.js +1 -1
- package/dist/webgl/p5.RendererGL.js +3 -3
- package/dist/webgl/p5.Texture.js +3 -3
- package/dist/webgl/text.js +3 -3
- package/dist/webgl/utils.js +3 -3
- package/dist/webgpu/index.js +1 -1
- package/dist/webgpu/p5.RendererWebGPU.js +1 -1
- package/lib/p5.esm.js +68 -92
- package/lib/p5.esm.min.js +1 -1
- package/lib/p5.js +68 -92
- package/lib/p5.min.js +1 -1
- package/lib/p5.webgpu.esm.js +1 -1
- package/lib/p5.webgpu.js +1 -1
- package/lib/p5.webgpu.min.js +1 -1
- package/package.json +1 -1
- package/types/global.d.ts +601 -623
- package/types/p5.d.ts +297 -308
package/lib/p5.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! p5.js v2.2.3
|
|
1
|
+
/*! p5.js v2.2.3 March 21, 2026 */
|
|
2
2
|
var p5 = (function () {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -15,7 +15,7 @@ var p5 = (function () {
|
|
|
15
15
|
* @property {String} VERSION
|
|
16
16
|
* @final
|
|
17
17
|
*/
|
|
18
|
-
const VERSION = '2.2.3
|
|
18
|
+
const VERSION = '2.2.3';
|
|
19
19
|
|
|
20
20
|
// GRAPHICS RENDERER
|
|
21
21
|
/**
|
|
@@ -12791,7 +12791,7 @@ var p5 = (function () {
|
|
|
12791
12791
|
* Returns the element's name as a `String`.
|
|
12792
12792
|
*
|
|
12793
12793
|
* An XML element's name is given by its tag. For example, the element
|
|
12794
|
-
*
|
|
12794
|
+
* `<language>JavaScript</language>` has the name `language`.
|
|
12795
12795
|
*
|
|
12796
12796
|
* @return {String} name of the element.
|
|
12797
12797
|
*
|
|
@@ -12834,11 +12834,11 @@ var p5 = (function () {
|
|
|
12834
12834
|
* Sets the element's tag name.
|
|
12835
12835
|
*
|
|
12836
12836
|
* An XML element's name is given by its tag. For example, the element
|
|
12837
|
-
*
|
|
12837
|
+
* `<language>JavaScript</language>` has the name `language`.
|
|
12838
12838
|
*
|
|
12839
12839
|
* The parameter, `name`, is the element's new name as a string. For example,
|
|
12840
12840
|
* calling `myXML.setName('planet')` will make the element's new tag name
|
|
12841
|
-
*
|
|
12841
|
+
* `<planet></planet>`.
|
|
12842
12842
|
*
|
|
12843
12843
|
* @param {String} name new tag name of the element.
|
|
12844
12844
|
*
|
|
@@ -12980,7 +12980,7 @@ var p5 = (function () {
|
|
|
12980
12980
|
*
|
|
12981
12981
|
* The parameter, `name`, is optional. If a string is passed, as in
|
|
12982
12982
|
* `myXML.getChildren('cat')`, then the method will only return child elements
|
|
12983
|
-
* with the tag
|
|
12983
|
+
* with the tag `<cat>`.
|
|
12984
12984
|
*
|
|
12985
12985
|
* @param {String} [name] name of the elements to return.
|
|
12986
12986
|
* @return {p5.XML[]} child elements.
|
|
@@ -13074,7 +13074,7 @@ var p5 = (function () {
|
|
|
13074
13074
|
*
|
|
13075
13075
|
* The parameter, `name`, is optional. If a string is passed, as in
|
|
13076
13076
|
* `myXML.getChild('cat')`, then the first child element with the tag
|
|
13077
|
-
*
|
|
13077
|
+
* `<cat>` will be returned. If a number is passed, as in
|
|
13078
13078
|
* `myXML.getChild(1)`, then the child element at that index will be returned.
|
|
13079
13079
|
*
|
|
13080
13080
|
* @param {String|Integer} name element name or index.
|
|
@@ -13207,7 +13207,7 @@ var p5 = (function () {
|
|
|
13207
13207
|
*
|
|
13208
13208
|
* The parameter, `name`, is the child element to remove. If a string is
|
|
13209
13209
|
* passed, as in `myXML.removeChild('cat')`, then the first child element
|
|
13210
|
-
* with the tag
|
|
13210
|
+
* with the tag `<cat>` will be removed. If a number is passed, as in
|
|
13211
13211
|
* `myXML.removeChild(1)`, then the child element at that index will be
|
|
13212
13212
|
* removed.
|
|
13213
13213
|
*
|
|
@@ -13761,7 +13761,7 @@ var p5 = (function () {
|
|
|
13761
13761
|
* Sets the element's content.
|
|
13762
13762
|
*
|
|
13763
13763
|
* An element's content is the text between its tags. For example, the element
|
|
13764
|
-
*
|
|
13764
|
+
* `<language>JavaScript</language>` has the content `JavaScript`.
|
|
13765
13765
|
*
|
|
13766
13766
|
* The parameter, `content`, is a string with the element's new content.
|
|
13767
13767
|
*
|
|
@@ -13879,7 +13879,7 @@ var p5 = (function () {
|
|
|
13879
13879
|
* (<a href="https://developer.mozilla.org/en-US/docs/Web/XML/XML_introduction" target="_blank">XML</a>)
|
|
13880
13880
|
* is a standard format for sending data between applications. Like HTML, the
|
|
13881
13881
|
* XML format is based on tags and attributes, as in
|
|
13882
|
-
*
|
|
13882
|
+
* `<time units="s">1234</time>`.
|
|
13883
13883
|
*
|
|
13884
13884
|
* Note: Use <a href="#/p5/loadXML">loadXML()</a> to load external XML files.
|
|
13885
13885
|
*
|
|
@@ -14373,9 +14373,9 @@ var p5 = (function () {
|
|
|
14373
14373
|
/**
|
|
14374
14374
|
* Attaches the element to a parent element.
|
|
14375
14375
|
*
|
|
14376
|
-
* For example, a
|
|
14376
|
+
* For example, a `<div></div>` element may be used as a box to
|
|
14377
14377
|
* hold two pieces of text, a header and a paragraph. The
|
|
14378
|
-
*
|
|
14378
|
+
* `<div></div>` is the parent element of both the header and
|
|
14379
14379
|
* paragraph.
|
|
14380
14380
|
*
|
|
14381
14381
|
* The parameter `parent` can have one of three types. `parent` can be a
|
|
@@ -18946,8 +18946,9 @@ var p5 = (function () {
|
|
|
18946
18946
|
props.displayIndex = index;
|
|
18947
18947
|
this.drawingContext.putImageData(props.frames[index].image, 0, 0);
|
|
18948
18948
|
} else {
|
|
18949
|
-
|
|
18950
|
-
'Cannot set GIF to a frame number that is higher than total number of frames or below zero.'
|
|
18949
|
+
p5._friendlyError(
|
|
18950
|
+
'Cannot set GIF to a frame number that is higher than total number of frames or below zero.',
|
|
18951
|
+
'setFrame'
|
|
18951
18952
|
);
|
|
18952
18953
|
}
|
|
18953
18954
|
}
|
|
@@ -27693,7 +27694,6 @@ var p5 = (function () {
|
|
|
27693
27694
|
removeCue(id) {
|
|
27694
27695
|
for (let i = 0; i < this._cues.length; i++) {
|
|
27695
27696
|
if (this._cues[i].id === id) {
|
|
27696
|
-
console.log(id);
|
|
27697
27697
|
this._cues.splice(i, 1);
|
|
27698
27698
|
}
|
|
27699
27699
|
}
|
|
@@ -27843,7 +27843,7 @@ var p5 = (function () {
|
|
|
27843
27843
|
}
|
|
27844
27844
|
|
|
27845
27845
|
/**
|
|
27846
|
-
* Creates a
|
|
27846
|
+
* Creates a `<video>` element for simple audio/video playback.
|
|
27847
27847
|
*
|
|
27848
27848
|
* `createVideo()` returns a new
|
|
27849
27849
|
* <a href="#/p5.MediaElement">p5.MediaElement</a> object. Videos are shown by
|
|
@@ -27931,7 +27931,7 @@ var p5 = (function () {
|
|
|
27931
27931
|
/* AUDIO STUFF */
|
|
27932
27932
|
|
|
27933
27933
|
/**
|
|
27934
|
-
* Creates a hidden
|
|
27934
|
+
* Creates a hidden `<audio>` element for simple audio playback.
|
|
27935
27935
|
*
|
|
27936
27936
|
* `createAudio()` returns a new
|
|
27937
27937
|
* <a href="#/p5.MediaElement">p5.MediaElement</a> object.
|
|
@@ -28008,7 +28008,7 @@ var p5 = (function () {
|
|
|
28008
28008
|
}
|
|
28009
28009
|
|
|
28010
28010
|
/**
|
|
28011
|
-
* Creates a
|
|
28011
|
+
* Creates a `<video>` element that "captures" the audio/video stream from
|
|
28012
28012
|
* the webcam and microphone.
|
|
28013
28013
|
*
|
|
28014
28014
|
* `createCapture()` returns a new
|
|
@@ -36810,7 +36810,7 @@ var p5 = (function () {
|
|
|
36810
36810
|
* (<a href="https://developer.mozilla.org/en-US/docs/Web/XML/XML_introduction" target="_blank">XML</a>)
|
|
36811
36811
|
* is a standard format for sending data between applications. Like HTML, the
|
|
36812
36812
|
* XML format is based on tags and attributes, as in
|
|
36813
|
-
*
|
|
36813
|
+
* `<time units="s">1234</time>`.
|
|
36814
36814
|
*
|
|
36815
36815
|
* The first parameter, `path`, is always a string with the path to the file.
|
|
36816
36816
|
* Paths to local files should be relative, as in
|
|
@@ -55127,11 +55127,6 @@ var p5 = (function () {
|
|
|
55127
55127
|
* The parameter, `callback`, is a function with the drawing instructions for
|
|
55128
55128
|
* the new <a href="#/p5.Geometry">p5.Geometry</a> object. It will be called
|
|
55129
55129
|
* once to create the new 3D shape.
|
|
55130
|
-
*
|
|
55131
|
-
* See <a href="#/p5/beginGeometry">beginGeometry()</a> and
|
|
55132
|
-
* <a href="#/p5/endGeometry">endGeometry()</a> for another way to build 3D
|
|
55133
|
-
* shapes.
|
|
55134
|
-
*
|
|
55135
55130
|
* Note: `buildGeometry()` can only be used in WebGL mode.
|
|
55136
55131
|
*
|
|
55137
55132
|
* @method buildGeometry
|
|
@@ -55335,12 +55330,8 @@ var p5 = (function () {
|
|
|
55335
55330
|
* <a href="#/p5.Geometry">p5.Geometry</a> objects can contain lots of data
|
|
55336
55331
|
* about their vertices, surface normals, colors, and so on. Complex 3D shapes
|
|
55337
55332
|
* can use lots of memory which is a limited resource in many GPUs. Calling
|
|
55338
|
-
* `freeGeometry()` can improve performance by freeing a
|
|
55339
|
-
* <a href="#/p5.Geometry">p5.Geometry</a> object’s resources from GPU memory.
|
|
55340
55333
|
* `freeGeometry()` works with <a href="#/p5.Geometry">p5.Geometry</a> objects
|
|
55341
|
-
* created with <a href="#/p5/
|
|
55342
|
-
* <a href="#/p5/endGeometry">endGeometry()</a>,
|
|
55343
|
-
* <a href="#/p5/buildGeometry">buildGeometry()</a>, and
|
|
55334
|
+
* created with <a href="#/p5/buildGeometry">buildGeometry()</a> and
|
|
55344
55335
|
* <a href="#/p5/loadModel">loadModel()</a>.
|
|
55345
55336
|
*
|
|
55346
55337
|
* The parameter, `geometry`, is the <a href="#/p5.Geometry">p5.Geometry</a>
|
|
@@ -55356,24 +55347,6 @@ var p5 = (function () {
|
|
|
55356
55347
|
* @param {p5.Geometry} geometry 3D shape whose resources should be freed.
|
|
55357
55348
|
*
|
|
55358
55349
|
* @example
|
|
55359
|
-
* function setup() {
|
|
55360
|
-
* createCanvas(100, 100, WEBGL);
|
|
55361
|
-
*
|
|
55362
|
-
* background(200);
|
|
55363
|
-
*
|
|
55364
|
-
* // Create a p5.Geometry object.
|
|
55365
|
-
* beginGeometry();
|
|
55366
|
-
* cone();
|
|
55367
|
-
* let shape = endGeometry();
|
|
55368
|
-
*
|
|
55369
|
-
* // Draw the shape.
|
|
55370
|
-
* model(shape);
|
|
55371
|
-
*
|
|
55372
|
-
* // Free the shape's resources.
|
|
55373
|
-
* freeGeometry(shape);
|
|
55374
|
-
* }
|
|
55375
|
-
*
|
|
55376
|
-
* @example
|
|
55377
55350
|
* // Click and drag the mouse to view the scene from different angles.
|
|
55378
55351
|
*
|
|
55379
55352
|
* let button;
|
|
@@ -65477,7 +65450,7 @@ var p5 = (function () {
|
|
|
65477
65450
|
* Removes the graphics buffer from the web page.
|
|
65478
65451
|
*
|
|
65479
65452
|
* Calling `myGraphics.remove()` removes the graphics buffer's
|
|
65480
|
-
*
|
|
65453
|
+
* `<canvas>` element from the web page. The graphics buffer also uses
|
|
65481
65454
|
* a bit of memory on the CPU that can be freed like so:
|
|
65482
65455
|
*
|
|
65483
65456
|
* ```js
|
|
@@ -65833,7 +65806,7 @@ var p5 = (function () {
|
|
|
65833
65806
|
* @param {Number} h height height of the graphics buffer in pixels.
|
|
65834
65807
|
* @param {(P2D|WEBGL|P2DHDR)} renderer the renderer to use, either P2D or WEBGL.
|
|
65835
65808
|
* @param {p5} [pInst] sketch instance.
|
|
65836
|
-
* @param {HTMLCanvasElement} [canvas] existing
|
|
65809
|
+
* @param {HTMLCanvasElement} [canvas] existing `<canvas>` element to use.
|
|
65837
65810
|
*
|
|
65838
65811
|
* @example
|
|
65839
65812
|
* let pg;
|
|
@@ -68812,9 +68785,9 @@ var p5 = (function () {
|
|
|
68812
68785
|
|
|
68813
68786
|
/**
|
|
68814
68787
|
* A system variable that provides direct access to the sketch's
|
|
68815
|
-
*
|
|
68788
|
+
* `<canvas>` element.
|
|
68816
68789
|
*
|
|
68817
|
-
* The
|
|
68790
|
+
* The `<canvas>` element provides many specialized features that aren't
|
|
68818
68791
|
* included in the p5.js library. The `drawingContext` system variable
|
|
68819
68792
|
* provides access to these features by exposing the sketch's
|
|
68820
68793
|
* <a href="https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D">CanvasRenderingContext2D</a>
|
|
@@ -97297,18 +97270,20 @@ var p5 = (function () {
|
|
|
97297
97270
|
*/
|
|
97298
97271
|
fn.storeItem = function(key, value) {
|
|
97299
97272
|
if (typeof key !== 'string') {
|
|
97300
|
-
|
|
97301
|
-
`The argument that you passed to storeItem() - ${key} is not a string
|
|
97273
|
+
p5._friendlyError(
|
|
97274
|
+
`The argument that you passed to storeItem() - ${key} is not a string.`,
|
|
97275
|
+
'storeItem'
|
|
97302
97276
|
);
|
|
97303
97277
|
}
|
|
97304
97278
|
if (key.endsWith('p5TypeID')) {
|
|
97305
|
-
|
|
97306
|
-
`The argument that you passed to storeItem() - ${key} must not end with 'p5TypeID'
|
|
97279
|
+
p5._friendlyError(
|
|
97280
|
+
`The argument that you passed to storeItem() - ${key} must not end with 'p5TypeID'.`,
|
|
97281
|
+
'storeItem'
|
|
97307
97282
|
);
|
|
97308
97283
|
}
|
|
97309
97284
|
|
|
97310
97285
|
if (typeof value === 'undefined') {
|
|
97311
|
-
|
|
97286
|
+
p5._friendlyError('You cannot store undefined variables using storeItem().', 'storeItem');
|
|
97312
97287
|
}
|
|
97313
97288
|
let type = typeof value;
|
|
97314
97289
|
switch (type) {
|
|
@@ -97443,8 +97418,9 @@ var p5 = (function () {
|
|
|
97443
97418
|
let value = localStorage.getItem(key);
|
|
97444
97419
|
const type = localStorage.getItem(`${key}p5TypeID`);
|
|
97445
97420
|
if (typeof type === 'undefined') {
|
|
97446
|
-
|
|
97447
|
-
`Unable to determine type of item stored under ${key}in local storage. Did you save the item with something other than setItem()
|
|
97421
|
+
p5._friendlyError(
|
|
97422
|
+
`Unable to determine type of item stored under ${key}in local storage. Did you save the item with something other than setItem()?`,
|
|
97423
|
+
'getItem'
|
|
97448
97424
|
);
|
|
97449
97425
|
} else if (value !== null) {
|
|
97450
97426
|
switch (type) {
|
|
@@ -97595,8 +97571,9 @@ var p5 = (function () {
|
|
|
97595
97571
|
*/
|
|
97596
97572
|
fn.removeItem = function(key) {
|
|
97597
97573
|
if (typeof key !== 'string') {
|
|
97598
|
-
|
|
97599
|
-
`The argument that you passed to removeItem() - ${key} is not a string
|
|
97574
|
+
p5._friendlyError(
|
|
97575
|
+
`The argument that you passed to removeItem() - ${key} is not a string.`,
|
|
97576
|
+
'removeItem'
|
|
97600
97577
|
);
|
|
97601
97578
|
}
|
|
97602
97579
|
localStorage.removeItem(key);
|
|
@@ -97982,16 +97959,16 @@ var p5 = (function () {
|
|
|
97982
97959
|
}
|
|
97983
97960
|
|
|
97984
97961
|
/**
|
|
97985
|
-
* Creates a
|
|
97962
|
+
* Creates a `<div></div>` element.
|
|
97986
97963
|
*
|
|
97987
|
-
*
|
|
97964
|
+
* `<div></div>` elements are commonly used as containers for
|
|
97988
97965
|
* other elements.
|
|
97989
97966
|
*
|
|
97990
97967
|
* The parameter `html` is optional. It accepts a string that sets the
|
|
97991
|
-
* inner HTML of the new
|
|
97968
|
+
* inner HTML of the new `<div></div>`.
|
|
97992
97969
|
*
|
|
97993
97970
|
* @method createDiv
|
|
97994
|
-
* @param {String} [html] inner HTML for the new
|
|
97971
|
+
* @param {String} [html] inner HTML for the new `<div></div>` element.
|
|
97995
97972
|
* @return {p5.Element} new <a href="#/p5.Element">p5.Element</a> object.
|
|
97996
97973
|
*
|
|
97997
97974
|
* @example
|
|
@@ -98029,13 +98006,13 @@ var p5 = (function () {
|
|
|
98029
98006
|
/**
|
|
98030
98007
|
* Creates a paragraph element.
|
|
98031
98008
|
*
|
|
98032
|
-
*
|
|
98009
|
+
* `<p></p>` elements are commonly used for paragraph-length text.
|
|
98033
98010
|
*
|
|
98034
98011
|
* The parameter `html` is optional. It accepts a string that sets the
|
|
98035
|
-
* inner HTML of the new
|
|
98012
|
+
* inner HTML of the new `<p></p>`.
|
|
98036
98013
|
*
|
|
98037
98014
|
* @method createP
|
|
98038
|
-
* @param {String} [html] inner HTML for the new
|
|
98015
|
+
* @param {String} [html] inner HTML for the new `<p></p>` element.
|
|
98039
98016
|
* @return {p5.Element} new <a href="#/p5.Element">p5.Element</a> object.
|
|
98040
98017
|
*
|
|
98041
98018
|
* @example
|
|
@@ -98058,18 +98035,18 @@ var p5 = (function () {
|
|
|
98058
98035
|
};
|
|
98059
98036
|
|
|
98060
98037
|
/**
|
|
98061
|
-
* Creates a
|
|
98038
|
+
* Creates a `<span></span>` element.
|
|
98062
98039
|
*
|
|
98063
|
-
*
|
|
98064
|
-
* for inline elements. For example, a
|
|
98040
|
+
* `<span></span>` elements are commonly used as containers
|
|
98041
|
+
* for inline elements. For example, a `<span></span>`
|
|
98065
98042
|
* can hold part of a sentence that's a
|
|
98066
98043
|
* <span style="color: deeppink;">different</span> style.
|
|
98067
98044
|
*
|
|
98068
98045
|
* The parameter `html` is optional. It accepts a string that sets the
|
|
98069
|
-
* inner HTML of the new
|
|
98046
|
+
* inner HTML of the new `<span></span>`.
|
|
98070
98047
|
*
|
|
98071
98048
|
* @method createSpan
|
|
98072
|
-
* @param {String} [html] inner HTML for the new
|
|
98049
|
+
* @param {String} [html] inner HTML for the new `<span></span>` element.
|
|
98073
98050
|
* @return {p5.Element} new <a href="#/p5.Element">p5.Element</a> object.
|
|
98074
98051
|
*
|
|
98075
98052
|
* @example
|
|
@@ -98122,7 +98099,7 @@ var p5 = (function () {
|
|
|
98122
98099
|
};
|
|
98123
98100
|
|
|
98124
98101
|
/**
|
|
98125
|
-
* Creates an
|
|
98102
|
+
* Creates an `<img>` element that can appear outside of the canvas.
|
|
98126
98103
|
*
|
|
98127
98104
|
* The first parameter, `src`, is a string with the path to the image file.
|
|
98128
98105
|
* `src` should be a relative path, as in `'assets/image.png'`, or a URL, as
|
|
@@ -98193,7 +98170,7 @@ var p5 = (function () {
|
|
|
98193
98170
|
};
|
|
98194
98171
|
|
|
98195
98172
|
/**
|
|
98196
|
-
* Creates an
|
|
98173
|
+
* Creates an `<a></a>` element that links to another web page.
|
|
98197
98174
|
*
|
|
98198
98175
|
* The first parmeter, `href`, is a string that sets the URL of the linked
|
|
98199
98176
|
* page.
|
|
@@ -98250,7 +98227,7 @@ var p5 = (function () {
|
|
|
98250
98227
|
|
|
98251
98228
|
/* INPUT */
|
|
98252
98229
|
/**
|
|
98253
|
-
* Creates a slider
|
|
98230
|
+
* Creates a slider `<input></input>` element.
|
|
98254
98231
|
*
|
|
98255
98232
|
* Range sliders are useful for quickly selecting numbers from a given range.
|
|
98256
98233
|
*
|
|
@@ -98372,7 +98349,7 @@ var p5 = (function () {
|
|
|
98372
98349
|
};
|
|
98373
98350
|
|
|
98374
98351
|
/**
|
|
98375
|
-
* Creates a
|
|
98352
|
+
* Creates a `<button></button>` element.
|
|
98376
98353
|
*
|
|
98377
98354
|
* The first parameter, `label`, is a string that sets the label displayed on
|
|
98378
98355
|
* the button.
|
|
@@ -98449,7 +98426,7 @@ var p5 = (function () {
|
|
|
98449
98426
|
};
|
|
98450
98427
|
|
|
98451
98428
|
/**
|
|
98452
|
-
* Creates a checkbox
|
|
98429
|
+
* Creates a checkbox `<input></input>` element.
|
|
98453
98430
|
*
|
|
98454
98431
|
* Checkboxes extend the <a href="#/p5.Element">p5.Element</a> class with a
|
|
98455
98432
|
* `checked()` method. Calling `myBox.checked()` returns `true` if it the box
|
|
@@ -98590,11 +98567,11 @@ var p5 = (function () {
|
|
|
98590
98567
|
};
|
|
98591
98568
|
|
|
98592
98569
|
/**
|
|
98593
|
-
* Creates a dropdown menu
|
|
98570
|
+
* Creates a dropdown menu `<select></select>` element.
|
|
98594
98571
|
*
|
|
98595
98572
|
* The parameter is optional. If `true` is passed, as in
|
|
98596
98573
|
* `let mySelect = createSelect(true)`, then the dropdown will support
|
|
98597
|
-
* multiple selections. If an existing
|
|
98574
|
+
* multiple selections. If an existing `<select></select>` element
|
|
98598
98575
|
* is passed, as in `let mySelect = createSelect(otherSelect)`, the existing
|
|
98599
98576
|
* element will be wrapped in a new <a href="#/p5.Element">p5.Element</a>
|
|
98600
98577
|
* object.
|
|
@@ -98861,8 +98838,8 @@ var p5 = (function () {
|
|
|
98861
98838
|
*
|
|
98862
98839
|
* The parameter is optional. If a string is passed, as in
|
|
98863
98840
|
* `let myRadio = createSelect('food')`, then each radio option will
|
|
98864
|
-
* have `"food"` as its `name` parameter:
|
|
98865
|
-
* If an existing
|
|
98841
|
+
* have `"food"` as its `name` parameter: `<input name="food"></input>`.
|
|
98842
|
+
* If an existing `<div></div>` or `<span></span>`
|
|
98866
98843
|
* element is passed, as in `let myRadio = createSelect(container)`, it will
|
|
98867
98844
|
* become the radio button's parent element.
|
|
98868
98845
|
*
|
|
@@ -98875,8 +98852,8 @@ var p5 = (function () {
|
|
|
98875
98852
|
* - `myRadio.disable(shouldDisable)` enables the entire radio button if `true` is passed and disables it if `false` is passed.
|
|
98876
98853
|
*
|
|
98877
98854
|
* @method createRadio
|
|
98878
|
-
* @param {Object} [containerElement] container HTML Element, either a
|
|
98879
|
-
* or
|
|
98855
|
+
* @param {Object} [containerElement] container HTML Element, either a `<div></div>`
|
|
98856
|
+
* or `<span></span>`.
|
|
98880
98857
|
* @return {p5.Element} new <a href="#/p5.Element">p5.Element</a> object.
|
|
98881
98858
|
*
|
|
98882
98859
|
* @example
|
|
@@ -98995,7 +98972,7 @@ var p5 = (function () {
|
|
|
98995
98972
|
*/
|
|
98996
98973
|
/**
|
|
98997
98974
|
* @method createRadio
|
|
98998
|
-
* @param {String} [name] name parameter assigned to each option's
|
|
98975
|
+
* @param {String} [name] name parameter assigned to each option's `<input></input>` element.
|
|
98999
98976
|
* @return {p5.Element} new <a href="#/p5.Element">p5.Element</a> object.
|
|
99000
98977
|
*/
|
|
99001
98978
|
/**
|
|
@@ -99262,7 +99239,7 @@ var p5 = (function () {
|
|
|
99262
99239
|
};
|
|
99263
99240
|
|
|
99264
99241
|
/**
|
|
99265
|
-
* Creates a text
|
|
99242
|
+
* Creates a text `<input></input>` element.
|
|
99266
99243
|
*
|
|
99267
99244
|
* Call `myInput.size()` to set the length of the text box.
|
|
99268
99245
|
*
|
|
@@ -99338,7 +99315,7 @@ var p5 = (function () {
|
|
|
99338
99315
|
};
|
|
99339
99316
|
|
|
99340
99317
|
/**
|
|
99341
|
-
* Creates an
|
|
99318
|
+
* Creates an `<input></input>` element of type `'file'`.
|
|
99342
99319
|
*
|
|
99343
99320
|
* `createFileInput()` allows users to select local files for use in a sketch.
|
|
99344
99321
|
* It returns a <a href="#/p5.File">p5.File</a> object.
|
|
@@ -99443,8 +99420,9 @@ var p5 = (function () {
|
|
|
99443
99420
|
|
|
99444
99421
|
// If File API's are not supported, throw Error
|
|
99445
99422
|
if (!(window.File && window.FileReader && window.FileList && window.Blob)) {
|
|
99446
|
-
|
|
99447
|
-
'The File APIs are not fully supported in this browser. Cannot create element.'
|
|
99423
|
+
p5._friendlyError(
|
|
99424
|
+
'The File APIs are not fully supported in this browser. Cannot create element.',
|
|
99425
|
+
'createFileInput'
|
|
99448
99426
|
);
|
|
99449
99427
|
return;
|
|
99450
99428
|
}
|
|
@@ -103143,7 +103121,7 @@ var p5 = (function () {
|
|
|
103143
103121
|
canvas.requestPointerLock =
|
|
103144
103122
|
canvas.requestPointerLock || canvas.mozRequestPointerLock;
|
|
103145
103123
|
if (!canvas.requestPointerLock) {
|
|
103146
|
-
|
|
103124
|
+
p5._friendlyError('requestPointerLock is not implemented in this browser', 'requestPointerLock');
|
|
103147
103125
|
return false;
|
|
103148
103126
|
}
|
|
103149
103127
|
canvas.requestPointerLock();
|
|
@@ -110737,9 +110715,7 @@ var p5 = (function () {
|
|
|
110737
110715
|
* The parameter, `model`, is the
|
|
110738
110716
|
* <a href="#/p5.Geometry">p5.Geometry</a> object to draw.
|
|
110739
110717
|
* <a href="#/p5.Geometry">p5.Geometry</a> objects can be built with
|
|
110740
|
-
* <a href="#/p5/buildGeometry">buildGeometry()</a
|
|
110741
|
-
* <a href="#/p5/beginGeometry">beginGeometry()</a> and
|
|
110742
|
-
* <a href="#/p5/endGeometry">endGeometry()</a>. They can also be loaded from
|
|
110718
|
+
* <a href="#/p5/buildGeometry">buildGeometry()</a>. They can also be loaded from
|
|
110743
110719
|
* a file with <a href="#/p5/loadGeometry">loadGeometry()</a>.
|
|
110744
110720
|
*
|
|
110745
110721
|
* Note: `model()` can only be used in WebGL mode.
|