From d5c31033bc4d60dfd1c0948979278a016bd0ebf5 Mon Sep 17 00:00:00 2001 From: Johnny Huynh Date: Wed, 26 Aug 2026 01:12:15 -0700 Subject: [PATCH 01/11] Implemented lang parameter for describe functions --- src/accessibility/describe.js | 58 +++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/src/accessibility/describe.js b/src/accessibility/describe.js index 1d5511cbdf..720fc46d9c 100644 --- a/src/accessibility/describe.js +++ b/src/accessibility/describe.js @@ -19,12 +19,6 @@ function describe(p5, fn) { * * The first parameter, `text`, is the description of the canvas. * - * The second parameter, `display`, is optional. It determines how the - * description is displayed. If `LABEL` is passed, as in - * `describe('A description.', LABEL)`, the description will be visible in - * a div element next to the canvas. If `FALLBACK` is passed, as in - * `describe('A description.', FALLBACK)`, the description will only be - * visible to screen readers. This is the default mode. * * Read * Writing accessible canvas descriptions @@ -32,7 +26,6 @@ function describe(p5, fn) { * * @method describe * @param {String} text description of the canvas. - * @param {(FALLBACK|LABEL)} [display] either LABEL or FALLBACK. * * @example * function setup() { @@ -110,11 +103,14 @@ function describe(p5, fn) { * describe(`A green circle at (${x}, 50) moves from left to right on a gray square.`, LABEL); * } */ - fn.describe = function (text, display) { + fn.describe = function (text, langOrDisplay, display) { // p5._validateParameters('describe', arguments); if (typeof text !== 'string') { return; } + const parsedOptions = _parseOptions(this, langOrDisplay, display); + display = parsedOptions.display; + const { lang } = parsedOptions; const cnvId = this.canvas.id; //calls function that adds punctuation for better screen reading text = _descriptionText(text); @@ -122,6 +118,7 @@ function describe(p5, fn) { if (!this.dummyDOM) { this.dummyDOM = document.getElementById(cnvId).parentNode; } + //check if html structure for description is ready if (!this.descriptions) { this.descriptions = {}; } @@ -150,6 +147,7 @@ function describe(p5, fn) { this._describeHTML('label', text); } } + _setDescriptionLang(this, lang); }; /** @@ -162,10 +160,6 @@ function describe(p5, fn) { * * The second parameter, `text`, is the description of the element. * - * The third parameter, `display`, is optional. It determines how the - * description is displayed. If `LABEL` is passed, as in - * `describe('A description.', LABEL)`, the description will be visible in - * a div element next to the canvas. Using `LABEL` creates unhelpful * duplicates for screen readers. Only use `LABEL` during development. If * `FALLBACK` is passed, as in `describe('A description.', FALLBACK)`, the * description will only be visible to screen readers. This is the default @@ -229,11 +223,14 @@ function describe(p5, fn) { * } */ - fn.describeElement = function (name, text, display) { + fn.describeElement = function (name, text, langOrDisplay, display) { // p5._validateParameters('describeElement', arguments); if (typeof text !== 'string' || typeof name !== 'string') { return; } + const parsedOptions = _parseOptions(this, langOrDisplay, display); + display = parsedOptions.display; + const { lang } = parsedOptions; const cnvId = this.canvas.id; //calls function that adds punctuation for better screen reading text = _descriptionText(text); @@ -281,6 +278,7 @@ function describe(p5, fn) { this._describeElementHTML('label', name, inner); } } + _setDescriptionLang(this, lang); }; /* @@ -289,6 +287,40 @@ function describe(p5, fn) { * */ + function _parseOptions(pInst, langOrDisplay, display) { + if (typeof langOrDisplay === 'object' && langOrDisplay !== null) { + return { + display: display === undefined ? langOrDisplay.display : display, + lang: langOrDisplay.lang + }; + } + if ( + langOrDisplay === pInst.LABEL || + langOrDisplay === pInst.FALLBACK + ) { + return { display: langOrDisplay }; + } + return { display, lang: langOrDisplay }; + } + + function _setDescriptionLang(pInst, lang) { + if (typeof lang !== 'string') { + return; + } + const cnvId = pInst.canvas.id; + const canvas = pInst.canvas.elt || pInst.elt || pInst.canvas; + canvas.setAttribute('lang', lang); + const containers = pInst.dummyDOM.querySelectorAll( + `#${cnvId}${descContainer}, #${cnvId}${labelContainer}` + ); + containers.forEach(container => { + container.setAttribute('lang', lang); + container + .querySelectorAll('p, table, caption, tr, th, td') + .forEach(element => element.setAttribute('lang', lang)); + }); + } + // check that text is not LABEL or FALLBACK and ensure text ends with punctuation mark function _descriptionText(text) { if (text === 'label' || text === 'fallback') { From 91be0c35ff981630377bae368dd8915423f1cb2c Mon Sep 17 00:00:00 2001 From: Johnny Huynh Date: Wed, 26 Aug 2026 19:24:26 -0700 Subject: [PATCH 02/11] Refactored some files to make it easier to read and made the parameters more beginner friendly --- src/accessibility/describe.js | 110 ++++++++++++++++++++++++++-------- 1 file changed, 85 insertions(+), 25 deletions(-) diff --git a/src/accessibility/describe.js b/src/accessibility/describe.js index 720fc46d9c..8d8faaa5e9 100644 --- a/src/accessibility/describe.js +++ b/src/accessibility/describe.js @@ -19,6 +19,24 @@ function describe(p5, fn) { * * The first parameter, `text`, is the description of the canvas. * + * The second parameter, `langOrDisplay`, is optional. It can either + * determine the language of the description or how the description + * is displayed. The description can be displayed with either `LABEL` or `FALLBACK`. + * - If a lang is passed, as in `describe('A description.', 'en')`, + * the description will be read by the screen reader using the + * specified language's voice. The screen reader must have the specified + * language's voice installed for this to work. + * - If `LABEL` is passed, as in `describe('A description.', LABEL)`, + * the description will be visible in a div element next to the canvas. + * - If `FALLBACK` is passed, as in `describe('A description.', FALLBACK)`, + * the description will only be visible to screen readers. FALLBACK is + * the default mode. + * + * The third parameter, `display`, is optional but is only used if the second + * parameter is lang, as in the language of the description, and the user wants + * to determine how the description is displayed as well. In this case, they can + * pass either `LABEL` or `FALLBACK` as the third parameter. + * * * Read * Writing accessible canvas descriptions @@ -26,6 +44,8 @@ function describe(p5, fn) { * * @method describe * @param {String} text description of the canvas. + * @param {(FALLBACK|LABEL|String)} [langOrDisplay] valid lang attribute or either LABEL or FALLBACK. + * @param {(FALLBACK|LABEL|String)} [display] either LABEL or FALLBACK. * * @example * function setup() { @@ -159,6 +179,16 @@ function describe(p5, fn) { * The first parameter, `name`, is the name of the element. * * The second parameter, `text`, is the description of the element. + * + * The third parameter, `langOrDisplay`, is optional. It can either + * determine the language of the description or how the description + * is displayed. The description can be displayed with either `LABEL` + * or `FALLBACK` + * + * The fourth parameter, `display`, is optional but is only used if the third + * parameter is lang, as in the language of the description, and the user wants + * to determine how the description is displayed as well. In this case, they can + * pass either `LABEL` or `FALLBACK` as the fourth parameter. * * duplicates for screen readers. Only use `LABEL` during development. If * `FALLBACK` is passed, as in `describe('A description.', FALLBACK)`, the @@ -172,8 +202,8 @@ function describe(p5, fn) { * @method describeElement * @param {String} name name of the element. * @param {String} text description of the element. - * @param {(FALLBACK|LABEL)} [display] either LABEL or FALLBACK. - * + * @param {(FALLBACK|LABEL|String)} [langOrDisplay] valid lang attribute or either LABEL or FALLBACK. + * @param {(FALLBACK|LABEL|String)} [display] either LABEL or FALLBACK. * @example * function setup() { * background('pink'); @@ -239,8 +269,11 @@ function describe(p5, fn) { //remove any special characters from name to use it as html id name = name.replace(/[^a-zA-Z0-9]/g, ''); + // Inject lang attribute + let langAttr = typeof lang === 'string' ? ` lang="${lang}"` : ''; + //store element description - let inner = `${elementName}${text}`; + let inner = `${elementName}${text}`; //if there is no dummyDOM if (!this.dummyDOM) { this.dummyDOM = document.getElementById(cnvId).parentNode; @@ -278,7 +311,6 @@ function describe(p5, fn) { this._describeElementHTML('label', name, inner); } } - _setDescriptionLang(this, lang); }; /* @@ -288,37 +320,65 @@ function describe(p5, fn) { */ function _parseOptions(pInst, langOrDisplay, display) { + // Check if 2nd parameter is an object if (typeof langOrDisplay === 'object' && langOrDisplay !== null) { + let finalDisplay = display; + if (finalDisplay === undefined) { + finalDisplay = langOrDisplay.display; + } return { - display: display === undefined ? langOrDisplay.display : display, + display: finalDisplay, lang: langOrDisplay.lang }; } - if ( - langOrDisplay === pInst.LABEL || - langOrDisplay === pInst.FALLBACK - ) { - return { display: langOrDisplay }; + + // Check if langOrDisplay is display (LABEL or FALLBACK) + // Example: describe describe('text', LABEL) + // If 3 parameters: describe('text', LABEL, 'es') + if (langOrDisplay === pInst.LABEL || langOrDisplay === pInst.FALLBACK) { + let finalLang = undefined; + // Check if 3rd parameter exists and is a string (lang attribute) + if (typeof display === 'string') { + finalLang = display; + } + else if (typeof display === 'object' && display !== null) { + finalLang = display.lang; + } + return {display: langOrDisplay, lang: finalLang}; } - return { display, lang: langOrDisplay }; + + // langOrDisplay is lang + // Example: describe('text', 'es') + // If 3 parameters: describe('text', 'es', LABEL) + return {display: display, lang: langOrDisplay}; } function _setDescriptionLang(pInst, lang) { - if (typeof lang !== 'string') { - return; - } - const cnvId = pInst.canvas.id; const canvas = pInst.canvas.elt || pInst.elt || pInst.canvas; - canvas.setAttribute('lang', lang); - const containers = pInst.dummyDOM.querySelectorAll( - `#${cnvId}${descContainer}, #${cnvId}${labelContainer}` - ); - containers.forEach(container => { - container.setAttribute('lang', lang); - container - .querySelectorAll('p, table, caption, tr, th, td') - .forEach(element => element.setAttribute('lang', lang)); - }); + if (typeof lang === 'string') { + canvas.setAttribute('lang', lang); + } + else { + canvas.removeAttribute('lang'); + } + + if (pInst.descriptions.fallback) { + if (typeof lang === 'string') { + pInst.descriptions.fallback.setAttribute('lang', lang); + } + else { + pInst.descriptions.fallback.removeAttribute('lang'); + } + } + + if (pInst.descriptions.label) { + if (typeof lang === 'string') { + pInst.descriptions.label.setAttribute('lang', lang); + } + else { + pInst.descriptions.label.removeAttribute('lang'); + } + } } // check that text is not LABEL or FALLBACK and ensure text ends with punctuation mark From 771cb45405382669367d31095564a09fb696f1b0 Mon Sep 17 00:00:00 2001 From: Johnny Huynh Date: Wed, 26 Aug 2026 21:10:21 -0700 Subject: [PATCH 03/11] Tests 5 variations of parameters for describe and describeElement --- test/unit/accessibility/describe.js | 83 ++++++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 1 deletion(-) diff --git a/test/unit/accessibility/describe.js b/test/unit/accessibility/describe.js index 427aa16ce0..1721ad3b82 100644 --- a/test/unit/accessibility/describe.js +++ b/test/unit/accessibility/describe.js @@ -11,6 +11,16 @@ suite('describe', function () { mockP5Prototype.FALLBACK = 'fallback'; }); + beforeEach(function () { + document.querySelectorAll('[id^="' + myID + '_"]').forEach(element => { + element.remove(); + }); + mockP5Prototype.elt.innerHTML = ''; + mockP5Prototype.elt.removeAttribute('lang'); + mockP5Prototype.dummyDOM = undefined; + mockP5Prototype.descriptions = undefined; + }); + suite('p5.prototype.describe', function () { test('should be a function', function () { assert.ok(mockP5Prototype.describe); @@ -27,12 +37,51 @@ suite('describe', function () { ); }); - test('should create description as fallback', function () { + test('should create description as FALLBACK', function () { mockP5Prototype.describe('a'); let actual = document.getElementById(myID + '_fallbackDesc'); assert.deepEqual(actual.innerHTML, 'a.'); }); + test('should support text only', function () { + mockP5Prototype.describe('Chào các bạn'); + let actual = document.getElementById(myID + '_fallbackDesc').innerHTML; + assert.deepEqual(actual, 'Chào các bạn.'); + assert.isNull(document.getElementById(myID + '_Label')); + assert.isNull(document.getElementById(myID + '_fallbackDesc').getAttribute('lang')); + }); + + test('should support text and lang', function () { + mockP5Prototype.describe('Chào các bạn', 'vi'); + let actual = document.getElementById(myID + '_fallbackDesc'); + assert.deepEqual(actual.innerHTML, 'Chào các bạn.'); + assert.deepEqual(actual.getAttribute('lang'), 'vi'); + assert.deepEqual(mockP5Prototype.elt.getAttribute('lang'), 'vi'); + assert.isNull(document.getElementById(myID + '_Label')); + }); + + test('should support text and display', function () { + mockP5Prototype.describe('Chào các bạn', mockP5Prototype.LABEL); + let actual = document.getElementById(myID + '_labelDesc').innerHTML; + assert.deepEqual(actual, 'Chào các bạn.'); + assert.isNull(document.getElementById(myID + '_labelDesc').getAttribute('lang')); + }); + + test('should support text lang and display', function () { + mockP5Prototype.describe('Chào các bạn', 'vi', mockP5Prototype.FALLBACK); + let actual = document.getElementById(myID + '_fallbackDesc'); + assert.deepEqual(actual.innerHTML, 'Chào các bạn.'); + assert.deepEqual(actual.getAttribute('lang'), 'vi'); + assert.isNull(document.getElementById(myID + '_Label')); + }); + + test('should support text display and lang', function () { + mockP5Prototype.describe('Chào các bạn', mockP5Prototype.LABEL, 'vi'); + let actual = document.getElementById(myID + '_labelDesc'); + assert.deepEqual(actual.innerHTML, 'Chào các bạn.'); + assert.deepEqual(actual.getAttribute('lang'), 'vi'); + }); + test('should not add extra period if string ends in "."', function () { mockP5Prototype.describe('A.'); let actual = document.getElementById(myID + '_fallbackDesc'); @@ -104,6 +153,38 @@ suite('describe', function () { assert.deepEqual(actual, 'az:b.'); }); + test('should support element text only', function () { + mockP5Prototype.describeElement('ai', 'Chào các bạn'); + let actual = document.getElementById(myID + '_fte_ai').innerHTML; + assert.deepEqual(actual, 'ai:Chào các bạn.'); + }); + + test('should support element text and lang', function () { + mockP5Prototype.describeElement('aj', 'Chào các bạn', 'vi'); + let actual = document.getElementById(myID + '_fte_aj').innerHTML; + assert.deepEqual(actual, 'aj:Chào các bạn.' + ); + }); + + test('should support element text and display', function () { + mockP5Prototype.describeElement('ak', 'Chào các bạn', mockP5Prototype.LABEL); + let actual = document.getElementById(myID + '_lte_ak').innerHTML; + assert.deepEqual(actual, 'ak:Chào các bạn.'); + }); + + test('should support element text lang and display', function () { + mockP5Prototype.describeElement('al', 'Chào các bạn', 'vi', mockP5Prototype.FALLBACK); + let actual = document.getElementById(myID + '_fte_al').innerHTML; + assert.deepEqual(actual, 'al:Chào các bạn.' + ); + }); + + test('should support element text display and lang', function () { + mockP5Prototype.describeElement('am', 'Chào các bạn', mockP5Prototype.LABEL, 'vi'); + let actual = document.getElementById(myID + '_lte_am').innerHTML; + assert.deepEqual(actual, 'am:Chào các bạn.'); + }); + test('should not add extra ":" if element name ends in colon', function () { mockP5Prototype.describeElement('ab:', 'b.'); let actual = document.getElementById(myID + '_fte_ab').innerHTML; From 01c3161b21bd9ff53f8c5c48a077954c5f1db8ee Mon Sep 17 00:00:00 2001 From: Johnny Huynh Date: Wed, 26 Aug 2026 21:13:58 -0700 Subject: [PATCH 04/11] Removed my tests that might have preexisted --- test/unit/accessibility/describe.js | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/test/unit/accessibility/describe.js b/test/unit/accessibility/describe.js index 1721ad3b82..b0a583a680 100644 --- a/test/unit/accessibility/describe.js +++ b/test/unit/accessibility/describe.js @@ -43,14 +43,6 @@ suite('describe', function () { assert.deepEqual(actual.innerHTML, 'a.'); }); - test('should support text only', function () { - mockP5Prototype.describe('Chào các bạn'); - let actual = document.getElementById(myID + '_fallbackDesc').innerHTML; - assert.deepEqual(actual, 'Chào các bạn.'); - assert.isNull(document.getElementById(myID + '_Label')); - assert.isNull(document.getElementById(myID + '_fallbackDesc').getAttribute('lang')); - }); - test('should support text and lang', function () { mockP5Prototype.describe('Chào các bạn', 'vi'); let actual = document.getElementById(myID + '_fallbackDesc'); @@ -60,13 +52,6 @@ suite('describe', function () { assert.isNull(document.getElementById(myID + '_Label')); }); - test('should support text and display', function () { - mockP5Prototype.describe('Chào các bạn', mockP5Prototype.LABEL); - let actual = document.getElementById(myID + '_labelDesc').innerHTML; - assert.deepEqual(actual, 'Chào các bạn.'); - assert.isNull(document.getElementById(myID + '_labelDesc').getAttribute('lang')); - }); - test('should support text lang and display', function () { mockP5Prototype.describe('Chào các bạn', 'vi', mockP5Prototype.FALLBACK); let actual = document.getElementById(myID + '_fallbackDesc'); @@ -153,12 +138,6 @@ suite('describe', function () { assert.deepEqual(actual, 'az:b.'); }); - test('should support element text only', function () { - mockP5Prototype.describeElement('ai', 'Chào các bạn'); - let actual = document.getElementById(myID + '_fte_ai').innerHTML; - assert.deepEqual(actual, 'ai:Chào các bạn.'); - }); - test('should support element text and lang', function () { mockP5Prototype.describeElement('aj', 'Chào các bạn', 'vi'); let actual = document.getElementById(myID + '_fte_aj').innerHTML; @@ -166,12 +145,6 @@ suite('describe', function () { ); }); - test('should support element text and display', function () { - mockP5Prototype.describeElement('ak', 'Chào các bạn', mockP5Prototype.LABEL); - let actual = document.getElementById(myID + '_lte_ak').innerHTML; - assert.deepEqual(actual, 'ak:Chào các bạn.'); - }); - test('should support element text lang and display', function () { mockP5Prototype.describeElement('al', 'Chào các bạn', 'vi', mockP5Prototype.FALLBACK); let actual = document.getElementById(myID + '_fte_al').innerHTML; From 31e0438e6b87468aa80a9e7f324f500883eb38b2 Mon Sep 17 00:00:00 2001 From: Johnny Huynh Date: Wed, 26 Aug 2026 21:54:44 -0700 Subject: [PATCH 05/11] Manual test pages from the research are added. Also included some tests on canvas when updating the describe functions. --- .../accessibility/describe/index.html | 46 +++++++++++++++++++ .../accessibility/describe/sketch.js | 40 ++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 test/manual-test-examples/accessibility/describe/index.html create mode 100644 test/manual-test-examples/accessibility/describe/sketch.js diff --git a/test/manual-test-examples/accessibility/describe/index.html b/test/manual-test-examples/accessibility/describe/index.html new file mode 100644 index 0000000000..586c215bae --- /dev/null +++ b/test/manual-test-examples/accessibility/describe/index.html @@ -0,0 +1,46 @@ + + + + + + + Accessibility: describe language + + + + + + + +
+

Accessibility: describe() language test

+
+ +
+

Read each region with a screen reader. Compare regions without a lang attribute with those that have one.

+ +
+

this is a test

+
+
+

this is a test

+
+
+

esto es una prueba

+
+
+

esto es una prueba

+
+
+

Cái này là bài thi

+
+
+

Cái này là bài thi

+
+ +

p5.js generated descriptions

+

Read the descriptions generated by the canvases below. The visible LABEL descriptions are included for inspection.

+
+ + + diff --git a/test/manual-test-examples/accessibility/describe/sketch.js b/test/manual-test-examples/accessibility/describe/sketch.js new file mode 100644 index 0000000000..d0a992a505 --- /dev/null +++ b/test/manual-test-examples/accessibility/describe/sketch.js @@ -0,0 +1,40 @@ +function setup() { + // Uncomment any of the following lines to test + + createCanvas(400, 400); + + // Text only (fallback is the default) + // describe('Cái này là bài thi'); + + // Text and display + // describe('Esto es una prueba', LABEL); + + // Text and lang + //describe('Esto es una prueba', 'es'); + + // Text, lang, and display + // describe('Cái này là bài thi', 'vi', LABEL); + + // Text, display, and lang + // describe('यह टेस्ट है', LABEL, 'hi'); + + + + // Name and text only (fallback is the default) + // describeElement('a', 'Cái này là bài thi'); + + // Name, text, and display + // describeElement('b', 'Esto es una prueba', LABEL); + + // Name, text, and lang + // describeElement('c', 'Esto es una prueba', 'es'); + + // Name, text, lang, and display + // describeElement('d', 'Cái này là bài thi', 'vi', LABEL); + + // Name, text, display, and lang + // describeElement('e', 'यह टेस्ट है', LABEL, 'hi'); + + fill('blue'); + circle(200, 150, 100); +} \ No newline at end of file From 6cfaf8aa892694a52b6c1a4b891c50c0fcd4f9f5 Mon Sep 17 00:00:00 2001 From: Johnny Huynh Date: Wed, 26 Aug 2026 23:47:35 -0700 Subject: [PATCH 06/11] small JSDoc updates for param and helper function --- src/accessibility/describe.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/accessibility/describe.js b/src/accessibility/describe.js index 8d8faaa5e9..2d9bce0ee8 100644 --- a/src/accessibility/describe.js +++ b/src/accessibility/describe.js @@ -45,7 +45,7 @@ function describe(p5, fn) { * @method describe * @param {String} text description of the canvas. * @param {(FALLBACK|LABEL|String)} [langOrDisplay] valid lang attribute or either LABEL or FALLBACK. - * @param {(FALLBACK|LABEL|String)} [display] either LABEL or FALLBACK. + * @param {(FALLBACK|LABEL)} [display] either LABEL or FALLBACK. * * @example * function setup() { @@ -190,10 +190,11 @@ function describe(p5, fn) { * to determine how the description is displayed as well. In this case, they can * pass either `LABEL` or `FALLBACK` as the fourth parameter. * - * duplicates for screen readers. Only use `LABEL` during development. If - * `FALLBACK` is passed, as in `describe('A description.', FALLBACK)`, the - * description will only be visible to screen readers. This is the default - * mode. + * If `LABEL` is passed, as in `describe('A description.', LABEL)`, + * the description will be visible in a div element next to the canvas. Using + * `LABEL` creates unhelpful duplicates for screen readers. Only use `LABEL` + * during development. If `FALLBACK` is passed, as in `describe('A description.', FALLBACK)`, + * the description will only be visible to screen readers. This is the default mode. * * Read * Writing accessible canvas descriptions @@ -203,7 +204,7 @@ function describe(p5, fn) { * @param {String} name name of the element. * @param {String} text description of the element. * @param {(FALLBACK|LABEL|String)} [langOrDisplay] valid lang attribute or either LABEL or FALLBACK. - * @param {(FALLBACK|LABEL|String)} [display] either LABEL or FALLBACK. + * @param {(FALLBACK|LABEL)} [display] either LABEL or FALLBACK. * @example * function setup() { * background('pink'); @@ -319,6 +320,7 @@ function describe(p5, fn) { * */ + // Helps parse the optional parameters regardless of order function _parseOptions(pInst, langOrDisplay, display) { // Check if 2nd parameter is an object if (typeof langOrDisplay === 'object' && langOrDisplay !== null) { From bda2d12704310ee8e744798ccc978b2dcf154883 Mon Sep 17 00:00:00 2001 From: Johnny Huynh Date: Fri, 25 Sep 2026 20:30:27 -0700 Subject: [PATCH 07/11] Modified parameter orders for describe functions and incorporated decorator patterns --- src/accessibility/describe.js | 126 ++++++++++++++++------------------ 1 file changed, 58 insertions(+), 68 deletions(-) diff --git a/src/accessibility/describe.js b/src/accessibility/describe.js index 2d9bce0ee8..a49eae58d8 100644 --- a/src/accessibility/describe.js +++ b/src/accessibility/describe.js @@ -19,23 +19,11 @@ function describe(p5, fn) { * * The first parameter, `text`, is the description of the canvas. * - * The second parameter, `langOrDisplay`, is optional. It can either - * determine the language of the description or how the description - * is displayed. The description can be displayed with either `LABEL` or `FALLBACK`. - * - If a lang is passed, as in `describe('A description.', 'en')`, - * the description will be read by the screen reader using the - * specified language's voice. The screen reader must have the specified - * language's voice installed for this to work. - * - If `LABEL` is passed, as in `describe('A description.', LABEL)`, - * the description will be visible in a div element next to the canvas. - * - If `FALLBACK` is passed, as in `describe('A description.', FALLBACK)`, - * the description will only be visible to screen readers. FALLBACK is - * the default mode. - * - * The third parameter, `display`, is optional but is only used if the second - * parameter is lang, as in the language of the description, and the user wants - * to determine how the description is displayed as well. In this case, they can - * pass either `LABEL` or `FALLBACK` as the third parameter. + * The second parameter, `display`, is optional and can be `LABEL` or + * `FALLBACK`. The third parameter, `lang`, is optional and sets the language + * of the description for screen readers. However, if only the optional 'lang' + * parameter is passed, it will be treated as the second optional parameter and + * the default option 'FALLBACK' will be used as the display. * * * Read @@ -44,8 +32,8 @@ function describe(p5, fn) { * * @method describe * @param {String} text description of the canvas. - * @param {(FALLBACK|LABEL|String)} [langOrDisplay] valid lang attribute or either LABEL or FALLBACK. * @param {(FALLBACK|LABEL)} [display] either LABEL or FALLBACK. + * @param {String} [lang] valid lang attribute. * * @example * function setup() { @@ -123,14 +111,11 @@ function describe(p5, fn) { * describe(`A green circle at (${x}, 50) moves from left to right on a gray square.`, LABEL); * } */ - fn.describe = function (text, langOrDisplay, display) { + fn.describe = function (text, display, lang) { // p5._validateParameters('describe', arguments); if (typeof text !== 'string') { return; } - const parsedOptions = _parseOptions(this, langOrDisplay, display); - display = parsedOptions.display; - const { lang } = parsedOptions; const cnvId = this.canvas.id; //calls function that adds punctuation for better screen reading text = _descriptionText(text); @@ -170,6 +155,40 @@ function describe(p5, fn) { _setDescriptionLang(this, lang); }; + p5.registerDecorator('p5.prototype.describe', function (target) { + return function (text, display, lang) { + // Checks for optional parameters and rearranges if needed + if (arguments.length === 2 && typeof display === 'string') { + // (text, display) + if (display === this.LABEL || display === this.FALLBACK) { + return target.call(this, text, display, undefined); + } + // (text, lang) + return target.call(this, text, undefined, display); + } + _checkDescriptionOptions(this, 'describe', display, lang); + // (text, display, lang) or just (text) + return target.call(this, text, display, lang); + }; + }); + + p5.registerDecorator('p5.prototype.describeElement', function (target) { + return function (name, text, display, lang) { + // Checks for optional parameters and rearranges if needed + if (arguments.length === 3 && typeof display === 'string') { + // (name, text, display) + if (display === this.LABEL || display === this.FALLBACK) { + return target.call(this, name, text, display, undefined); + } + // (name, text, lang) + return target.call(this, name, text, undefined, display); + } + _checkDescriptionOptions(this, 'describeElement', display, lang); + // (name, text, display, lang) or just (name, text) + return target.call(this, name, text, display, lang); + }; + }); + /** * Creates a screen reader-accessible description of elements in the canvas. * @@ -180,15 +199,11 @@ function describe(p5, fn) { * * The second parameter, `text`, is the description of the element. * - * The third parameter, `langOrDisplay`, is optional. It can either - * determine the language of the description or how the description - * is displayed. The description can be displayed with either `LABEL` - * or `FALLBACK` - * - * The fourth parameter, `display`, is optional but is only used if the third - * parameter is lang, as in the language of the description, and the user wants - * to determine how the description is displayed as well. In this case, they can - * pass either `LABEL` or `FALLBACK` as the fourth parameter. + * The third parameter, `display`, is optional and can be `LABEL` or + * `FALLBACK`. The fourth parameter, `lang`, is optional and sets the language + * of the description for screen readers. However, if only the optional 'lang' + * parameter is passed, it will be treated as the third optional parameter and + * the default option 'FALLBACK' will be used as the display. * * If `LABEL` is passed, as in `describe('A description.', LABEL)`, * the description will be visible in a div element next to the canvas. Using @@ -203,8 +218,8 @@ function describe(p5, fn) { * @method describeElement * @param {String} name name of the element. * @param {String} text description of the element. - * @param {(FALLBACK|LABEL|String)} [langOrDisplay] valid lang attribute or either LABEL or FALLBACK. - * @param {(FALLBACK|LABEL)} [display] either LABEL or FALLBACK. + * @param {(FALLBACK|LABEL)} [display] either LABEL or FALLBACK. + * @param {String} [lang] valid lang attribute. * @example * function setup() { * background('pink'); @@ -254,14 +269,11 @@ function describe(p5, fn) { * } */ - fn.describeElement = function (name, text, langOrDisplay, display) { + fn.describeElement = function (name, text, display, lang) { // p5._validateParameters('describeElement', arguments); if (typeof text !== 'string' || typeof name !== 'string') { return; } - const parsedOptions = _parseOptions(this, langOrDisplay, display); - display = parsedOptions.display; - const { lang } = parsedOptions; const cnvId = this.canvas.id; //calls function that adds punctuation for better screen reading text = _descriptionText(text); @@ -312,6 +324,7 @@ function describe(p5, fn) { this._describeElementHTML('label', name, inner); } } + _setDescriptionLang(this, lang); }; /* @@ -320,39 +333,16 @@ function describe(p5, fn) { * */ - // Helps parse the optional parameters regardless of order - function _parseOptions(pInst, langOrDisplay, display) { - // Check if 2nd parameter is an object - if (typeof langOrDisplay === 'object' && langOrDisplay !== null) { - let finalDisplay = display; - if (finalDisplay === undefined) { - finalDisplay = langOrDisplay.display; - } - return { - display: finalDisplay, - lang: langOrDisplay.lang - }; - } + function _checkDescriptionOptions(pInst, methodName, display, lang) { + // Ensures display and lang are in the correct orders and are valid + const validDisplay = display === undefined || display === pInst.LABEL || display === pInst.FALLBACK; + const validLanguage = lang === undefined || typeof lang === 'string'; - // Check if langOrDisplay is display (LABEL or FALLBACK) - // Example: describe describe('text', LABEL) - // If 3 parameters: describe('text', LABEL, 'es') - if (langOrDisplay === pInst.LABEL || langOrDisplay === pInst.FALLBACK) { - let finalLang = undefined; - // Check if 3rd parameter exists and is a string (lang attribute) - if (typeof display === 'string') { - finalLang = display; - } - else if (typeof display === 'object' && display !== null) { - finalLang = display.lang; - } - return {display: langOrDisplay, lang: finalLang}; + if (!validDisplay || !validLanguage) { + throw new TypeError( + `${methodName}() expects display (LABEL or FALLBACK) before lang.` + ); } - - // langOrDisplay is lang - // Example: describe('text', 'es') - // If 3 parameters: describe('text', 'es', LABEL) - return {display: display, lang: langOrDisplay}; } function _setDescriptionLang(pInst, lang) { From 2c170b356edc4d261e22fef263228812c8e3c348 Mon Sep 17 00:00:00 2001 From: Johnny Huynh Date: Fri, 25 Sep 2026 21:06:39 -0700 Subject: [PATCH 08/11] Updated unit and manual tests --- src/accessibility/describe.js | 74 ++++++++++--------- .../accessibility/describe/sketch.js | 16 ++-- test/unit/accessibility/describe.js | 45 ++++++++++- 3 files changed, 91 insertions(+), 44 deletions(-) diff --git a/src/accessibility/describe.js b/src/accessibility/describe.js index a49eae58d8..cda9f90c9d 100644 --- a/src/accessibility/describe.js +++ b/src/accessibility/describe.js @@ -155,40 +155,6 @@ function describe(p5, fn) { _setDescriptionLang(this, lang); }; - p5.registerDecorator('p5.prototype.describe', function (target) { - return function (text, display, lang) { - // Checks for optional parameters and rearranges if needed - if (arguments.length === 2 && typeof display === 'string') { - // (text, display) - if (display === this.LABEL || display === this.FALLBACK) { - return target.call(this, text, display, undefined); - } - // (text, lang) - return target.call(this, text, undefined, display); - } - _checkDescriptionOptions(this, 'describe', display, lang); - // (text, display, lang) or just (text) - return target.call(this, text, display, lang); - }; - }); - - p5.registerDecorator('p5.prototype.describeElement', function (target) { - return function (name, text, display, lang) { - // Checks for optional parameters and rearranges if needed - if (arguments.length === 3 && typeof display === 'string') { - // (name, text, display) - if (display === this.LABEL || display === this.FALLBACK) { - return target.call(this, name, text, display, undefined); - } - // (name, text, lang) - return target.call(this, name, text, undefined, display); - } - _checkDescriptionOptions(this, 'describeElement', display, lang); - // (name, text, display, lang) or just (name, text) - return target.call(this, name, text, display, lang); - }; - }); - /** * Creates a screen reader-accessible description of elements in the canvas. * @@ -327,6 +293,40 @@ function describe(p5, fn) { _setDescriptionLang(this, lang); }; + p5.registerDecorator('p5.prototype.describe', function (target) { + return function (text, display, lang) { + // Checks for optional parameters and rearranges if needed + if (arguments.length === 2 && typeof display === 'string') { + // (text, display) + if (display === this.LABEL || display === this.FALLBACK) { + return target.call(this, text, display, undefined); + } + // (text, lang) + return target.call(this, text, undefined, display); + } + _checkDescriptionOptions(this, 'describe', display, lang); + // (text, display, lang) or just (text) + return target.call(this, text, display, lang); + }; + }); + + p5.registerDecorator('p5.prototype.describeElement', function (target) { + return function (name, text, display, lang) { + // Checks for optional parameters and rearranges if needed + if (arguments.length === 3 && typeof display === 'string') { + // (name, text, display) + if (display === this.LABEL || display === this.FALLBACK) { + return target.call(this, name, text, display, undefined); + } + // (name, text, lang) + return target.call(this, name, text, undefined, display); + } + _checkDescriptionOptions(this, 'describeElement', display, lang); + // (name, text, display, lang) or just (name, text) + return target.call(this, name, text, display, lang); + }; + }); + /* * * Helper functions for describe() and describeElement(). @@ -343,6 +343,12 @@ function describe(p5, fn) { `${methodName}() expects display (LABEL or FALLBACK) before lang.` ); } + + if (!validDisplay || !validLanguage) { + throw new TypeError( + `${methodName}() expects display (LABEL or FALLBACK) before lang.` + ); + } } function _setDescriptionLang(pInst, lang) { diff --git a/test/manual-test-examples/accessibility/describe/sketch.js b/test/manual-test-examples/accessibility/describe/sketch.js index d0a992a505..e655653a74 100644 --- a/test/manual-test-examples/accessibility/describe/sketch.js +++ b/test/manual-test-examples/accessibility/describe/sketch.js @@ -12,11 +12,11 @@ function setup() { // Text and lang //describe('Esto es una prueba', 'es'); - // Text, lang, and display - // describe('Cái này là bài thi', 'vi', LABEL); - // Text, display, and lang - // describe('यह टेस्ट है', LABEL, 'hi'); + // describe('Cái này là bài thi', LABEL, 'vi'); + + // Text and lang + // describe('यह टेस्ट है', 'hi'); @@ -29,11 +29,11 @@ function setup() { // Name, text, and lang // describeElement('c', 'Esto es una prueba', 'es'); - // Name, text, lang, and display - // describeElement('d', 'Cái này là bài thi', 'vi', LABEL); - // Name, text, display, and lang - // describeElement('e', 'यह टेस्ट है', LABEL, 'hi'); + // describeElement('d', 'Cái này là bài thi', LABEL, 'vi'); + + // Name, text, and lang + // describeElement('e', 'यह टेस्ट है', 'hi'); fill('blue'); circle(200, 150, 100); diff --git a/test/unit/accessibility/describe.js b/test/unit/accessibility/describe.js index b0a583a680..cc57a7993c 100644 --- a/test/unit/accessibility/describe.js +++ b/test/unit/accessibility/describe.js @@ -5,6 +5,13 @@ suite('describe', function () { const myID = 'myCanvasID'; beforeAll(function () { + mockP5.registerDecorator = (patterns, decorator) => { + const patternList = Array.isArray(patterns) ? patterns : [patterns]; + patternList.forEach(pattern => { + const name = pattern.split('.').pop(); + mockP5Prototype[name] = decorator(mockP5Prototype[name], { name }); + }); + }; describe(mockP5, mockP5Prototype); mockP5Prototype.LABEL = 'label'; @@ -52,8 +59,17 @@ suite('describe', function () { assert.isNull(document.getElementById(myID + '_Label')); }); + test('should support text and display', function () { + mockP5Prototype.describe('Texto visible', mockP5Prototype.LABEL); + assert.equal( + document.getElementById(myID + '_labelDesc').innerHTML, + 'Texto visible.' + ); + assert.isNull(mockP5Prototype.elt.getAttribute('lang')); + }); + test('should support text lang and display', function () { - mockP5Prototype.describe('Chào các bạn', 'vi', mockP5Prototype.FALLBACK); + mockP5Prototype.describe('Chào các bạn', mockP5Prototype.FALLBACK, 'vi'); let actual = document.getElementById(myID + '_fallbackDesc'); assert.deepEqual(actual.innerHTML, 'Chào các bạn.'); assert.deepEqual(actual.getAttribute('lang'), 'vi'); @@ -67,6 +83,12 @@ suite('describe', function () { assert.deepEqual(actual.getAttribute('lang'), 'vi'); }); + test('should reject language before display', function () { + assert.throws(function () { + mockP5Prototype.describe('Chào các bạn', 'vi', mockP5Prototype.LABEL); + }, TypeError, 'expects display (LABEL or FALLBACK) before lang'); + }); + test('should not add extra period if string ends in "."', function () { mockP5Prototype.describe('A.'); let actual = document.getElementById(myID + '_fallbackDesc'); @@ -145,8 +167,16 @@ suite('describe', function () { ); }); + test('should support element text and display', function () { + mockP5Prototype.describeElement('ao', 'Texto visible', mockP5Prototype.LABEL); + assert.equal( + document.getElementById(myID + '_lte_ao').innerHTML, + 'ao:Texto visible.' + ); + }); + test('should support element text lang and display', function () { - mockP5Prototype.describeElement('al', 'Chào các bạn', 'vi', mockP5Prototype.FALLBACK); + mockP5Prototype.describeElement('al', 'Chào các bạn', mockP5Prototype.FALLBACK, 'vi'); let actual = document.getElementById(myID + '_fte_al').innerHTML; assert.deepEqual(actual, 'al:Chào các bạn.' ); @@ -158,6 +188,17 @@ suite('describe', function () { assert.deepEqual(actual, 'am:Chào các bạn.'); }); + test('should reject element language before display', function () { + assert.throws(function () { + mockP5Prototype.describeElement( + 'an', + 'Chào các bạn', + 'vi', + mockP5Prototype.LABEL + ); + }, TypeError, 'expects display (LABEL or FALLBACK) before lang'); + }); + test('should not add extra ":" if element name ends in colon', function () { mockP5Prototype.describeElement('ab:', 'b.'); let actual = document.getElementById(myID + '_fte_ab').innerHTML; From 93cb3ae8b00892409a605cd7f173c2448b6ff03b Mon Sep 17 00:00:00 2001 From: Johnny Huynh Date: Fri, 25 Sep 2026 21:49:28 -0700 Subject: [PATCH 09/11] Throws friendly error instead of TypeError --- src/accessibility/describe.js | 21 +++++++++++---------- test/unit/accessibility/describe.js | 25 ++++++++++++++----------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/accessibility/describe.js b/src/accessibility/describe.js index cda9f90c9d..35a0739705 100644 --- a/src/accessibility/describe.js +++ b/src/accessibility/describe.js @@ -304,7 +304,9 @@ function describe(p5, fn) { // (text, lang) return target.call(this, text, undefined, display); } - _checkDescriptionOptions(this, 'describe', display, lang); + if (!_checkDescriptionOptions(this, 'describe', display, lang)) { + return; + } // (text, display, lang) or just (text) return target.call(this, text, display, lang); }; @@ -321,7 +323,9 @@ function describe(p5, fn) { // (name, text, lang) return target.call(this, name, text, undefined, display); } - _checkDescriptionOptions(this, 'describeElement', display, lang); + if (!_checkDescriptionOptions(this, 'describeElement', display, lang)) { + return; + } // (name, text, display, lang) or just (name, text) return target.call(this, name, text, display, lang); }; @@ -339,16 +343,13 @@ function describe(p5, fn) { const validLanguage = lang === undefined || typeof lang === 'string'; if (!validDisplay || !validLanguage) { - throw new TypeError( - `${methodName}() expects display (LABEL or FALLBACK) before lang.` - ); - } - - if (!validDisplay || !validLanguage) { - throw new TypeError( - `${methodName}() expects display (LABEL or FALLBACK) before lang.` + p5._friendlyError( + `${methodName}() expects display (LABEL or FALLBACK) before lang.`, + methodName ); + return false; } + return true; } function _setDescriptionLang(pInst, lang) { diff --git a/test/unit/accessibility/describe.js b/test/unit/accessibility/describe.js index cc57a7993c..776f2cd03e 100644 --- a/test/unit/accessibility/describe.js +++ b/test/unit/accessibility/describe.js @@ -26,6 +26,7 @@ suite('describe', function () { mockP5Prototype.elt.removeAttribute('lang'); mockP5Prototype.dummyDOM = undefined; mockP5Prototype.descriptions = undefined; + mockP5._friendlyError.mockReset(); }); suite('p5.prototype.describe', function () { @@ -84,9 +85,10 @@ suite('describe', function () { }); test('should reject language before display', function () { - assert.throws(function () { - mockP5Prototype.describe('Chào các bạn', 'vi', mockP5Prototype.LABEL); - }, TypeError, 'expects display (LABEL or FALLBACK) before lang'); + mockP5Prototype.describe('Chào các bạn', 'vi', mockP5Prototype.LABEL); + assert.isNull(document.getElementById(myID + '_fallbackDesc')); + assert.lengthOf(mockP5._friendlyError.mock.calls, 1); + assert.equal(mockP5._friendlyError.mock.calls[0][1], 'describe'); }); test('should not add extra period if string ends in "."', function () { @@ -189,14 +191,15 @@ suite('describe', function () { }); test('should reject element language before display', function () { - assert.throws(function () { - mockP5Prototype.describeElement( - 'an', - 'Chào các bạn', - 'vi', - mockP5Prototype.LABEL - ); - }, TypeError, 'expects display (LABEL or FALLBACK) before lang'); + mockP5Prototype.describeElement( + 'an', + 'Chào các bạn', + 'vi', + mockP5Prototype.LABEL + ); + assert.isNull(document.getElementById(myID + '_fte_an')); + assert.lengthOf(mockP5._friendlyError.mock.calls, 1); + assert.equal(mockP5._friendlyError.mock.calls[0][1], 'describeElement'); }); test('should not add extra ":" if element name ends in colon', function () { From d3d621bab428c8ec95a69407d626862206fd774c Mon Sep 17 00:00:00 2001 From: Johnny Huynh Date: Fri, 2 Oct 2026 18:46:11 -0700 Subject: [PATCH 10/11] Added the second signature for describe and describeElement --- src/accessibility/describe.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/accessibility/describe.js b/src/accessibility/describe.js index 35a0739705..1a7fc6480f 100644 --- a/src/accessibility/describe.js +++ b/src/accessibility/describe.js @@ -32,7 +32,7 @@ function describe(p5, fn) { * * @method describe * @param {String} text description of the canvas. - * @param {(FALLBACK|LABEL)} [display] either LABEL or FALLBACK. + * @param {(FALLBACK|LABEL)} [display] either LABEL or FALLBACK. * @param {String} [lang] valid lang attribute. * * @example @@ -111,6 +111,11 @@ function describe(p5, fn) { * describe(`A green circle at (${x}, 50) moves from left to right on a gray square.`, LABEL); * } */ + /** + * @method describe + * @param {String} text description of the canvas. + * @param {String} [lang] valid lang attribute. + */ fn.describe = function (text, display, lang) { // p5._validateParameters('describe', arguments); if (typeof text !== 'string') { @@ -184,8 +189,8 @@ function describe(p5, fn) { * @method describeElement * @param {String} name name of the element. * @param {String} text description of the element. - * @param {(FALLBACK|LABEL)} [display] either LABEL or FALLBACK. - * @param {String} [lang] valid lang attribute. + * @param {(FALLBACK|LABEL)} [display] either LABEL or FALLBACK. + * @param {String} [lang] valid lang attribute. * @example * function setup() { * background('pink'); @@ -235,6 +240,12 @@ function describe(p5, fn) { * } */ + /** + * @method describeElement + * @param {String} name name of the element. + * @param {String} text description of the element. + * @param {String} [lang] valid lang attribute. + */ fn.describeElement = function (name, text, display, lang) { // p5._validateParameters('describeElement', arguments); if (typeof text !== 'string' || typeof name !== 'string') { From 438f133c860125434791643ebd0c4d03bff74f08 Mon Sep 17 00:00:00 2001 From: Johnny Huynh Date: Fri, 2 Oct 2026 18:46:36 -0700 Subject: [PATCH 11/11] "npm run docs" changes --- docs/parameterData.json | 1447 +++++++++++++++++++++------------------ 1 file changed, 779 insertions(+), 668 deletions(-) diff --git a/docs/parameterData.json b/docs/parameterData.json index 450f251d50..9d2fe9cd5b 100644 --- a/docs/parameterData.json +++ b/docs/parameterData.json @@ -228,6 +228,20 @@ ] ] }, + "isMatrixArray": { + "overloads": [ + [] + ] + }, + "loading": { + "overloads": [ + [ + null, + null, + null + ] + ] + }, "fromAxisAngle": { "overloads": [ [ @@ -282,13 +296,6 @@ ] ] }, - "rotateBy": { - "overloads": [ - [ - "p5.Quat?" - ] - ] - }, "ellipseMode": { "overloads": [ [ @@ -304,6 +311,13 @@ ] ] }, + "rotateBy": { + "overloads": [ + [ + "p5.Quat?" + ] + ] + }, "nf": { "overloads": [ [ @@ -333,15 +347,6 @@ ] ] }, - "loadImage": { - "overloads": [ - [ - "String|Request", - "function(p5.Image)?", - "function(Event)?" - ] - ] - }, "createVector": { "overloads": [ [ @@ -359,26 +364,31 @@ [] ] }, - "describe": { + "storeItem": { "overloads": [ [ "String", - "FALLBACK|LABEL?" + "String|Number|Boolean|Object|Array" ] ] }, - "storeItem": { + "textOutput": { "overloads": [ [ - "String", - "String|Number|Boolean|Object|Array" + "FALLBACK|LABEL?" ] ] }, - "textOutput": { + "describe": { "overloads": [ [ - "FALLBACK|LABEL?" + "String", + "FALLBACK|LABEL?", + "String?" + ], + [ + "String", + "String?" ] ] }, @@ -430,6 +440,15 @@ ] ] }, + "loadImage": { + "overloads": [ + [ + "String|Request", + "function(p5.Image)?", + "function(Event)?" + ] + ] + }, "loadShader": { "overloads": [ [ @@ -463,13 +482,6 @@ [] ] }, - "beginClip": { - "overloads": [ - [ - "Object?" - ] - ] - }, "ceil": { "overloads": [ [ @@ -500,6 +512,13 @@ ] ] }, + "beginClip": { + "overloads": [ + [ + "Object?" + ] + ] + }, "selectAll": { "overloads": [ [ @@ -543,11 +562,6 @@ ] ] }, - "endClip": { - "overloads": [ - [] - ] - }, "int": { "overloads": [ [ @@ -588,90 +602,11 @@ [] ] }, - "instanceID": { + "endClip": { "overloads": [ [] ] }, - "smoothstep": { - "overloads": [ - [ - "Number", - "Number", - "Number" - ] - ] - }, - "uniformStorage": { - "overloads": [ - [ - "String", - "p5.StorageBuffer|Function|Object?" - ], - [ - "p5.StorageBuffer|Function|Object?" - ] - ] - }, - "getTexture": { - "overloads": [ - [ - null, - null - ] - ] - }, - "getWorldInputs": { - "overloads": [ - [ - "Function" - ] - ] - }, - "getPixelInputs": { - "overloads": [ - [ - "Function" - ] - ] - }, - "getFinalColor": { - "overloads": [ - [ - "Function" - ] - ] - }, - "getColor": { - "overloads": [ - [ - "Function" - ] - ] - }, - "getObjectInputs": { - "overloads": [ - [ - "Function" - ] - ] - }, - "getCameraInputs": { - "overloads": [ - [ - "Function" - ] - ] - }, - "mix": { - "overloads": [ - [ - "Number|p5.Vector", - "Number|p5.Vector", - "Number|Boolean" - ] - ] - }, "applyMatrix": { "overloads": [ [ @@ -731,15 +666,6 @@ [] ] }, - "describeElement": { - "overloads": [ - [ - "String", - "String", - "FALLBACK|LABEL?" - ] - ] - }, "millis": { "overloads": [ [] @@ -757,12 +683,18 @@ ] ] }, - "resizeCanvas": { + "describeElement": { "overloads": [ [ - "Number", - "Number", - "Boolean?" + "String", + "String", + "FALLBACK|LABEL?", + "String?" + ], + [ + "String", + "String", + "String?" ] ] }, @@ -779,18 +711,18 @@ ] ] }, - "saveGif": { + "resetMatrix": { "overloads": [ - [ - "String", - "Number", - "Object?" - ] + [] ] }, - "resetMatrix": { + "resizeCanvas": { "overloads": [ - [] + [ + "Number", + "Number", + "Boolean?" + ] ] }, "getItem": { @@ -809,12 +741,18 @@ ] ] }, - "rectMode": { + "arc": { "overloads": [ [ - "CENTER|RADIUS|CORNER|CORNERS" - ], - [] + "Number", + "Number", + "Number", + "Number", + "Number", + "Number", + "CHORD|PIE|OPEN?", + "Integer?" + ] ] }, "month": { @@ -822,6 +760,14 @@ [] ] }, + "rectMode": { + "overloads": [ + [ + "CENTER|RADIUS|CORNER|CORNERS" + ], + [] + ] + }, "random": { "overloads": [ [ @@ -833,34 +779,24 @@ ] ] }, - "loadJSON": { + "saveGif": { "overloads": [ [ - "String|Request", - "Function?", - "Function?" + "String", + "Number", + "Object?" ] ] }, - "arc": { + "loadJSON": { "overloads": [ [ - "Number", - "Number", - "Number", - "Number", - "Number", - "Number", - "CHORD|PIE|OPEN?", - "Integer?" + "String|Request", + "Function?", + "Function?" ] ] }, - "noCanvas": { - "overloads": [ - [] - ] - }, "createElement": { "overloads": [ [ @@ -876,6 +812,16 @@ ] ] }, + "cursor": { + "overloads": [ + [ + "ARROW|CROSS|HAND|MOVE|TEXT|WAIT|String", + "Number?", + "Number?" + ], + [] + ] + }, "dist": { "overloads": [ [ @@ -894,13 +840,8 @@ ] ] }, - "cursor": { + "noCanvas": { "overloads": [ - [ - "ARROW|CROSS|HAND|MOVE|TEXT|WAIT|String", - "Number?", - "Number?" - ], [] ] }, @@ -944,68 +885,98 @@ ] ] }, - "set": { + "redraw": { + "overloads": [ + [ + "Integer?" + ] + ] + }, + "instanceID": { + "overloads": [ + [] + ] + }, + "smoothstep": { "overloads": [ [ "Number", "Number", - "Number|Number[]|Object" + "Number" ] ] }, - "loadModel": { + "uniformStorage": { "overloads": [ [ - "String|Request", - "String?", - "Boolean?", - "function(p5.Geometry)?", - "function(Event)?" + "String", + "p5.StorageBuffer|Function|Object?" ], [ - "String|Request", - "String?", - "function(p5.Geometry)?", - "function(Event)?" - ], + "p5.StorageBuffer|Function|Object?" + ] + ] + }, + "getTexture": { + "overloads": [ [ - "String|Request", - "Object?" + null, + null ] ] }, - "redraw": { + "getWorldInputs": { "overloads": [ [ - "Integer?" + "Function" ] ] }, - "year": { + "getPixelInputs": { "overloads": [ - [] + [ + "Function" + ] ] }, - "nfp": { + "getFinalColor": { "overloads": [ [ - "Number", - "Integer?", - "Integer?" - ], + "Function" + ] + ] + }, + "getColor": { + "overloads": [ [ - "Number[]", - "Integer?", - "Integer?" + "Function" ] ] }, - "smooth": { + "getObjectInputs": { "overloads": [ - [] + [ + "Function" + ] ] }, - "clearStorage": { + "getCameraInputs": { + "overloads": [ + [ + "Function" + ] + ] + }, + "mix": { + "overloads": [ + [ + "Number|p5.Vector", + "Number|p5.Vector", + "Number|Boolean" + ] + ] + }, + "year": { "overloads": [ [] ] @@ -1015,17 +986,34 @@ [] ] }, - "beginShape": { + "smooth": { + "overloads": [ + [] + ] + }, + "nfp": { "overloads": [ [ - "POINTS|LINES|TRIANGLES|TRIANGLE_FAN|TRIANGLE_STRIP|QUADS|QUAD_STRIP|PATH?" + "Number", + "Integer?", + "Integer?" + ], + [ + "Number[]", + "Integer?", + "Integer?" ] ] }, - "saveObj": { + "clearStorage": { + "overloads": [ + [] + ] + }, + "beginShape": { "overloads": [ [ - "String?" + "POINTS|LINES|TRIANGLES|TRIANGLE_FAN|TRIANGLE_STRIP|QUADS|QUAD_STRIP|PATH?" ] ] }, @@ -1050,25 +1038,19 @@ ] ] }, - "atan": { + "set": { "overloads": [ [ - "Number" + "Number", + "Number", + "Number|Number[]|Object" ] ] }, - "createGraphics": { + "atan": { "overloads": [ [ - "Number", - "Number", - "P2D|WEBGL?", - "HTMLCanvasElement?" - ], - [ - "Number", - "Number", - "HTMLCanvasElement?" + "Number" ] ] }, @@ -1094,10 +1076,10 @@ ] ] }, - "exp": { + "saveObj": { "overloads": [ [ - "Number" + "String?" ] ] }, @@ -1109,6 +1091,13 @@ ] ] }, + "exp": { + "overloads": [ + [ + "Number" + ] + ] + }, "specularColor": { "overloads": [ [ @@ -1153,6 +1142,21 @@ ] ] }, + "createGraphics": { + "overloads": [ + [ + "Number", + "Number", + "P2D|WEBGL?", + "HTMLCanvasElement?" + ], + [ + "Number", + "Number", + "HTMLCanvasElement?" + ] + ] + }, "createDiv": { "overloads": [ [ @@ -1205,13 +1209,6 @@ ] ] }, - "setMoveThreshold": { - "overloads": [ - [ - "Number" - ] - ] - }, "ellipse": { "overloads": [ [ @@ -1229,6 +1226,13 @@ ] ] }, + "setMoveThreshold": { + "overloads": [ + [ + "Number" + ] + ] + }, "createP": { "overloads": [ [ @@ -1286,14 +1290,6 @@ ] ] }, - "saveStl": { - "overloads": [ - [ - "String?", - "Object?" - ] - ] - }, "circle": { "overloads": [ [ @@ -1303,11 +1299,15 @@ ] ] }, - "floor": { + "clear": { "overloads": [ [ - "Number" - ] + "Number?", + "Number?", + "Number?", + "Number?" + ], + [] ] }, "noCursor": { @@ -1315,6 +1315,13 @@ [] ] }, + "floor": { + "overloads": [ + [ + "Number" + ] + ] + }, "loadTable": { "overloads": [ [ @@ -1326,6 +1333,18 @@ ] ] }, + "filter": { + "overloads": [ + [ + "THRESHOLD|GRAY|OPAQUE|INVERT|POSTERIZE|BLUR|ERODE|DILATE|BLUR", + "Number?", + "Boolean?" + ], + [ + "p5.Shader" + ] + ] + }, "plane": { "overloads": [ [ @@ -1344,22 +1363,18 @@ [] ] }, - "filter": { + "createSpan": { "overloads": [ [ - "THRESHOLD|GRAY|OPAQUE|INVERT|POSTERIZE|BLUR|ERODE|DILATE|BLUR", - "Number?", - "Boolean?" - ], - [ - "p5.Shader" + "String?" ] ] }, - "createSpan": { + "saveStl": { "overloads": [ [ - "String?" + "String?", + "Object?" ] ] }, @@ -1379,6 +1394,27 @@ ] ] }, + "loadModel": { + "overloads": [ + [ + "String|Request", + "String?", + "Boolean?", + "function(p5.Geometry)?", + "function(Event)?" + ], + [ + "String|Request", + "String?", + "function(p5.Geometry)?", + "function(Event)?" + ], + [ + "String|Request", + "Object?" + ] + ] + }, "createFramebuffer": { "overloads": [ [ @@ -1400,19 +1436,19 @@ ] ] }, - "strokeWeight": { + "red": { "overloads": [ [ - "Number" - ], - [] + "p5.Color|Number[]|String" + ] ] }, - "red": { + "strokeWeight": { "overloads": [ [ - "p5.Color|Number[]|String" - ] + "Number" + ], + [] ] }, "cos": { @@ -1437,59 +1473,59 @@ [] ] }, - "background": { + "directionalLight": { "overloads": [ - [ - "p5.Color" - ], - [ - "String", - "Number?" - ], [ "Number", - "Number?" + "Number", + "Number", + "Number", + "Number", + "Number" ], [ "Number", "Number", "Number", - "Number?" + "p5.Vector" ], [ - "Number[]" + "p5.Color|Number[]|String", + "Number", + "Number", + "Number" ], [ - "p5.Image", - "Number?" + "p5.Color|Number[]|String", + "p5.Vector" ] ] }, - "directionalLight": { + "background": { "overloads": [ + [ + "p5.Color" + ], + [ + "String", + "Number?" + ], [ "Number", - "Number", - "Number", - "Number", - "Number", - "Number" + "Number?" ], [ "Number", "Number", "Number", - "p5.Vector" + "Number?" ], [ - "p5.Color|Number[]|String", - "Number", - "Number", - "Number" + "Number[]" ], [ - "p5.Color|Number[]|String", - "p5.Vector" + "p5.Image", + "Number?" ] ] }, @@ -1501,19 +1537,19 @@ ] ] }, - "lerp": { + "keyPressed": { "overloads": [ [ - "Number", - "Number", - "Number" + "KeyboardEvent?" ] ] }, - "keyPressed": { + "lerp": { "overloads": [ [ - "KeyboardEvent?" + "Number", + "Number", + "Number" ] ] }, @@ -1528,10 +1564,12 @@ ] ] }, - "clearDepth": { + "createA": { "overloads": [ [ - "Number?" + "String", + "String", + "String?" ] ] }, @@ -1552,15 +1590,6 @@ ] ] }, - "createA": { - "overloads": [ - [ - "String", - "String", - "String?" - ] - ] - }, "saveFrames": { "overloads": [ [ @@ -1590,31 +1619,10 @@ ] ] }, - "clear": { + "clearDepth": { "overloads": [ [ - "Number?", - "Number?", - "Number?", "Number?" - ], - [] - ] - }, - "setup": { - "overloads": [ - [] - ] - }, - "draw": { - "overloads": [ - [] - ] - }, - "registerAddon": { - "overloads": [ - [ - "Function" ] ] }, @@ -1635,6 +1643,23 @@ ] ] }, + "setup": { + "overloads": [ + [] + ] + }, + "draw": { + "overloads": [ + [] + ] + }, + "registerAddon": { + "overloads": [ + [ + "Function" + ] + ] + }, "debugMode": { "overloads": [ [], @@ -1669,13 +1694,6 @@ ] ] }, - "roll": { - "overloads": [ - [ - "Number" - ] - ] - }, "spline": { "overloads": [ [ @@ -1704,6 +1722,21 @@ ] ] }, + "get": { + "overloads": [ + [ + "Number", + "Number", + "Number", + "Number" + ], + [], + [ + "Number", + "Number" + ] + ] + }, "sin": { "overloads": [ [ @@ -1720,17 +1753,9 @@ ] ] }, - "get": { + "roll": { "overloads": [ [ - "Number", - "Number", - "Number", - "Number" - ], - [], - [ - "Number", "Number" ] ] @@ -1742,6 +1767,13 @@ ] ] }, + "green": { + "overloads": [ + [ + "p5.Color|Number[]|String" + ] + ] + }, "shuffle": { "overloads": [ [ @@ -1750,17 +1782,17 @@ ] ] }, - "green": { + "loadPixels": { "overloads": [ - [ - "p5.Color|Number[]|String" - ] + [] ] }, - "windowResized": { + "sphere": { "overloads": [ [ - "Event?" + "Number?", + "Integer?", + "Integer?" ] ] }, @@ -1779,26 +1811,22 @@ [] ] }, - "sphere": { + "loadBytes": { "overloads": [ [ - "Number?", - "Integer?", - "Integer?" + "String|Request", + "Function?", + "Function?" ] ] }, - "loadPixels": { - "overloads": [ - [] - ] - }, - "loadBytes": { + "createSlider": { "overloads": [ [ - "String|Request", - "Function?", - "Function?" + "Number", + "Number", + "Number?", + "Number?" ] ] }, @@ -1814,13 +1842,10 @@ ] ] }, - "createSlider": { + "windowResized": { "overloads": [ [ - "Number", - "Number", - "Number?", - "Number?" + "Event?" ] ] }, @@ -1862,13 +1887,6 @@ ] ] }, - "fullscreen": { - "overloads": [ - [ - "Boolean?" - ] - ] - }, "point": { "overloads": [ [ @@ -1909,6 +1927,13 @@ ] ] }, + "fullscreen": { + "overloads": [ + [ + "Boolean?" + ] + ] + }, "createButton": { "overloads": [ [ @@ -1924,6 +1949,13 @@ ] ] }, + "degrees": { + "overloads": [ + [ + "Number" + ] + ] + }, "endShape": { "overloads": [ [ @@ -1935,13 +1967,6 @@ ] ] }, - "degrees": { - "overloads": [ - [ - "Number" - ] - ] - }, "hex": { "overloads": [ [ @@ -1977,14 +2002,6 @@ ] ] }, - "pixelDensity": { - "overloads": [ - [ - "Number?" - ], - [] - ] - }, "httpGet": { "overloads": [ [ @@ -2025,22 +2042,25 @@ [] ] }, - "displayDensity": { + "pixelDensity": { "overloads": [ + [ + "Number?" + ], [] ] }, - "radians": { + "keyTyped": { "overloads": [ [ - "Number" + "KeyboardEvent?" ] ] }, - "panorama": { + "radians": { "overloads": [ [ - "p5.Image" + "Number" ] ] }, @@ -2052,10 +2072,10 @@ ] ] }, - "keyTyped": { + "panorama": { "overloads": [ [ - "KeyboardEvent?" + "p5.Image" ] ] }, @@ -2071,6 +2091,11 @@ ] ] }, + "displayDensity": { + "overloads": [ + [] + ] + }, "scale": { "overloads": [ [ @@ -2147,11 +2172,6 @@ ] ] }, - "getURL": { - "overloads": [ - [] - ] - }, "max": { "overloads": [ [ @@ -2164,6 +2184,11 @@ ] ] }, + "getURL": { + "overloads": [ + [] + ] + }, "lights": { "overloads": [ [] @@ -2176,11 +2201,6 @@ ] ] }, - "getURLPath": { - "overloads": [ - [] - ] - }, "splineTangent": { "overloads": [ [ @@ -2192,21 +2212,26 @@ ] ] }, - "normal": { + "getURLPath": { + "overloads": [ + [] + ] + }, + "shearX": { "overloads": [ [ - "p5.Vector" - ], - [ - "Number", - "Number", "Number" ] ] }, - "shearX": { + "normal": { "overloads": [ [ + "p5.Vector" + ], + [ + "Number", + "Number", "Number" ] ] @@ -2227,34 +2252,16 @@ [] ] }, - "getURLParams": { + "keyIsDown": { "overloads": [ - [] + [ + "Number|String" + ] ] }, - "image": { + "getURLParams": { "overloads": [ - [ - "p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture|p5.Renderer|p5.Graphics", - "Number", - "Number", - "Number?", - "Number?" - ], - [ - "p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture", - "Number", - "Number", - "Number", - "Number", - "Number", - "Number", - "Number?", - "Number?", - "CONTAIN|COVER?", - "LEFT|RIGHT|CENTER?", - "TOP|BOTTOM|CENTER?" - ] + [] ] }, "lightFalloff": { @@ -2266,13 +2273,6 @@ ] ] }, - "shader": { - "overloads": [ - [ - "p5.Shader" - ] - ] - }, "mouseMoved": { "overloads": [ [ @@ -2287,10 +2287,10 @@ ] ] }, - "keyIsDown": { + "shader": { "overloads": [ [ - "Number|String" + "p5.Shader" ] ] }, @@ -2301,6 +2301,31 @@ ] ] }, + "image": { + "overloads": [ + [ + "p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture|p5.Renderer|p5.Graphics", + "Number", + "Number", + "Number?", + "Number?" + ], + [ + "p5.Image|p5.Element|p5.Texture|p5.Framebuffer|p5.FramebufferTexture", + "Number", + "Number", + "Number", + "Number", + "Number", + "Number", + "Number?", + "Number?", + "CONTAIN|COVER?", + "LEFT|RIGHT|CENTER?", + "TOP|BOTTOM|CENTER?" + ] + ] + }, "angleMode": { "overloads": [ [ @@ -2309,6 +2334,13 @@ [] ] }, + "shearY": { + "overloads": [ + [ + "Number" + ] + ] + }, "rect": { "overloads": [ [ @@ -2331,13 +2363,6 @@ ] ] }, - "shearY": { - "overloads": [ - [ - "Number" - ] - ] - }, "min": { "overloads": [ [ @@ -2367,28 +2392,20 @@ ] ] }, - "model": { + "createSelect": { "overloads": [ [ - "p5.Geometry", - "Number?" - ] - ] - }, - "hue": { - "overloads": [ + "Boolean?" + ], [ - "p5.Color|Number[]|String" + "Object" ] ] }, - "createSelect": { - "overloads": [ - [ - "Boolean?" - ], + "hue": { + "overloads": [ [ - "Object" + "p5.Color|Number[]|String" ] ] }, @@ -2421,14 +2438,6 @@ ] ] }, - "vertexProperty": { - "overloads": [ - [ - "String", - "Number|Number[]" - ] - ] - }, "square": { "overloads": [ [ @@ -2442,6 +2451,14 @@ ] ] }, + "vertexProperty": { + "overloads": [ + [ + "String", + "Number|Number[]" + ] + ] + }, "screenToWorld": { "overloads": [ [ @@ -2451,25 +2468,10 @@ ] ] }, - "createModel": { + "mousePressed": { "overloads": [ [ - "String", - "String?", - "Boolean?", - "function(p5.Geometry)?", - "function(Event)?" - ], - [ - "String", - "String?", - "function(p5.Geometry)?", - "function(Event)?" - ], - [ - "String", - "String?", - "Object?" + "MouseEvent?" ] ] }, @@ -2480,13 +2482,6 @@ ] ] }, - "mousePressed": { - "overloads": [ - [ - "MouseEvent?" - ] - ] - }, "pow": { "overloads": [ [ @@ -2507,38 +2502,6 @@ ] ] }, - "tint": { - "overloads": [ - [ - "Number", - "Number", - "Number", - "Number?" - ], - [ - "String" - ], - [ - "Number", - "Number?" - ], - [ - "Number[]" - ], - [ - "p5.Color" - ], - [] - ] - }, - "createWriter": { - "overloads": [ - [ - "String", - "String?" - ] - ] - }, "spotLight": { "overloads": [ [ @@ -2623,6 +2586,14 @@ ] ] }, + "createWriter": { + "overloads": [ + [ + "String", + "String?" + ] + ] + }, "fill": { "overloads": [ [ @@ -2647,18 +2618,6 @@ [] ] }, - "triangle": { - "overloads": [ - [ - "Number", - "Number", - "Number", - "Number", - "Number", - "Number" - ] - ] - }, "text": { "overloads": [ [ @@ -2812,9 +2771,16 @@ [] ] }, - "noTint": { + "triangle": { "overloads": [ - [] + [ + "Number", + "Number", + "Number", + "Number", + "Number", + "Number" + ] ] }, "ellipsoid": { @@ -2828,6 +2794,30 @@ ] ] }, + "tint": { + "overloads": [ + [ + "Number", + "Number", + "Number", + "Number?" + ], + [ + "String" + ], + [ + "Number", + "Number?" + ], + [ + "Number[]" + ], + [ + "p5.Color" + ], + [] + ] + }, "round": { "overloads": [ [ @@ -2848,11 +2838,24 @@ ] ] }, + "model": { + "overloads": [ + [ + "p5.Geometry", + "Number?" + ] + ] + }, "noLights": { "overloads": [ [] ] }, + "noTint": { + "overloads": [ + [] + ] + }, "imageShader": { "overloads": [ [ @@ -2867,13 +2870,6 @@ ] ] }, - "write": { - "overloads": [ - [ - "String|Number|Array" - ] - ] - }, "noStroke": { "overloads": [ [] @@ -2890,6 +2886,13 @@ [] ] }, + "write": { + "overloads": [ + [ + "String|Number|Array" + ] + ] + }, "sq": { "overloads": [ [ @@ -2905,14 +2908,6 @@ ] ] }, - "imageMode": { - "overloads": [ - [ - "CORNER|CORNERS|CENTER" - ], - [] - ] - }, "loadFont": { "overloads": [ [ @@ -2929,6 +2924,28 @@ ] ] }, + "createModel": { + "overloads": [ + [ + "String", + "String?", + "Boolean?", + "function(p5.Geometry)?", + "function(Event)?" + ], + [ + "String", + "String?", + "function(p5.Geometry)?", + "function(Event)?" + ], + [ + "String", + "String?", + "Object?" + ] + ] + }, "createAudio": { "overloads": [ [ @@ -2947,11 +2964,12 @@ ] ] }, - "sqrt": { + "imageMode": { "overloads": [ [ - "Number" - ] + "CORNER|CORNERS|CENTER" + ], + [] ] }, "brightness": { @@ -2961,6 +2979,13 @@ ] ] }, + "sqrt": { + "overloads": [ + [ + "Number" + ] + ] + }, "close": { "overloads": [ [] @@ -3001,6 +3026,13 @@ ] ] }, + "createColorPicker": { + "overloads": [ + [ + "String|p5.Color?" + ] + ] + }, "stroke": { "overloads": [ [ @@ -3025,13 +3057,6 @@ [] ] }, - "createColorPicker": { - "overloads": [ - [ - "String|p5.Color?" - ] - ] - }, "loadMaterialShader": { "overloads": [ [ @@ -3050,11 +3075,6 @@ ] ] }, - "baseMaterialShader": { - "overloads": [ - [] - ] - }, "lightness": { "overloads": [ [ @@ -3062,6 +3082,11 @@ ] ] }, + "baseMaterialShader": { + "overloads": [ + [] + ] + }, "doubleClicked": { "overloads": [ [ @@ -3069,11 +3094,6 @@ ] ] }, - "baseFilterShader": { - "overloads": [ - [] - ] - }, "erase": { "overloads": [ [ @@ -3082,6 +3102,11 @@ ] ] }, + "baseFilterShader": { + "overloads": [ + [] + ] + }, "createInput": { "overloads": [ [ @@ -3230,15 +3255,12 @@ [] ] }, - "setAttributes": { + "blendMode": { "overloads": [ [ - "String", - "Boolean" + "BLEND|DARKEST|LIGHTEST|DIFFERENCE|MULTIPLY|EXCLUSION|SCREEN|REPLACE|OVERLAY|HARD_LIGHT|SOFT_LIGHT|DODGE|BURN|ADD|REMOVE|SUBTRACT" ], - [ - "Object" - ] + [] ] }, "bezierOrder": { @@ -3249,12 +3271,27 @@ [] ] }, - "blendMode": { + "setAttributes": { + "overloads": [ + [ + "String", + "Boolean" + ], + [ + "Object" + ] + ] + }, + "buildStrokeShader": { "overloads": [ [ - "BLEND|DARKEST|LIGHTEST|DIFFERENCE|MULTIPLY|EXCLUSION|SCREEN|REPLACE|OVERLAY|HARD_LIGHT|SOFT_LIGHT|DODGE|BURN|ADD|REMOVE|SUBTRACT" + "Function", + "Object?" ], - [] + [ + "Object", + "Object?" + ] ] }, "camera": { @@ -3272,36 +3309,24 @@ ] ] }, - "createStorage": { - "overloads": [ - [ - "Number|Array|Float32Array|Object[]" - ] - ] - }, - "buildStrokeShader": { + "loadStrokeShader": { "overloads": [ [ - "Function", - "Object?" - ], - [ - "Object", - "Object?" + "String", + "Function?", + "Function?" ] ] }, - "baseComputeShader": { + "baseStrokeShader": { "overloads": [ [] ] }, - "loadStrokeShader": { + "createStorage": { "overloads": [ [ - "String", - "Function?", - "Function?" + "Number|Array|Float32Array|Uint32Array|Int32Array|Object[]" ] ] }, @@ -3315,23 +3340,11 @@ ] ] }, - "baseStrokeShader": { - "overloads": [ - [] - ] - }, "resetShader": { "overloads": [ [] ] }, - "buildComputeShader": { - "overloads": [ - [ - "Function" - ] - ] - }, "linePerspective": { "overloads": [ [ @@ -3366,18 +3379,19 @@ ] ] }, - "ortho": { + "createStorageList": { "overloads": [ [ - "Number?", - "Number?", - "Number?", - "Number?", - "Number?", - "Number?" + "Number", + "Object|Object[]?" ] ] }, + "baseComputeShader": { + "overloads": [ + [] + ] + }, "texture": { "overloads": [ [ @@ -3385,11 +3399,13 @@ ] ] }, - "compute": { + "ortho": { "overloads": [ [ - "p5.Shader", - "Number", + "Number?", + "Number?", + "Number?", + "Number?", "Number?", "Number?" ] @@ -3402,6 +3418,14 @@ ] ] }, + "normalTexture": { + "overloads": [ + [ + "p5.Image|p5.MediaElement|p5.Graphics|p5.Texture|p5.Framebuffer|p5.FramebufferTexture", + "Number?" + ] + ] + }, "frustum": { "overloads": [ [ @@ -3414,11 +3438,33 @@ ] ] }, + "instances": { + "overloads": [ + [ + "Number|p5.StorageBuffer|p5.StorageList" + ] + ] + }, + "buildComputeShader": { + "overloads": [ + [ + "Function" + ] + ] + }, "createCamera": { "overloads": [ [] ] }, + "bumpTexture": { + "overloads": [ + [ + "p5.Image|p5.MediaElement|p5.Graphics|p5.Texture|p5.Framebuffer|p5.FramebufferTexture", + "Number?" + ] + ] + }, "splineProperty": { "overloads": [ [ @@ -3430,18 +3476,27 @@ ] ] }, - "textureMode": { + "setCamera": { "overloads": [ [ - "IMAGE|NORMAL" - ], - [] + "p5.Camera" + ] ] }, - "setCamera": { + "specularTexture": { "overloads": [ [ - "p5.Camera" + "p5.Image|p5.MediaElement|p5.Graphics|p5.Texture|p5.Framebuffer|p5.FramebufferTexture" + ] + ] + }, + "compute": { + "overloads": [ + [ + "p5.Shader", + "Number", + "Number?", + "Number?" ] ] }, @@ -3452,13 +3507,18 @@ ] ] }, - "textureWrap": { + "ambientTexture": { "overloads": [ [ - "CLAMP|REPEAT|MIRROR", - "CLAMP|REPEAT|MIRROR?" - ], - [] + "p5.Image|p5.MediaElement|p5.Graphics|p5.Texture|p5.Framebuffer|p5.FramebufferTexture" + ] + ] + }, + "shininessTexture": { + "overloads": [ + [ + "p5.Image|p5.MediaElement|p5.Graphics|p5.Texture|p5.Framebuffer|p5.FramebufferTexture" + ] ] }, "vertex": { @@ -3482,8 +3542,11 @@ ] ] }, - "normalMaterial": { + "textureMode": { "overloads": [ + [ + "IMAGE|NORMAL" + ], [] ] }, @@ -3499,6 +3562,20 @@ ] ] }, + "textureWrap": { + "overloads": [ + [ + "CLAMP|REPEAT|MIRROR", + "CLAMP|REPEAT|MIRROR?" + ], + [] + ] + }, + "normalMaterial": { + "overloads": [ + [] + ] + }, "ambientMaterial": { "overloads": [ [ @@ -4154,9 +4231,10 @@ "lerp": { "overloads": [ [ - "Number", - "Number", - "Number", + "...Number[]" + ], + [ + "Number[]", "Number" ], [ @@ -4230,6 +4308,13 @@ ] } }, + "p5.File": { + "revoke": { + "overloads": [ + [] + ] + } + }, "p5.Font": { "textToPaths": { "overloads": [ @@ -4603,7 +4688,7 @@ "update": { "overloads": [ [ - "Number[]|Float32Array|Object[]" + "Number[]|Float32Array|Uint32Array|Int32Array|Object[]" ] ] }, @@ -4621,55 +4706,27 @@ ] } }, - "p5.Geometry": { - "calculateBoundingBox": { - "overloads": [ - [] - ] - }, - "clearColors": { - "overloads": [ - [] - ] - }, - "flipU": { - "overloads": [ - [] - ] - }, - "computeFaces": { - "overloads": [ - [] - ] - }, - "computeNormals": { + "p5.StorageList": { + "update": { "overloads": [ [ - "FLAT|SMOOTH?", - "Object?" + "Number[]|Float32Array|Object[]" ] ] }, - "makeEdgesFromFaces": { + "push": { "overloads": [ - [] + [ + "Number|Object" + ] ] }, - "normalize": { + "read": { "overloads": [ [] ] }, - "vertexProperty": { - "overloads": [ - [ - "String", - "Number|Number[]", - "Number?" - ] - ] - }, - "flipV": { + "clear": { "overloads": [ [] ] @@ -4854,6 +4911,60 @@ ] } }, + "p5.Geometry": { + "calculateBoundingBox": { + "overloads": [ + [] + ] + }, + "clearColors": { + "overloads": [ + [] + ] + }, + "flipU": { + "overloads": [ + [] + ] + }, + "computeFaces": { + "overloads": [ + [] + ] + }, + "computeNormals": { + "overloads": [ + [ + "FLAT|SMOOTH?", + "Object?" + ] + ] + }, + "makeEdgesFromFaces": { + "overloads": [ + [] + ] + }, + "normalize": { + "overloads": [ + [] + ] + }, + "vertexProperty": { + "overloads": [ + [ + "String", + "Number|Number[]", + "Number?" + ] + ] + }, + "flipV": { + "overloads": [ + [] + ] + } + }, "p5.Graphics": { "reset": { "overloads": [