# p5.js

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

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

**Page:** 5

---

## [Curious About p5.js 2.0](https://discourse.processing.org/t/curious-about-p5-js-2-0/45920)

<div class="topic-metadata">

**Author:** [@himanshukholiya](https://discourse.processing.org/u/himanshukholiya)\
**Replies:** 1\
**Last updated:** [March 7, 2025, 11:04am UTC](https://discourse.processing.org/t/curious-about-p5-js-2-0/45920 "2025-03-07T11:04:28Z")

</div>

I was exploring the p5.js GitHub repository and came across discussions about p5.js 2.0. The project caught my interest, especially seeing how some features have already been completed while others are still open for con…

---

## [Looking for a solution to make video autoplay work with p5.js on Firefox for Android, while it works in other browsers](https://discourse.processing.org/t/looking-for-a-solution-to-make-video-autoplay-work-with-p5-js-on-firefox-for-android-while-it-works-in-other-browsers/45850)

<div class="topic-metadata">

**Author:** [@v\_v.c](https://discourse.processing.org/u/v_v.c)\
**Replies:** 1\
**Last updated:** [March 2, 2025, 9:02am UTC](https://discourse.processing.org/t/looking-for-a-solution-to-make-video-autoplay-work-with-p5-js-on-firefox-for-android-while-it-works-in-other-browsers/45850 "2025-03-02T09:02:17Z")

</div>

Hey all I’m trying to get p5.js to autoplay video on Firefox Android, but I haven’t found a solution yet. Here’s a CodePen link demonstrating the issue: The page contains a video played with generic HTML and another …

---

## [Rotate arc in pacman animation](https://discourse.processing.org/t/rotate-arc-in-pacman-animation/45367)

<div class="topic-metadata">

**Author:** [@edufissure](https://discourse.processing.org/u/edufissure)\
**Replies:** 44\
**Last updated:** [February 20, 2025, 10:02pm UTC](https://discourse.processing.org/t/rotate-arc-in-pacman-animation/45367 "2025-02-20T22:02:15Z")

</div>

Hi ive been reading the tutorial or example were you make an animation of a pacman bit opening and closing the mouth The code: function draw() { background(0); // Style the arc. //noStroke(); fill(255, 255, 0)…

---

## [Perlin Noise Implementation?](https://discourse.processing.org/t/perlin-noise-implementation/45773)

<div class="topic-metadata">

**Author:** [@mario60](https://discourse.processing.org/u/mario60)\
**Replies:** 1\
**Last updated:** [February 18, 2025, 12:28pm UTC](https://discourse.processing.org/t/perlin-noise-implementation/45773 "2025-02-18T12:28:52Z")

</div>

I am not able to locate the file where the Perlin noise function noise() has been implemented. Please let me have the precise url, thanks. There it is, at core/src/processing/core/PApplet.java, line 4814 ps. I see p…

---

## [Creating 2D overlay with orbitControl](https://discourse.processing.org/t/creating-2d-overlay-with-orbitcontrol/45761)

<div class="topic-metadata">

**Author:** [@quark](https://discourse.processing.org/u/quark)\
**Replies:** 6\
**Last updated:** [February 15, 2025, 5:18pm UTC](https://discourse.processing.org/t/creating-2d-overlay-with-orbitcontrol/45761 "2025-02-15T17:18:40Z")

</div>

I have created a sketch to display the Utah Teapot and I am using orbitControl() to view it from any angle. My problem is that I am trying to create a static 2D overlay. As a demo I have simplified one of the p5js examp…

---

## [Turtle Graphics library (official release)](https://discourse.processing.org/t/turtle-graphics-library-official-release/45768)

<div class="topic-metadata">

**Author:** [@quark](https://discourse.processing.org/u/quark)\
**Replies:** 0\
**Last updated:** [February 15, 2025, 4:50pm UTC](https://discourse.processing.org/t/turtle-graphics-library-official-release/45768 "2025-02-15T16:50:15Z")

</div>

Turtle Graphics 0.9.1 is now officially released and has been submitted to Processing for inclusion on their website. Where to find out more github This is the primary source for information about using the library…

---

## [Mask function with external SVG shape](https://discourse.processing.org/t/mask-function-with-external-svg-shape/45746)

<div class="topic-metadata">

**Author:** [@Katsankat](https://discourse.processing.org/u/Katsankat)\
**Replies:** 1\
**Last updated:** [February 13, 2025, 2:47pm UTC](https://discourse.processing.org/t/mask-function-with-external-svg-shape/45746 "2025-02-13T14:47:30Z")

</div>

Hi, I’m using using P5.js with a node.js server. I’m trying to fill a SVG shape (external .svg file), with some drawing functions. To test it I’ve took some dots filling functions I’ve found, but it’s not the importan…

---

## [saveGif() delay doesn't work](https://discourse.processing.org/t/savegif-delay-doesnt-work/45706)

<div class="topic-metadata">

**Author:** [@Chloros](https://discourse.processing.org/u/Chloros)\
**Replies:** 4\
**Last updated:** [February 5, 2025, 9:44am UTC](https://discourse.processing.org/t/savegif-delay-doesnt-work/45706 "2025-02-05T09:44:33Z")

</div>

Hi, I’m trying to export some gifs with the function saveGif() ( https://p5js.org/reference/p5/saveGif/ ) but it seems taht the delay before recording the images doesn’t work. It records the gif but doesn’t apply any de…

---

## [Turtle Graphics](https://discourse.processing.org/t/turtle-graphics/45672)

<div class="topic-metadata">

**Author:** [@quark](https://discourse.processing.org/u/quark)\
**Replies:** 34\
**Last updated:** [February 2, 2025, 8:40pm UTC](https://discourse.processing.org/t/turtle-graphics/45672 "2025-02-02T20:40:58Z")

</div>

I have been working on a library to perform Turtle Graphics with animation so the user can see the image being ‘developed’ rather than just the final result. Here are a few examples. These sketches have been embedded…

---

## [Building A Most Simple Programming Language To Visualise Information](https://discourse.processing.org/t/building-a-most-simple-programming-language-to-visualise-information/45626)

<div class="topic-metadata">

**Author:** [@refactor\_this\_l4ter](https://discourse.processing.org/u/refactor_this_l4ter)\
**Replies:** 3\
**Last updated:** [January 22, 2025, 10:33pm UTC](https://discourse.processing.org/t/building-a-most-simple-programming-language-to-visualise-information/45626 "2025-01-22T22:33:36Z")

</div>

Hi there folks, this is my first time ever posting an entry on a online programming forum, please excuse my posting format if it is not up to the standart. While reading this topic, please consider the following: altough…

---

## [Creating a paper-engineering pop-up with angular velocity](https://discourse.processing.org/t/creating-a-paper-engineering-pop-up-with-angular-velocity/45517)

<div class="topic-metadata">

**Author:** [@fobioid](https://discourse.processing.org/u/fobioid)\
**Replies:** 1\
**Last updated:** [January 5, 2025, 12:33pm UTC](https://discourse.processing.org/t/creating-a-paper-engineering-pop-up-with-angular-velocity/45517 "2025-01-05T12:33:08Z")

</div>

I’m trying to create an animated pop-up card. I can figure out how to animate folding planes when the folds are parallel, but am having trouble figuring out angled folds that increase the angular velocity of the moving p…

---

## [mouseClick() function doesn't work on iPhone (p5.js)](https://discourse.processing.org/t/mouseclick-function-doesnt-work-on-iphone-p5-js/22866)

<div class="topic-metadata">

**Author:** [@papaboo](https://discourse.processing.org/u/papaboo)\
**Replies:** 2\
**Last updated:** [January 4, 2025, 9:43pm UTC](https://discourse.processing.org/t/mouseclick-function-doesnt-work-on-iphone-p5-js/22866 "2025-01-04T21:43:47Z")

</div>

I’ve made a simple application. It works on all major platforms (macOS, Windows, Android etc) but it doesn’t do anything on iPhone Safari. It just draws things on the screen but nothing interactive; nothing written in mo…

---

## [How to set limits on zoom min/max in p5.js WEBGL mode?](https://discourse.processing.org/t/how-to-set-limits-on-zoom-min-max-in-p5-js-webgl-mode/45476)

<div class="topic-metadata">

**Author:** [@asdfasdf](https://discourse.processing.org/u/asdfasdf)\
**Replies:** 6\
**Last updated:** [December 27, 2024, 8:45pm UTC](https://discourse.processing.org/t/how-to-set-limits-on-zoom-min-max-in-p5-js-webgl-mode/45476 "2024-12-27T20:45:09Z")

</div>

I have a p5.js project in WEBGL mode, and I’ve been looking online to find a good way to constrain the minimum and maximum zoom levels, but I can’t find a solid solution. Ideally, I’d like to impose limits that work wit…

---

## [Current JavaScript Function Definition Syntax](https://discourse.processing.org/t/current-javascript-function-definition-syntax/45512)

<div class="topic-metadata">

**Author:** [@Quercus](https://discourse.processing.org/u/Quercus)\
**Replies:** 2\
**Last updated:** [December 27, 2024, 7:56pm UTC](https://discourse.processing.org/t/current-javascript-function-definition-syntax/45512 "2024-12-27T19:56:42Z")

</div>

I love the book Getting Started with p5.js that is published by Maker Media. The examples included are very helpful, but since the book is from 2016, those examples do not utilize function expressions or arrow syntax for…

---

## [Zoom In boundries problem with Penrose Tilling App](https://discourse.processing.org/t/zoom-in-boundries-problem-with-penrose-tilling-app/45492)

<div class="topic-metadata">

**Author:** [@winterchan](https://discourse.processing.org/u/winterchan)\
**Replies:** 2\
**Last updated:** [December 21, 2024, 3:41pm UTC](https://discourse.processing.org/t/zoom-in-boundries-problem-with-penrose-tilling-app/45492 "2024-12-21T15:41:40Z")

</div>

with my latest code, it seems as if the boundaries of the space in which the art itself can be in, are smaller then the canvas itself, how do i know? Look at the first image: this is how the shape looks correctl…

---

## [Question about looping](https://discourse.processing.org/t/question-about-looping/45436)

<div class="topic-metadata">

**Author:** [@edufissure](https://discourse.processing.org/u/edufissure)\
**Replies:** 2\
**Last updated:** [December 7, 2024, 12:26am UTC](https://discourse.processing.org/t/question-about-looping/45436 "2024-12-07T00:26:38Z")

</div>

Hi im having a doubt… i know that draw is a endless loop, from beginning to las line of code…thats correct… The doubt cames if i create a function inside draw…lets say MovePacman(); MovePacman have a loop for moving f…

---

## [A problem related to a "Live Feedback" \\ "Score System" system](https://discourse.processing.org/t/a-problem-related-to-a-live-feedback-score-system-system/45491)

<div class="topic-metadata">

**Author:** [@winterchan](https://discourse.processing.org/u/winterchan)\
**Replies:** 0\
**Last updated:** [December 19, 2024, 4:31pm UTC](https://discourse.processing.org/t/a-problem-related-to-a-live-feedback-score-system-system/45491 "2024-12-19T16:31:36Z")

</div>

Hi guys, requesting some help related to “live feedback mode” i implemented If activated you can give live feedback on your work every time you randomize to create a new output. The idea is the art should get more and…

---

## [Why does the increment/decrement operator cause bugs when used in a recursive function?](https://discourse.processing.org/t/why-does-the-increment-decrement-operator-cause-bugs-when-used-in-a-recursive-function/45484)

<div class="topic-metadata">

**Author:** [@WaningJupiter](https://discourse.processing.org/u/WaningJupiter)\
**Replies:** 9\
**Last updated:** [December 19, 2024, 12:26pm UTC](https://discourse.processing.org/t/why-does-the-increment-decrement-operator-cause-bugs-when-used-in-a-recursive-function/45484 "2024-12-19T12:26:33Z")

</div>

Hello, I have a question about the behavior of the increment/decrement operator in recursive functions. Here’s a tree fractal pattern: function setup() { ... angleMode(DEGREES); } function draw() { ... drawBr…

---

## [p5.AudioIn() not working in fullscreen](https://discourse.processing.org/t/p5-audioin-not-working-in-fullscreen/45474)

<div class="topic-metadata">

**Author:** [@lizzy](https://discourse.processing.org/u/lizzy)\
**Replies:** 1\
**Last updated:** [December 18, 2024, 6:13am UTC](https://discourse.processing.org/t/p5-audioin-not-working-in-fullscreen/45474 "2024-12-18T06:13:37Z")

</div>

Hi Forum, I am stuck debugging a project that my high school students created. They made a game where the player movement is voice activated-- your avatar jumps if you shout at the screen. It works great in the p5 edito…

---

## [P5 JS is not compatible with GSAP smooth scroller](https://discourse.processing.org/t/p5-js-is-not-compatible-with-gsap-smooth-scroller/45472)

<div class="topic-metadata">

**Author:** [@SanjaySubba](https://discourse.processing.org/u/SanjaySubba)\
**Replies:** 5\
**Last updated:** [December 17, 2024, 4:57pm UTC](https://discourse.processing.org/t/p5-js-is-not-compatible-with-gsap-smooth-scroller/45472 "2024-12-17T16:57:59Z")

</div>

I have integrated smooth scroller and p5 js in my website. It is working fine in other browsers except in safari. The scroll is stucked in safari browser and I am unable to scroll. Here is the minimal demo in codepen in…

---

## [Bug related to Export\\Import System](https://discourse.processing.org/t/bug-related-to-export-import-system/45460)

<div class="topic-metadata">

**Author:** [@winterchan](https://discourse.processing.org/u/winterchan)\
**Replies:** 8\
**Last updated:** [December 15, 2024, 3:25am UTC](https://discourse.processing.org/t/bug-related-to-export-import-system/45460 "2024-12-15T03:25:29Z")

</div>

The code is found here I found out that if i import the exact same export code on 2 pcs or even on the same pc but on a different tab or just reload the same tab and import it or hit the reload the code \\ randomiz…

---

## [More than one sketch in same HTML page](https://discourse.processing.org/t/more-than-one-sketch-in-same-html-page/45447)

<div class="topic-metadata">

**Author:** [@edufissure](https://discourse.processing.org/u/edufissure)\
**Replies:** 14\
**Last updated:** [December 14, 2024, 6:44pm UTC](https://discourse.processing.org/t/more-than-one-sketch-in-same-html-page/45447 "2024-12-14T18:44:36Z")

</div>

My index.html ( relevant code): \<!--Utilitzem la llibreria p5--\> \<script type="module" src="/js/libraries/p5.min.js"\>\</script\> \<!--Carreguem moduls--\> \<!--Carreguem sketch--\> \<script type="module" sr…

---

## [orbitControl() disabling and enabling options](https://discourse.processing.org/t/orbitcontrol-disabling-and-enabling-options/43665)

<div class="topic-metadata">

**Author:** [@elmoNeedsArson](https://discourse.processing.org/u/elmoNeedsArson)\
**Replies:** 2\
**Last updated:** [December 14, 2024, 10:38am UTC](https://discourse.processing.org/t/orbitcontrol-disabling-and-enabling-options/43665 "2024-12-14T10:38:43Z")

</div>

When using the built-in orbitControl() function with webGl and p5js you are able to set the strength of the sensitivity in the function (e.g. orbitControl(1,0,1)). This seems to be the only control you get however. Becau…

---

## [P5.js Web Editor problem exporting a function](https://discourse.processing.org/t/p5-js-web-editor-problem-exporting-a-function/45420)

<div class="topic-metadata">

**Author:** [@edufissure](https://discourse.processing.org/u/edufissure)\
**Replies:** 4\
**Last updated:** [December 3, 2024, 2:07pm UTC](https://discourse.processing.org/t/p5-js-web-editor-problem-exporting-a-function/45420 "2024-12-03T14:07:33Z")

</div>

Hi im doing this test to import a class from a separate file: but i got error: The export: The import: The html file: Any help would be apreciated This is for educational purpose

---

## [P5 text() and console.log treat multiline strings differently](https://discourse.processing.org/t/p5-text-and-console-log-treat-multiline-strings-differently/45452)

<div class="topic-metadata">

**Author:** [@ger](https://discourse.processing.org/u/ger)\
**Replies:** 9\
**Last updated:** [December 12, 2024, 2:50pm UTC](https://discourse.processing.org/t/p5-text-and-console-log-treat-multiline-strings-differently/45452 "2024-12-12T14:50:41Z")

</div>

Hello! I am trying to print some ASCII art to my p5 sketch and am having a lot of trouble. When it prints to the console, the padding on the art is correct and it looks good in the console. But when I use the text(art,0,…

---

## [Error in displaying a image](https://discourse.processing.org/t/error-in-displaying-a-image/45433)

<div class="topic-metadata">

**Author:** [@edufissure](https://discourse.processing.org/u/edufissure)\
**Replies:** 19\
**Last updated:** [December 11, 2024, 4:53pm UTC](https://discourse.processing.org/t/error-in-displaying-a-image/45433 "2024-12-11T16:53:43Z")

</div>

Im facing an error: Console TypeError: this.\_renderer is undefined 🌸 p5.js dice: \[p5.js, line 95593\] Cannot read property of undefined. Check the line number in error and make sure the variable which is being operated …

---

## [I attach a .eslintrc.json file just to use with p5.js](https://discourse.processing.org/t/i-attach-a-eslintrc-json-file-just-to-use-with-p5-js/45444)

<div class="topic-metadata">

**Author:** [@edufissure](https://discourse.processing.org/u/edufissure)\
**Replies:** 2\
**Last updated:** [December 9, 2024, 7:19pm UTC](https://discourse.processing.org/t/i-attach-a-eslintrc-json-file-just-to-use-with-p5-js/45444 "2024-12-09T19:19:49Z")

</div>

I made this with all the instructions from p5.js taken from the reference. Many of them are repeated ( generates only warnings) and i commented the category of instructions. This could be combined with And this one wit…

---

## [Background not cleared on WEBGL sketches on Samsung S24](https://discourse.processing.org/t/background-not-cleared-on-webgl-sketches-on-samsung-s24/45441)

<div class="topic-metadata">

**Author:** [@andbin](https://discourse.processing.org/u/andbin)\
**Replies:** 5\
**Last updated:** [December 8, 2024, 6:00pm UTC](https://discourse.processing.org/t/background-not-cleared-on-webgl-sketches-on-samsung-s24/45441 "2024-12-08T18:00:12Z")

</div>

Hi, I’m writing to discuss a strange problem I found while trying 3D sketches (WEBGL) on my smartphone. First of all, yesterday, I was writing my first p5.js sketch with WEBGL mode on OpenProcessing. On desktop PCs, I h…

---

## [Share data ( variable, array) between two canvas](https://discourse.processing.org/t/share-data-variable-array-between-two-canvas/45434)

<div class="topic-metadata">

**Author:** [@edufissure](https://discourse.processing.org/u/edufissure)\
**Replies:** 1\
**Last updated:** [December 5, 2024, 9:33pm UTC](https://discourse.processing.org/t/share-data-variable-array-between-two-canvas/45434 "2024-12-05T21:33:59Z")

</div>

Hi ive been googleing, but im asking if there is any trick or way to share info, for example object, variables, arrays between two sketches. Lets say i have one game in one canvas inside a div id=“game”… but in other pl…

---

## [How to add Help in Webstorm](https://discourse.processing.org/t/how-to-add-help-in-webstorm/45368)

<div class="topic-metadata">

**Author:** [@edufissure](https://discourse.processing.org/u/edufissure)\
**Replies:** 1\
**Last updated:** [December 4, 2024, 10:15am UTC](https://discourse.processing.org/t/how-to-add-help-in-webstorm/45368 "2024-12-04T10:15:58Z")

</div>

Id like to autocomplete and reading help while coding of p5.js in Webstorm… For example if i want write: // Draw the arc. arc(50, 50, 80, 80, startAngle, endAngle, PIE); some kind of: arc( and as a tooltip when m…

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

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