# p5.js

**URL:** https://discourse.processing.org/c/p5js/10.md?page=2

[Latest](https://discourse.processing.org/latest.md) · [Categories](https://discourse.processing.org/categories.md) · [Tags](https://discourse.processing.org/tags.md)

**Page:** 3

---

## [Speed of set(x, y, color) in p5.js 2.1.2 vs 1.11.11](https://discourse.processing.org/t/speed-of-set-x-y-color-in-p5-js-2-1-2-vs-1-11-11/47769)

<div class="topic-metadata">

**Author:** [@norm\_krumpe](https://discourse.processing.org/u/norm_krumpe)\
**Replies:** 2\
**Last updated:** [January 19, 2026, 7:54pm UTC](https://discourse.processing.org/t/speed-of-set-x-y-color-in-p5-js-2-1-2-vs-1-11-11/47769 "2026-01-19T19:54:34Z")

</div>

Hello, I will be teaching a course starting next week (Mathematics and Computer Science). I typically use p5.js to teach it, and will do that again this year. I was thinking about moving up to version 2.1.2 (because it’s…

---

## [How to start development server](https://discourse.processing.org/t/how-to-start-development-server/47618)

<div class="topic-metadata">

**Author:** [@thejon\_07](https://discourse.processing.org/u/thejon_07)\
**Replies:** 6\
**Last updated:** [January 19, 2026, 6:08pm UTC](https://discourse.processing.org/t/how-to-start-development-server/47618 "2026-01-19T18:08:46Z")

</div>

Hi everyone, I am new to the Processing Foundation. I am facing issues while starting the development server for the p5.js repository. Can anyone help me with this? Thank you.

---

## [I'm trying to make a game inspired by the puzzles of The Witness](https://discourse.processing.org/t/im-trying-to-make-a-game-inspired-by-the-puzzles-of-the-witness/47747)

<div class="topic-metadata">

**Author:** [@Fluffy1oo](https://discourse.processing.org/u/Fluffy1oo)\
**Replies:** 6\
**Last updated:** [January 13, 2026, 10:22am UTC](https://discourse.processing.org/t/im-trying-to-make-a-game-inspired-by-the-puzzles-of-the-witness/47747 "2026-01-13T10:22:52Z")

</div>

from p5 import run,createCanvas,noLoop,background,stroke,line,fill,noStroke,rect,strokeWeight,noFill,ellipse,point,mouseIsPressed # DÉFINITION DES NIVEAUX LEVELS = \[ { "grid": (4, 4), # taille de l…

---

## [canvasGUI V2 released](https://discourse.processing.org/t/canvasgui-v2-released/47586)

<div class="topic-metadata">

**Author:** [@quark](https://discourse.processing.org/u/quark)\
**Replies:** 0\
**Last updated:** [December 3, 2025, 4:31pm UTC](https://discourse.processing.org/t/canvasgui-v2-released/47586 "2025-12-03T16:31:40Z")

</div>

I created canvasGUI in 2022 so I could learn JavaScript and p5js. Now 3 years later and with the advent of p5js V2 I thought it was time to apply my new found knowledge and improve canvasGUI, hence V2. :smiley: Changes …

---

## [Can't seem to draw in the setup function (beginner question)](https://discourse.processing.org/t/cant-seem-to-draw-in-the-setup-function-beginner-question/47555)

<div class="topic-metadata">

**Author:** [@pimath](https://discourse.processing.org/u/pimath)\
**Replies:** 5\
**Last updated:** [November 23, 2025, 9:28pm UTC](https://discourse.processing.org/t/cant-seem-to-draw-in-the-setup-function-beginner-question/47555 "2025-11-23T21:28:32Z")

</div>

I’m using the p5.js web editor and can’t seem to get anything drawn to the screen using setup(). It does work in draw() though. Oddly I tested copy/pasting code in from the setup() reference page and it works when I cop…

---

## [Using HTML button element to change a variable in the Javascript](https://discourse.processing.org/t/using-html-button-element-to-change-a-variable-in-the-javascript/47557)

<div class="topic-metadata">

**Author:** [@telstartelstar](https://discourse.processing.org/u/telstartelstar)\
**Replies:** 3\
**Last updated:** [November 23, 2025, 1:55am UTC](https://discourse.processing.org/t/using-html-button-element-to-change-a-variable-in-the-javascript/47557 "2025-11-23T01:55:24Z")

</div>

Hi again! For another part of my project I’m trying to figure out how to use a element in the HTML of my sketch to change a set variable in my Javascript. In specific I’m using it to change the background image variabl…

---

## [Porting p5js code to another program](https://discourse.processing.org/t/porting-p5js-code-to-another-program/47507)

<div class="topic-metadata">

**Author:** [@telstartelstar](https://discourse.processing.org/u/telstartelstar)\
**Replies:** 9\
**Last updated:** [November 22, 2025, 9:29pm UTC](https://discourse.processing.org/t/porting-p5js-code-to-another-program/47507 "2025-11-22T21:29:58Z")

</div>

Hello! I’m currently working on a final for one of my classes, and I realized I needed to port all my code into another program so I can eventually host it on a website. But when I copy/paste my code from p5js to Dreamw…

---

## [Wrong blending of flat elements in WEBGL mode](https://discourse.processing.org/t/wrong-blending-of-flat-elements-in-webgl-mode/47402)

<div class="topic-metadata">

**Author:** [@JuanIrache](https://discourse.processing.org/u/JuanIrache)\
**Replies:** 13\
**Last updated:** [November 13, 2025, 12:03am UTC](https://discourse.processing.org/t/wrong-blending-of-flat-elements-in-webgl-mode/47402 "2025-11-13T00:03:04Z")

</div>

Hi, When drawing text, or images, or other flat elements, the opacity of transparent areas breaks. See for example how the text behaves here if drawn before or after a series of rects (simulating fog): type-load-google…

---

## [Tips and tricks : how to use Gemini to translate Processing to P5js](https://discourse.processing.org/t/tips-and-tricks-how-to-use-gemini-to-translate-processing-to-p5js/47435)

<div class="topic-metadata">

**Author:** [@EricRogerGarcia](https://discourse.processing.org/u/EricRogerGarcia)\
**Replies:** 2\
**Last updated:** [November 10, 2025, 7:24am UTC](https://discourse.processing.org/t/tips-and-tricks-how-to-use-gemini-to-translate-processing-to-p5js/47435 "2025-11-10T07:24:32Z")

</div>

Prompt to do Processing to P5js with Gemini Seen with Gemini! (this version isn’t tested yet but it should work. I did the same thing with a very long prompt and it worked fine ! October 23, 2025 ) Precede the Proce…

---

## [\[dev updates\] Help test p5.js 2.1 before release: TypeScript, Color Contrast Check, Add-on Events, p5.strands](https://discourse.processing.org/t/dev-updates-help-test-p5-js-2-1-before-release-typescript-color-contrast-check-add-on-events-p5-strands/47486)

<div class="topic-metadata">

**Author:** [@kit](https://discourse.processing.org/u/kit)\
**Replies:** 0\
**Last updated:** [November 4, 2025, 10:23pm UTC](https://discourse.processing.org/t/dev-updates-help-test-p5-js-2-1-before-release-typescript-color-contrast-check-add-on-events-p5-strands/47486 "2025-11-04T22:23:24Z")

</div>

Hello everyone! We’re nearly ready to release p5.js 2.1, made possibly by the work of 30 different contributors over the past few months! You can check the full notes here. What to help test before we release? Copy & …

---

## [Processing 4 p5.js Mode "loadJSON not syntax hi-lighted"](https://discourse.processing.org/t/processing-4-p5-js-mode-loadjson-not-syntax-hi-lighted/47468)

<div class="topic-metadata">

**Author:** [@PerspexSphinx](https://discourse.processing.org/u/PerspexSphinx)\
**Replies:** 2\
**Last updated:** [November 4, 2025, 7:25pm UTC](https://discourse.processing.org/t/processing-4-p5-js-mode-loadjson-not-syntax-hi-lighted/47468 "2025-11-04T19:25:32Z")

</div>

loadJSON not syntax hi-lighted in Processing 4 v4.4.7 p5.js Mode?

---

## [P5.js V2.0.5 on own server: loadTable issues](https://discourse.processing.org/t/p5-js-v2-0-5-on-own-server-loadtable-issues/47441)

<div class="topic-metadata">

**Author:** [@RPI](https://discourse.processing.org/u/RPI)\
**Replies:** 2\
**Last updated:** [October 26, 2025, 12:39am UTC](https://discourse.processing.org/t/p5-js-v2-0-5-on-own-server-loadtable-issues/47441 "2025-10-26T00:39:38Z")

</div>

i have my project online editor when i ZIP download the code from there and copy it into my local RPI4 NGINX server browser can not find the needed file ( like table ) but that is understandable: http://192.168.1.10…

---

## [createCapture on Android (Nokia 7.2)](https://discourse.processing.org/t/createcapture-on-android-nokia-7-2/47419)

<div class="topic-metadata">

**Author:** [@jjjochennn](https://discourse.processing.org/u/jjjochennn)\
**Replies:** 1\
**Last updated:** [October 23, 2025, 8:00am UTC](https://discourse.processing.org/t/createcapture-on-android-nokia-7-2/47419 "2025-10-23T08:00:12Z")

</div>

Hi all I have this stripped down basic code that I want to run on my Nokia 7.2 smartphone: \<!-- let capture; let options = { video: { facingMode: { exact: "environment" }, width: { ideal: 2280 }, height: …

---

## [Question about //noprotect feature](https://discourse.processing.org/t/question-about-noprotect-feature/47401)

<div class="topic-metadata">

**Author:** [@horizontal\_shading](https://discourse.processing.org/u/horizontal_shading)\
**Replies:** 3\
**Last updated:** [October 19, 2025, 8:57pm UTC](https://discourse.processing.org/t/question-about-noprotect-feature/47401 "2025-10-19T20:57:18Z")

</div>

So as you all may know, there is a limit regarding how for loops work in p5.js. For example, this code draws many circles on top of each other on the canvas, but the process quickly halts & the canvas vanishes due to th…

---

## [P5 js V 2.0.5 orbitControl Android touch](https://discourse.processing.org/t/p5-js-v-2-0-5-orbitcontrol-android-touch/47396)

<div class="topic-metadata">

**Author:** [@RPI](https://discourse.processing.org/u/RPI)\
**Replies:** 0\
**Last updated:** [October 19, 2025, 2:41am UTC](https://discourse.processing.org/t/p5-js-v-2-0-5-orbitcontrol-android-touch/47396 "2025-10-19T02:41:30Z")

</div>

using orbit Control PC mouse: left: rotate middle (wheel ): zoom right: pan Android touch: one finger move: rotate 2 finger span: zoom 2 finger move: pan all works nice. but on Android browser, when i scroll do…

---

## [Error on atan() call](https://discourse.processing.org/t/error-on-atan-call/47373)

<div class="topic-metadata">

**Author:** [@Xero](https://discourse.processing.org/u/Xero)\
**Replies:** 2\
**Last updated:** [October 16, 2025, 8:33am UTC](https://discourse.processing.org/t/error-on-atan-call/47373 "2025-10-16T08:33:57Z")

</div>

Having an issue, is this a bug? or am I doing something wrong? function setup() { createCanvas(400, 400); background(128); } function draw() { let a = cos(0.5); text(a.toString(), 200,200); a = atan(0.5); t…

---

## [Support for Top-Level Global Mode](https://discourse.processing.org/t/support-for-top-level-global-mode/47359)

<div class="topic-metadata">

**Author:** [@qashto](https://discourse.processing.org/u/qashto)\
**Replies:** 0\
**Last updated:** [October 14, 2025, 1:23pm UTC](https://discourse.processing.org/t/support-for-top-level-global-mode/47359 "2025-10-14T13:23:50Z")

</div>

Hi everyone! Kit has requested further discussion from the community on this issue. Please let us know if this feature from Processing is something you’d like to see in p5.js!

---

## [2.0.5 content-type issue](https://discourse.processing.org/t/2-0-5-content-type-issue/47189)

<div class="topic-metadata">

**Author:** [@pifragile](https://discourse.processing.org/u/pifragile)\
**Replies:** 4\
**Last updated:** [October 9, 2025, 4:36pm UTC](https://discourse.processing.org/t/2-0-5-content-type-issue/47189 "2025-10-09T16:36:52Z")

</div>

i ran into the following issue: whenever i serve the p5.min.js file, v2.0.5, from somewhere like amazon s3 or pinata i get the error in the image, when i serve with content type application/javascript, which is the stand…

---

## [P5 js V 2.0.5 bezierVertex error](https://discourse.processing.org/t/p5-js-v-2-0-5-beziervertex-error/47182)

<div class="topic-metadata">

**Author:** [@RPI](https://discourse.processing.org/u/RPI)\
**Replies:** 10\
**Last updated:** [September 23, 2025, 2:02am UTC](https://discourse.processing.org/t/p5-js-v-2-0-5-beziervertex-error/47182 "2025-09-23T02:02:36Z")

</div>

code in online editor

---

## [P5js V2 get current camera?](https://discourse.processing.org/t/p5js-v2-get-current-camera/47172)

<div class="topic-metadata">

**Author:** [@quark](https://discourse.processing.org/u/quark)\
**Replies:** 3\
**Last updated:** [September 19, 2025, 11:26am UTC](https://discourse.processing.org/t/p5js-v2-get-current-camera/47172 "2025-09-19T11:26:44Z")

</div>

In V1 I could get a reference to the current camera like this - let p5canvas; function setup() { p5canvas = createCanvas(400, 400, WEBGL); console.log(p5canvas.\_curCamera); …

---

## [Sketch behaves differently on macbook and raspi](https://discourse.processing.org/t/sketch-behaves-differently-on-macbook-and-raspi/47145)

<div class="topic-metadata">

**Author:** [@noahhsmith](https://discourse.processing.org/u/noahhsmith)\
**Replies:** 10\
**Last updated:** [September 17, 2025, 6:23am UTC](https://discourse.processing.org/t/sketch-behaves-differently-on-macbook-and-raspi/47145 "2025-09-17T06:23:18Z")

</div>

Hi, this sketch was created on a macbook and works fine there - decwar / galaxy · GitLab There’s a grid of white dots, and then some white squares superimposed, as shown in the pic below. On raspi, the grid of white do…

---

## [Q: Can't make screenshot thumbnail on OpenProcessing.org when showing Cindy.js colorplot](https://discourse.processing.org/t/q-cant-make-screenshot-thumbnail-on-openprocessing-org-when-showing-cindy-js-colorplot/47059)

<div class="topic-metadata">

**Author:** [@Raj](https://discourse.processing.org/u/Raj)\
**Replies:** 4\
**Last updated:** [September 10, 2025, 11:43am UTC](https://discourse.processing.org/t/q-cant-make-screenshot-thumbnail-on-openprocessing-org-when-showing-cindy-js-colorplot/47059 "2025-09-10T11:43:01Z")

</div>

I’ve been experimenting with incorporating the geometry and math library Cindy.js into OpenProcessing sketches. That works ok, but I don’t seem to be able to make preview-thumbnail screenshots when I show a 2D colorplot.…

---

## [Questioning the function of "let" when declaring a variable](https://discourse.processing.org/t/questioning-the-function-of-let-when-declaring-a-variable/47083)

<div class="topic-metadata">

**Author:** [@mugudeli601](https://discourse.processing.org/u/mugudeli601)\
**Replies:** 4\
**Last updated:** [September 5, 2025, 1:25pm UTC](https://discourse.processing.org/t/questioning-the-function-of-let-when-declaring-a-variable/47083 "2025-09-05T13:25:58Z")

</div>

Hello! I was following through this tutorial Variables and Change and learned about “let” when declaring a variable. However, I didn’t have to declare the variable outside the draw() with “let” in order to define a varia…

---

## [Issue with Chrome and Edge Browsers not displaying sketches](https://discourse.processing.org/t/issue-with-chrome-and-edge-browsers-not-displaying-sketches/27587)

<div class="topic-metadata">

**Author:** [@GeorgeRoland](https://discourse.processing.org/u/GeorgeRoland)\
**Replies:** 3\
**Last updated:** [September 2, 2025, 11:43am UTC](https://discourse.processing.org/t/issue-with-chrome-and-edge-browsers-not-displaying-sketches/27587 "2025-09-02T11:43:43Z")

</div>

My sketches will not play in Chrome or Edge. I get a blank white screen. I found that if I remove the reference to “p5.sound.min.js” that is included in the HTML file P5 creates, these sketches load and play fine in Chro…

---

## [Using OpenProcessing](https://discourse.processing.org/t/using-openprocessing/47055)

<div class="topic-metadata">

**Author:** [@quark](https://discourse.processing.org/u/quark)\
**Replies:** 6\
**Last updated:** [August 31, 2025, 9:18am UTC](https://discourse.processing.org/t/using-openprocessing/47055 "2025-08-31T09:18:53Z")

</div>

If you use OpenProcessing I am hoping you can answer some questions for me … Is there a forum or contact to get support using OP? Anyone know how to get OP to use web workers? Is it possible to specify a p5js version …

---

## [Repeatedly read a JSON file, refreshing sketch each time](https://discourse.processing.org/t/repeatedly-read-a-json-file-refreshing-sketch-each-time/47053)

<div class="topic-metadata">

**Author:** [@noahhsmith](https://discourse.processing.org/u/noahhsmith)\
**Replies:** 5\
**Last updated:** [August 31, 2025, 12:35pm UTC](https://discourse.processing.org/t/repeatedly-read-a-json-file-refreshing-sketch-each-time/47053 "2025-08-31T12:35:06Z")

</div>

Hi everyone, the ‘reading json example’ JSON is very close to what am needing. If could ‘loop’ this to repeatedly read json and refresh sketch, should have everything needed. Are there examples of such a ‘looping’ skelet…

---

## [Proposal to add a dayOfWeek() function to P5js](https://discourse.processing.org/t/proposal-to-add-a-dayofweek-function-to-p5js/47017)

<div class="topic-metadata">

**Author:** [@EricRogerGarcia](https://discourse.processing.org/u/EricRogerGarcia)\
**Replies:** 1\
**Last updated:** [August 25, 2025, 1:19pm UTC](https://discourse.processing.org/t/proposal-to-add-a-dayofweek-function-to-p5js/47017 "2025-08-25T13:19:11Z")

</div>

const dayOfWeekDigit = new Date().getDay(); function dayOfWeek() { // : int, : 0 to 6, 0 is Sunday return dayOfWeekDigit; }

---

## [Performance differences with POINTS between 1.11 and 2.0](https://discourse.processing.org/t/performance-differences-with-points-between-1-11-and-2-0/46959)

<div class="topic-metadata">

**Author:** [@hx2A](https://discourse.processing.org/u/hx2A)\
**Replies:** 9\
**Last updated:** [August 25, 2025, 6:02am UTC](https://discourse.processing.org/t/performance-differences-with-points-between-1-11-and-2-0/46959 "2025-08-25T06:02:06Z")

</div>

I have some questions about performance differences for POINTS shapes and related POINTS questions. Compared to 1.11, the below code is much slower in p5.js 2.0. The goal is to draw 50K points with WEBGL. (I am drawing …

---

## [My regular expression is not working](https://discourse.processing.org/t/my-regular-expression-is-not-working/47004)

<div class="topic-metadata">

**Author:** [@quark](https://discourse.processing.org/u/quark)\
**Replies:** 2\
**Last updated:** [August 21, 2025, 10:07pm UTC](https://discourse.processing.org/t/my-regular-expression-is-not-working/47004 "2025-08-21T22:07:13Z")

</div>

I am trying to parse this string to find attribute assignments \<body width="500" linegap="2" paragap="8" align="justify" font="courier new"\>' An attribute assignment is of the format name="value" where the format is …

---

## [Petition : Oracle, it’s time to free JavaScript](https://discourse.processing.org/t/petition-oracle-it-s-time-to-free-javascript/46954)

<div class="topic-metadata">

**Author:** [@EricRogerGarcia](https://discourse.processing.org/u/EricRogerGarcia)\
**Replies:** 0\
**Last updated:** [August 17, 2025, 12:24pm UTC](https://discourse.processing.org/t/petition-oracle-it-s-time-to-free-javascript/46954 "2025-08-17T12:24:29Z")

</div>

The link that explains everything

[Previous page](https://discourse.processing.org/c/p5js/10.md?page=1)

[Next page](https://discourse.processing.org/c/p5js/10.md?page=3)
