# p5.js

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

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

**Page:** 11

---

## [Web Editor Feature Request - Don't auto-expand folders on save](https://discourse.processing.org/t/web-editor-feature-request-dont-auto-expand-folders-on-save/43036)

<div class="topic-metadata">

**Author:** [@StevenJS](https://discourse.processing.org/u/StevenJS)\
**Replies:** 2\
**Last updated:** [October 23, 2023, 5:27pm UTC](https://discourse.processing.org/t/web-editor-feature-request-dont-auto-expand-folders-on-save/43036 "2023-10-23T17:27:48Z")

</div>

When I save my work in the the p5.js Web editor (or an auto-save occurs), all the folders expand to reveal their contents, even after I contract them. Please don’t modify the expanded or contracted state of any folder up…

---

## [Proposal for Web Editor: Replace random sketch name generator](https://discourse.processing.org/t/proposal-for-web-editor-replace-random-sketch-name-generator/43023)

<div class="topic-metadata">

**Author:** [@kizusu](https://discourse.processing.org/u/kizusu)\
**Replies:** 1\
**Last updated:** [October 21, 2023, 5:43pm UTC](https://discourse.processing.org/t/proposal-for-web-editor-replace-random-sketch-name-generator/43023 "2023-10-21T17:43:03Z")

</div>

I see the mobile-friendly web editor has finally arrived! :tada: :confetti\_ball: Now, there seems to a minor issue with saved sketches appearing to get a random name on reload–so I’ll go log that on the GitHub–but in th…

---

## [Nodemon is not restarting the server inside container in docker for windows](https://discourse.processing.org/t/nodemon-is-not-restarting-the-server-inside-container-in-docker-for-windows/43014)

<div class="topic-metadata">

**Author:** [@pranavtartey](https://discourse.processing.org/u/pranavtartey)\
**Replies:** 0\
**Last updated:** [October 19, 2023, 5:00pm UTC](https://discourse.processing.org/t/nodemon-is-not-restarting-the-server-inside-container-in-docker-for-windows/43014 "2023-10-19T17:00:06Z")

</div>

Hello everyone, My name is Pranav Tartey and I am starting out with open source. I am using docker for Windows for setting up the project locally and everything is working fine but my nodemon is not detecting the chang…

---

## [Can't access p5.Vector methods in typescript, like random2D() and sub()](https://discourse.processing.org/t/cant-access-p5-vector-methods-in-typescript-like-random2d-and-sub/38315)

<div class="topic-metadata">

**Author:** [@pedrocoelho](https://discourse.processing.org/u/pedrocoelho)\
**Replies:** 4\
**Last updated:** [October 16, 2023, 8:20pm UTC](https://discourse.processing.org/t/cant-access-p5-vector-methods-in-typescript-like-random2d-and-sub/38315 "2023-10-16T20:20:46Z")

</div>

Hello, I’m new to p5.js and I’m trying to convert what I learned in a tutorial from the Coding Train into a NextJS app with React and Typescript. I have this Vehicle class but when I try to use any Vector methods I get …

---

## [Why is the saved gif low-quality? What can I do about this?](https://discourse.processing.org/t/why-is-the-saved-gif-low-quality-what-can-i-do-about-this/42985)

<div class="topic-metadata">

**Author:** [@laya](https://discourse.processing.org/u/laya)\
**Replies:** 0\
**Last updated:** [October 16, 2023, 2:24pm UTC](https://discourse.processing.org/t/why-is-the-saved-gif-low-quality-what-can-i-do-about-this/42985 "2023-10-16T14:24:06Z")

</div>

Swear the trailing light was smoother in the browser.

---

## [Asking for some open unassigned good first issues](https://discourse.processing.org/t/asking-for-some-open-unassigned-good-first-issues/42843)

<div class="topic-metadata">

**Author:** [@vibhoo24](https://discourse.processing.org/u/vibhoo24)\
**Replies:** 3\
**Last updated:** [October 13, 2023, 8:17pm UTC](https://discourse.processing.org/t/asking-for-some-open-unassigned-good-first-issues/42843 "2023-10-13T20:17:17Z")

</div>

Hi there! I have setup the p5.js web editor locally following the Readme.md. I am unable to find open unassigned good first issues.

---

## [How to play a short animation upon interaction (rotate a shape)](https://discourse.processing.org/t/how-to-play-a-short-animation-upon-interaction-rotate-a-shape/42934)

<div class="topic-metadata">

**Author:** [@jackeddielove](https://discourse.processing.org/u/jackeddielove)\
**Replies:** 14\
**Last updated:** [October 13, 2023, 6:01am UTC](https://discourse.processing.org/t/how-to-play-a-short-animation-upon-interaction-rotate-a-shape/42934 "2023-10-13T06:01:58Z")

</div>

Hi all! I want to rotate a cube about a particular axis through a particular angle every time the user presses the RIGHTARROW key. I want the user to see the rotation happen, starting at its original position and rotati…

---

## [Display grid of objects (animated circles)](https://discourse.processing.org/t/display-grid-of-objects-animated-circles/42927)

<div class="topic-metadata">

**Author:** [@Alesk1969](https://discourse.processing.org/u/Alesk1969)\
**Replies:** 5\
**Last updated:** [October 9, 2023, 3:48pm UTC](https://discourse.processing.org/t/display-grid-of-objects-animated-circles/42927 "2023-10-09T15:48:42Z")

</div>

Hi everyone, I know that this is a frequent and simple question but I haven’t been able to find a solution for what I’d like to do. I’m creating an object made of circles. In the class I have a function that modifies t…

---

## [saveCanvas() of p5.js stopped working after downloading newest version of Processing](https://discourse.processing.org/t/savecanvas-of-p5-js-stopped-working-after-downloading-newest-version-of-processing/42914)

<div class="topic-metadata">

**Author:** [@laya](https://discourse.processing.org/u/laya)\
**Replies:** 1\
**Last updated:** [October 8, 2023, 11:18am UTC](https://discourse.processing.org/t/savecanvas-of-p5-js-stopped-working-after-downloading-newest-version-of-processing/42914 "2023-10-08T11:18:18Z")

</div>

It was working pretty well before. I was able to save jpg files by just calling saveCanvas() in the setup(). After I downloaded the newest version of processing, it stopped working, and only a blank canvas is saved.

---

## [Audio examples experience. What a bear - updated](https://discourse.processing.org/t/audio-examples-experience-what-a-bear-updated/42920)

<div class="topic-metadata">

**Author:** [@f101](https://discourse.processing.org/u/f101)\
**Replies:** 0\
**Last updated:** [October 8, 2023, 12:28am UTC](https://discourse.processing.org/t/audio-examples-experience-what-a-bear-updated/42920 "2023-10-08T00:28:15Z")

</div>

Some development difficult with sound examples: 1 - Open a p5js audio example in processing for windows then save it before making any mods. The html file is sometimes modified to add a link to p5.sound.js library, betw…

---

## [How to redraw() on loop](https://discourse.processing.org/t/how-to-redraw-on-loop/42852)

<div class="topic-metadata">

**Author:** [@blkpanther](https://discourse.processing.org/u/blkpanther)\
**Replies:** 10\
**Last updated:** [October 5, 2023, 12:01am UTC](https://discourse.processing.org/t/how-to-redraw-on-loop/42852 "2023-10-05T00:01:18Z")

</div>

I have a sketch on loop but want to test out different colors and sizes via p5gui quickly. Redraw seems to require noLoop(). What can i do to trigger a redraw despite the loop and select from a list of colors and sizes? …

---

## [Load obj files with mtl colours](https://discourse.processing.org/t/load-obj-files-with-mtl-colours/42825)

<div class="topic-metadata">

**Author:** [@discuss9128](https://discourse.processing.org/u/discuss9128)\
**Replies:** 0\
**Last updated:** [September 25, 2023, 6:23am UTC](https://discourse.processing.org/t/load-obj-files-with-mtl-colours/42825 "2023-09-25T06:23:44Z")

</div>

Hi, I have some models in obj format, with mtl files specifying colours for faces (like this). p5 doesn’t support support mtl files, however. I could write a bit of code to process the mtl files, but what’s the best way…

---

## [Send form p5.js data from domain page to ESP8266 webserver](https://discourse.processing.org/t/send-form-p5-js-data-from-domain-page-to-esp8266-webserver/42794)

<div class="topic-metadata">

**Author:** [@samjm](https://discourse.processing.org/u/samjm)\
**Replies:** 0\
**Last updated:** [September 19, 2023, 6:06pm UTC](https://discourse.processing.org/t/send-form-p5-js-data-from-domain-page-to-esp8266-webserver/42794 "2023-09-19T18:06:11Z")

</div>

i have a p5.js speech recognition program hosted on a domain page. I want to send the regnised words to a esp8266 webser through an android browser running on a diffferent isp service,\\ . the ip for the domain page is d…

---

## [New to p5js - strokeWeight & Order of Operations?](https://discourse.processing.org/t/new-to-p5js-strokeweight-order-of-operations/42808)

<div class="topic-metadata">

**Author:** [@DavevaD](https://discourse.processing.org/u/DavevaD)\
**Replies:** 6\
**Last updated:** [September 21, 2023, 4:42pm UTC](https://discourse.processing.org/t/new-to-p5js-strokeweight-order-of-operations/42808 "2023-09-21T16:42:28Z")

</div>

Good Morning! I am making my way (no pun intended) through the book Make: Getting Started with p5.js. I am having trouble understanding Example 3-12: Set Stroke Weight. Based on the code I have included in this post, t…

---

## [Hot reloading using docker in p5.js web editor](https://discourse.processing.org/t/hot-reloading-using-docker-in-p5-js-web-editor/42801)

<div class="topic-metadata">

**Author:** [@Harsha10](https://discourse.processing.org/u/Harsha10)\
**Replies:** 2\
**Last updated:** [September 21, 2023, 1:29pm UTC](https://discourse.processing.org/t/hot-reloading-using-docker-in-p5-js-web-editor/42801 "2023-09-21T13:29:30Z")

</div>

I have set up the p5.js web editor in my local system through docker which i’m relatively new to it. i find that hot reloading is not occuring using the docker commands which were given in contributor docs. these are t…

---

## [\[p5\] loadImage : How to load an image from an internet URL](https://discourse.processing.org/t/p5-loadimage-how-to-load-an-image-from-an-internet-url/42752)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 6\
**Last updated:** [September 13, 2023, 6:01am UTC](https://discourse.processing.org/t/p5-loadimage-how-to-load-an-image-from-an-internet-url/42752 "2023-09-13T06:01:42Z")

</div>

\[p5\] loadImage : How to load an image from an internet URL let img; var url ="https://www.google.co.kr/images/branding/googlelogo/1x/googlelogo\_color\_272x92dp.png"; function preload() { img = loadImage(url); } functi…

---

## [FloodFill Demo Problem in p5.js Web Editor](https://discourse.processing.org/t/floodfill-demo-problem-in-p5-js-web-editor/42749)

<div class="topic-metadata">

**Author:** [@svan](https://discourse.processing.org/u/svan)\
**Replies:** 2\
**Last updated:** [September 12, 2023, 6:25am UTC](https://discourse.processing.org/t/floodfill-demo-problem-in-p5-js-web-editor/42749 "2023-09-12T06:25:41Z")

</div>

@codeguppy I have been unable to run the CodeGuppy demo on flood fill for reasons I do not understand. It worked just fine in the editor used in the video, but fails to run as expected in a p5.js web editor. The follow…

---

## [Creating a Gradient for a Bezier Curve?](https://discourse.processing.org/t/creating-a-gradient-for-a-bezier-curve/42719)

<div class="topic-metadata">

**Author:** [@looplider](https://discourse.processing.org/u/looplider)\
**Replies:** 5\
**Last updated:** [September 11, 2023, 7:53am UTC](https://discourse.processing.org/t/creating-a-gradient-for-a-bezier-curve/42719 "2023-09-11T07:53:04Z")

</div>

Hi there - I am curious if there is a way to use a gradient as a “fill” color for a Bezier curve. I wrote up a silly example with the Bezier… not sure if this is possible though. Thanks. function setup() { createCa…

---

## [Evaluating Functions in P5.JS](https://discourse.processing.org/t/evaluating-functions-in-p5-js/42693)

<div class="topic-metadata">

**Author:** [@looplider](https://discourse.processing.org/u/looplider)\
**Replies:** 9\
**Last updated:** [September 9, 2023, 3:51pm UTC](https://discourse.processing.org/t/evaluating-functions-in-p5-js/42693 "2023-09-09T15:51:22Z")

</div>

Hi there - I’m new here. I think I’m in the right place! I am trying to create a mathematical function in a P5.JS to return a number. I’ve simplified the code here, so that the function is simply a random number gener…

---

## [Can users ADD functions to p5.js code through interaction with the sketch?](https://discourse.processing.org/t/can-users-add-functions-to-p5-js-code-through-interaction-with-the-sketch/42688)

<div class="topic-metadata">

**Author:** [@SheCurvesMobius](https://discourse.processing.org/u/SheCurvesMobius)\
**Replies:** 17\
**Last updated:** [September 8, 2023, 5:14am UTC](https://discourse.processing.org/t/can-users-add-functions-to-p5-js-code-through-interaction-with-the-sketch/42688 "2023-09-08T05:14:28Z")

</div>

Hello, I would like to write code that does the following: User clicks and drags on the canvas, and when they release a square has been drawn. The code, now has a rect() function, but no rect() function existed before t…

---

## [Writing data to assets folder in p5.js sketch](https://discourse.processing.org/t/writing-data-to-assets-folder-in-p5-js-sketch/42709)

<div class="topic-metadata">

**Author:** [@svan](https://discourse.processing.org/u/svan)\
**Replies:** 8\
**Last updated:** [September 6, 2023, 10:57pm UTC](https://discourse.processing.org/t/writing-data-to-assets-folder-in-p5-js-sketch/42709 "2023-09-06T22:57:02Z")

</div>

I have created an ‘assets’ folder in my p5.js sketch and enclosed a ‘xxxx.txt’ file. Does anyone know how to write data strings to the .txt file?

---

## [Sketch working in Editor by not on hosted website :(](https://discourse.processing.org/t/sketch-working-in-editor-by-not-on-hosted-website/42679)

<div class="topic-metadata">

**Author:** [@calfish](https://discourse.processing.org/u/calfish)\
**Replies:** 1\
**Last updated:** [August 30, 2023, 9:05pm UTC](https://discourse.processing.org/t/sketch-working-in-editor-by-not-on-hosted-website/42679 "2023-08-30T21:05:01Z")

</div>

Hello, I have a sketch that is working well in the editor but won’t work on my site after I download it. I have been troubleshooting a bunch but have had no luck. I want to use sound assets larger than 5mb which is why…

---

## [Is there an integrated function to get the sign of a number?](https://discourse.processing.org/t/is-there-an-integrated-function-to-get-the-sign-of-a-number/42658)

<div class="topic-metadata">

**Author:** [@1qayxsw2](https://discourse.processing.org/u/1qayxsw2)\
**Replies:** 4\
**Last updated:** [August 28, 2023, 8:10pm UTC](https://discourse.processing.org/t/is-there-an-integrated-function-to-get-the-sign-of-a-number/42658 "2023-08-28T20:10:10Z")

</div>

Hi all, I am probably missing something basic, but I cannot directly solve it by myself. My question is about a function to return the sign of a given number, e.g.: sign(-42) should return -1, sign(42) should return 1…

---

## [Help! In FxHash Code comes up rather than image when trying to mint a token](https://discourse.processing.org/t/help-in-fxhash-code-comes-up-rather-than-image-when-trying-to-mint-a-token/42639)

<div class="topic-metadata">

**Author:** [@ghstvbng](https://discourse.processing.org/u/ghstvbng)\
**Replies:** 2\
**Last updated:** [August 25, 2023, 2:44pm UTC](https://discourse.processing.org/t/help-in-fxhash-code-comes-up-rather-than-image-when-trying-to-mint-a-token/42639 "2023-08-25T14:44:06Z")

</div>

Hello all, Maybe someone can help me out - I am trying to mint a token and it works fine in the sandbox but in the actual mint all that comes up is the written code. I appreciate the help! here is the code including t…

---

## [Reflection on ellipse simulation](https://discourse.processing.org/t/reflection-on-ellipse-simulation/42155)

<div class="topic-metadata">

**Author:** [@nikosliapis](https://discourse.processing.org/u/nikosliapis)\
**Replies:** 5\
**Last updated:** [August 22, 2023, 1:06pm UTC](https://discourse.processing.org/t/reflection-on-ellipse-simulation/42155 "2023-08-22T13:06:31Z")

</div>

Hello Everyone. I’m trying to create a simulation for a ball bouncing in the inside surface of a ellipse. This is how far i’ve been, https://editor.p5js.org/nikosliapis2000/sketches/\_Yx-KgwLN I can’t find a way to ma…

---

## [Sketch tool: linking js files from another server](https://discourse.processing.org/t/sketch-tool-linking-js-files-from-another-server/42582)

<div class="topic-metadata">

**Author:** [@quark](https://discourse.processing.org/u/quark)\
**Replies:** 10\
**Last updated:** [August 13, 2023, 12:42pm UTC](https://discourse.processing.org/t/sketch-tool-linking-js-files-from-another-server/42582 "2023-08-13T12:42:44Z")

</div>

This question is about using the p5.js Editor tool. In the index.html file there are statements in the head section to link to p5.js e.g. \<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.js"\>\</script\> …

---

## [Any Ideas: Obstruct Flow Fields By An Image](https://discourse.processing.org/t/any-ideas-obstruct-flow-fields-by-an-image/42587)

<div class="topic-metadata">

**Author:** [@Jeton\_K](https://discourse.processing.org/u/Jeton_K)\
**Replies:** 0\
**Last updated:** [August 13, 2023, 9:52am UTC](https://discourse.processing.org/t/any-ideas-obstruct-flow-fields-by-an-image/42587 "2023-08-13T09:52:43Z")

</div>

Hey all! I was wondering if anyones creative genius could help. I’m designing an app and I have a loading screen, where I want flow fields to generate to represent the data being pulled together and give the user somet…

---

## [I can't log in to myP5js](https://discourse.processing.org/t/i-cant-log-in-to-myp5js/42536)

<div class="topic-metadata">

**Author:** [@sotelo.newhall](https://discourse.processing.org/u/sotelo.newhall)\
**Replies:** 5\
**Last updated:** [August 9, 2023, 1:07am UTC](https://discourse.processing.org/t/i-cant-log-in-to-myp5js/42536 "2023-08-09T01:07:49Z")

</div>

I’m trying to reset my password to log in to my p5js account, but I never get the password reset email. Is there anything wrong with the site?

---

## [Ex 2.7 tossing a ball - The Nature of code](https://discourse.processing.org/t/ex-2-7-tossing-a-ball-the-nature-of-code/42551)

<div class="topic-metadata">

**Author:** [@Delain](https://discourse.processing.org/u/Delain)\
**Replies:** 1\
**Last updated:** [August 5, 2023, 10:35am UTC](https://discourse.processing.org/t/ex-2-7-tossing-a-ball-the-nature-of-code/42551 "2023-08-05T10:35:10Z")

</div>

I am following along with The nature of Code of Daniel Shiffman. And I am stuck on exercises 2.7 of tossing a circle with mouse interaction. I think in circles and I hope some body can shine a light on it. I looked in …

---

## [Forever trails on background with low alpha](https://discourse.processing.org/t/forever-trails-on-background-with-low-alpha/42541)

<div class="topic-metadata">

**Author:** [@alexalex25](https://discourse.processing.org/u/alexalex25)\
**Replies:** 3\
**Last updated:** [August 3, 2023, 3:06pm UTC](https://discourse.processing.org/t/forever-trails-on-background-with-low-alpha/42541 "2023-08-03T15:06:12Z")

</div>

Hello, here is my sketch : p5.js Web Editor Why do i get these dark grey trails ? I’m drawing a new background with alpha set to 7 at each frame, so i guess at some point it should get full black. But it isn’t… I have…

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

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