# p5.js

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

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

**Page:** 83

---

## [Rounded corners rectangle in webGL?](https://discourse.processing.org/t/rounded-corners-rectangle-in-webgl/15739)

<div class="topic-metadata">

**Author:** [@ishback](https://discourse.processing.org/u/ishback)\
**Replies:** 3\
**Last updated:** [November 24, 2019, 11:13pm UTC](https://discourse.processing.org/t/rounded-corners-rectangle-in-webgl/15739 "2019-11-24T23:13:35Z")

</div>

Is it possible to draw a rectangle with rounded corners in webGL? When I try it squares it. // setup let canvas = createCanvas(400, 400, WEBGL); // draw rectMode(CENTER); rotateX(radians(-rotationX)); rotateY(radia…

---

## [Issues classifying a drawing with ml5.js](https://discourse.processing.org/t/issues-classifying-a-drawing-with-ml5-js/14827)

<div class="topic-metadata">

**Author:** [@ishback](https://discourse.processing.org/u/ishback)\
**Replies:** 4\
**Last updated:** [November 24, 2019, 11:17pm UTC](https://discourse.processing.org/t/issues-classifying-a-drawing-with-ml5-js/14827 "2019-11-24T23:17:33Z")

</div>

Hello, I’m trying to classify drawings with a custom model generated by Teachable Machine. To do so I’m storing the doodle in a p5.Renderer object using createGraphics(), and sending that object to the classifier. I no…

---

## [mouseOver created object does not trigger function in p5](https://discourse.processing.org/t/mouseover-created-object-does-not-trigger-function-in-p5/15752)

<div class="topic-metadata">

**Author:** [@gjs](https://discourse.processing.org/u/gjs)\
**Replies:** 6\
**Last updated:** [November 24, 2019, 9:36pm UTC](https://discourse.processing.org/t/mouseover-created-object-does-not-trigger-function-in-p5/15752 "2019-11-24T21:36:54Z")

</div>

Hi. I would be grateful for your thoughts as to why my code fails to print “mouse is over graphic” when I move the mouse over the image “pg.” (However, if I set it up as createCanvas rather than createGraphics, it works.…

---

## [Input does not work on mobile devices](https://discourse.processing.org/t/input-does-not-work-on-mobile-devices/15660)

<div class="topic-metadata">

**Author:** [@CodingIsLife](https://discourse.processing.org/u/CodingIsLife)\
**Replies:** 9\
**Last updated:** [November 23, 2019, 10:17pm UTC](https://discourse.processing.org/t/input-does-not-work-on-mobile-devices/15660 "2019-11-23T22:17:50Z")

</div>

I have a very simple p5 sketch that is running in my desktop computer pretty well. But when I hosted that with github pages just to see if it works on mobile devices I found it not working properly. I had just a single i…

---

## [Beat unstable in graphic animation](https://discourse.processing.org/t/beat-unstable-in-graphic-animation/15493)

<div class="topic-metadata">

**Author:** [@byxx](https://discourse.processing.org/u/byxx)\
**Replies:** 33\
**Last updated:** [November 23, 2019, 11:34am UTC](https://discourse.processing.org/t/beat-unstable-in-graphic-animation/15493 "2019-11-23T11:34:12Z")

</div>

Dear p5 community, https://editor.p5js.org/byxx/sketches/EuJCp1iVI Although the basic functionality is there, it seems that the beat is not really(!) stable, which I considered to be cared for by p5 accurately… thanks…

---

## [Particle text animations in p5js](https://discourse.processing.org/t/particle-text-animations-in-p5js/15487)

<div class="topic-metadata">

**Author:** [@poppyseeds](https://discourse.processing.org/u/poppyseeds)\
**Replies:** 5\
**Last updated:** [November 22, 2019, 6:56pm UTC](https://discourse.processing.org/t/particle-text-animations-in-p5js/15487 "2019-11-22T18:56:48Z")

</div>

I want to make my text consisting of smaller particles to make it look like the words are formed by a shoal of fish (like in the movie Finding Nemo if you remember that scene). So far, I have managed to use steering beha…

---

## [How do change the shape of a 'point' in p5js?](https://discourse.processing.org/t/how-do-change-the-shape-of-a-point-in-p5js/15492)

<div class="topic-metadata">

**Author:** [@poppyseeds](https://discourse.processing.org/u/poppyseeds)\
**Replies:** 1\
**Last updated:** [November 22, 2019, 6:48pm UTC](https://discourse.processing.org/t/how-do-change-the-shape-of-a-point-in-p5js/15492 "2019-11-22T18:48:13Z")

</div>

I have created a text animation which has split the word into points using the font.toTextPoints() function. this function makes the points in circular shapes and only on the borders of the word. How can I change the cod…

---

## [Background color change with accelerometer](https://discourse.processing.org/t/background-color-change-with-accelerometer/15443)

<div class="topic-metadata">

**Author:** [@rhgrafix](https://discourse.processing.org/u/rhgrafix)\
**Replies:** 3\
**Last updated:** [November 22, 2019, 5:21pm UTC](https://discourse.processing.org/t/background-color-change-with-accelerometer/15443 "2019-11-22T17:21:44Z")

</div>

Can anyone get https://p5js.org/examples/mobile-acceleration-color.html to work? I’ve tried it on multiple devices that have accelerometers and the background color does not change with movement, Thanks, R.L. Hamm

---

## [P5.js split() questions](https://discourse.processing.org/t/p5-js-split-questions/15701)

<div class="topic-metadata">

**Author:** [@humanperson](https://discourse.processing.org/u/humanperson)\
**Replies:** 1\
**Last updated:** [November 21, 2019, 9:00pm UTC](https://discourse.processing.org/t/p5-js-split-questions/15701 "2019-11-21T21:00:57Z")

</div>

Hello guys, I’m new here. I was wondering if it was possible to get the split function in p5.js to just split the letters of a word without the delim value. Answers as to how I would do this would also be very helpful. t…

---

## [P5.js programs runned from Processing IDE not working under Edge](https://discourse.processing.org/t/p5-js-programs-runned-from-processing-ide-not-working-under-edge/15656)

<div class="topic-metadata">

**Author:** [@Laurent](https://discourse.processing.org/u/Laurent)\
**Replies:** 1\
**Last updated:** [November 20, 2019, 11:29am UTC](https://discourse.processing.org/t/p5-js-programs-runned-from-processing-ide-not-working-under-edge/15656 "2019-11-20T11:29:16Z")

</div>

Hi everyone. I’m not sure to post in the correct group and topic, so please excuse me for the inconvenience if it is not the case. Here is the problem. We are introducing a new informatics course to all students of our…

---

## [Incremental name for image save](https://discourse.processing.org/t/incremental-name-for-image-save/15599)

<div class="topic-metadata">

**Author:** [@nicolas](https://discourse.processing.org/u/nicolas)\
**Replies:** 6\
**Last updated:** [November 18, 2019, 12:04pm UTC](https://discourse.processing.org/t/incremental-name-for-image-save/15599 "2019-11-18T12:04:57Z")

</div>

Hello, I would like to know how to name images so that each image is numbered in the order of recording. Names numbered incrementally. I use this code: save("image01.png"); And i want names like: image01, image02, im…

---

## [Reloading a JSON in p5](https://discourse.processing.org/t/reloading-a-json-in-p5/15520)

<div class="topic-metadata">

**Author:** [@sdsu2020](https://discourse.processing.org/u/sdsu2020)\
**Replies:** 2\
**Last updated:** [November 18, 2019, 6:41am UTC](https://discourse.processing.org/t/reloading-a-json-in-p5/15520 "2019-11-18T06:41:11Z")

</div>

Hello. I’m currently working with geocoding API with Mapquest. I have this code written in setup right now. function setup(){ canvas = createCanvas(840,840); myMap = mappa.tileMap(options); myMap.overlay(canvas)…

---

## [Binding mouseDragged to function](https://discourse.processing.org/t/binding-mousedragged-to-function/15516)

<div class="topic-metadata">

**Author:** [@BSiemens](https://discourse.processing.org/u/BSiemens)\
**Replies:** 8\
**Last updated:** [November 18, 2019, 1:18am UTC](https://discourse.processing.org/t/binding-mousedragged-to-function/15516 "2019-11-18T01:18:42Z")

</div>

I’m binding mouse events to functions and they all work fine apart from: cnv.mouseDragged(mDragged); Anyone have any idea why?

---

## [Spectrum analyzer graphic problem](https://discourse.processing.org/t/spectrum-analyzer-graphic-problem/15576)

<div class="topic-metadata">

**Author:** [@ercank](https://discourse.processing.org/u/ercank)\
**Replies:** 1\
**Last updated:** [November 17, 2019, 2:46pm UTC](https://discourse.processing.org/t/spectrum-analyzer-graphic-problem/15576 "2019-11-17T14:46:16Z")

</div>

Hi, I’m new to coding. I’m sorry to keep you busy with something simple. I paste and run a sample code on the P5.JS online ditor (sound spectrum analyzer). I download “empty-example” with the library from the site and r…

---

## [P5 Sound Issues](https://discourse.processing.org/t/p5-sound-issues/15573)

<div class="topic-metadata">

**Author:** [@seanzshow](https://discourse.processing.org/u/seanzshow)\
**Replies:** 4\
**Last updated:** [November 17, 2019, 1:13pm UTC](https://discourse.processing.org/t/p5-sound-issues/15573 "2019-11-17T13:13:40Z")

</div>

Hi can anyone tell me where I am going wrong here? It appears that the p5 sound library is not being read - hence it doesn’t understand things like loop. However it is linked to in the HTML as a default and Ive not chang…

---

## [Fade Animation of character arrays](https://discourse.processing.org/t/fade-animation-of-character-arrays/15409)

<div class="topic-metadata">

**Author:** [@byxx](https://discourse.processing.org/u/byxx)\
**Replies:** 2\
**Last updated:** [November 14, 2019, 6:14pm UTC](https://discourse.processing.org/t/fade-animation-of-character-arrays/15409 "2019-11-14T18:14:54Z")

</div>

Dear p5 community, I build some character arrays as two shapes (shape1 and shape2) I would like to blend over with a fade animation (1 sec) from shape 1 into shape2, after having been displayed for 10 secs. During the…

---

## [FFT within a Object](https://discourse.processing.org/t/fft-within-a-object/15408)

<div class="topic-metadata">

**Author:** [@alexandr56](https://discourse.processing.org/u/alexandr56)\
**Replies:** 1\
**Last updated:** [November 14, 2019, 4:00pm UTC](https://discourse.processing.org/t/fft-within-a-object/15408 "2019-11-14T16:00:42Z")

</div>

I’m working on a project and i have my audio files being put into an audio object in order for it to be played and created but when I try to analyze the frequency using FFT it doesn’t pick anything up here’s the code for…

---

## [Professional website with p5](https://discourse.processing.org/t/professional-website-with-p5/15433)

<div class="topic-metadata">

**Author:** [@byxx](https://discourse.processing.org/u/byxx)\
**Replies:** 6\
**Last updated:** [November 13, 2019, 1:25pm UTC](https://discourse.processing.org/t/professional-website-with-p5/15433 "2019-11-13T13:25:18Z")

</div>

Hi, a typical website contains multiple pages besides the index.html. (i.e. home, bio, shop, dates, contact etc.), Do you develop pro websites in p5 or is it a mere code learning platform? Thx BX

---

## [Removing and respawning sprites](https://discourse.processing.org/t/removing-and-respawning-sprites/15387)

<div class="topic-metadata">

**Author:** [@jakobfree](https://discourse.processing.org/u/jakobfree)\
**Replies:** 2\
**Last updated:** [November 13, 2019, 10:29pm UTC](https://discourse.processing.org/t/removing-and-respawning-sprites/15387 "2019-11-13T22:29:18Z")

</div>

Hi all, Programming uber-beginner here. Having a bit of trouble figuring out one (of many) problem(s) with a current small-scale game project: https://editor.p5js.org/jakobfree/sketches/B09u80zKh I’m trying to create a…

---

## [Alpha animation start with delay](https://discourse.processing.org/t/alpha-animation-start-with-delay/15427)

<div class="topic-metadata">

**Author:** [@byxx](https://discourse.processing.org/u/byxx)\
**Replies:** 6\
**Last updated:** [November 13, 2019, 11:11am UTC](https://discourse.processing.org/t/alpha-animation-start-with-delay/15427 "2019-11-13T11:11:08Z")

</div>

Hey there, Here´s a alpha animation I work on as a beginner, starting immediately to fade out the shape containing a character array. That is okay. var f = 255; //alpha variable var speed = 0.1; // decreasing alpha mu…

---

## [Scale of image in a group affects gravity when a collider is applied](https://discourse.processing.org/t/scale-of-image-in-a-group-affects-gravity-when-a-collider-is-applied/15192)

<div class="topic-metadata">

**Author:** [@DavidJonesADA](https://discourse.processing.org/u/DavidJonesADA)\
**Replies:** 1\
**Last updated:** [November 12, 2019, 10:39pm UTC](https://discourse.processing.org/t/scale-of-image-in-a-group-affects-gravity-when-a-collider-is-applied/15192 "2019-11-12T22:39:58Z")

</div>

Greetings Processing forum, I am trying to make a simple game to dodge moving sprites in a group using the p5.js and the p5.play libraries. However, I have come upon an issue where now I want to detect if there is a col…

---

## [Image files loading issue](https://discourse.processing.org/t/image-files-loading-issue/15410)

<div class="topic-metadata">

**Author:** [@byxx](https://discourse.processing.org/u/byxx)\
**Replies:** 9\
**Last updated:** [November 12, 2019, 3:32pm UTC](https://discourse.processing.org/t/image-files-loading-issue/15410 "2019-11-12T15:32:45Z")

</div>

Dear Community, wheras the p5 online editor runs the code of the sketch.js perfectly, I cant run it in my browser after downloading it.(Saying: loading…) Where is the problem? You see the containing files in the pic, …

---

## [Accessing class methods](https://discourse.processing.org/t/accessing-class-methods/15415)

<div class="topic-metadata">

**Author:** [@Zyxon](https://discourse.processing.org/u/Zyxon)\
**Replies:** 5\
**Last updated:** [November 12, 2019, 4:38am UTC](https://discourse.processing.org/t/accessing-class-methods/15415 "2019-11-12T04:38:27Z")

</div>

Hi, I’m new to javascript so I’m not familiar with classes in javascript (I’m from Java). I declared a class like so: class Obj { constructor(name, distance, description, colour, size) { //constructor } draw() { …

---

## [How do I dictate where my link is located in the canvas?](https://discourse.processing.org/t/how-do-i-dictate-where-my-link-is-located-in-the-canvas/15352)

<div class="topic-metadata">

**Author:** [@SheCurvesMobius](https://discourse.processing.org/u/SheCurvesMobius)\
**Replies:** 9\
**Last updated:** [November 12, 2019, 12:48am UTC](https://discourse.processing.org/t/how-do-i-dictate-where-my-link-is-located-in-the-canvas/15352 "2019-11-12T00:48:27Z")

</div>

Hi all, I would like to have a clickable link in my canvas. However the help page for createA doesn’t let you know how to draw it at, say, (200, 400) on the canvas. How do I do this? I tried translate, but it doesn’t wo…

---

## [Trouble setting up p5 in Visual Studio Code](https://discourse.processing.org/t/trouble-setting-up-p5-in-visual-studio-code/1324)

<div class="topic-metadata">

**Author:** [@GiaFil7](https://discourse.processing.org/u/GiaFil7)\
**Replies:** 7\
**Last updated:** [November 11, 2019, 7:18pm UTC](https://discourse.processing.org/t/trouble-setting-up-p5-in-visual-studio-code/1324 "2019-11-11T19:18:40Z")

</div>

So I am new to HTML and Javscript, and I 'm trying to setup p5.js in VSC. I’ve installed the p5 snippets extension and my index.html file looks like this: \<html\> \<head\> \<title\>p5 Test\</title\> \<script src="https:…

---

## [CDN for 0.10.2?](https://discourse.processing.org/t/cdn-for-0-10-2/14804)

<div class="topic-metadata">

**Author:** [@donbraffitt](https://discourse.processing.org/u/donbraffitt)\
**Replies:** 3\
**Last updated:** [November 11, 2019, 6:42pm UTC](https://discourse.processing.org/t/cdn-for-0-10-2/14804 "2019-11-11T18:42:13Z")

</div>

Will there be a CDN release of 0.10.2? On the downloads page: https://p5js.org/download/ the latest CDN is still 0.9.0. Don Braffitt

---

## [P5 - Starting out music website - accessing mp3s correctly](https://discourse.processing.org/t/p5-starting-out-music-website-accessing-mp3s-correctly/15102)

<div class="topic-metadata">

**Author:** [@byxx](https://discourse.processing.org/u/byxx)\
**Replies:** 9\
**Last updated:** [November 11, 2019, 4:33pm UTC](https://discourse.processing.org/t/p5-starting-out-music-website-accessing-mp3s-correctly/15102 "2019-11-11T16:33:37Z")

</div>

Dear Community, I would like to know if I can create a homepage with lots of mp3s in P5. I don´t know if its a good idea to incorporate a Data Bank like mysql or how I could access a data bank. It is probable, that I c…

---

## [setVolume: rampTime and timeFromNow Mystery?](https://discourse.processing.org/t/setvolume-ramptime-and-timefromnow-mystery/15376)

<div class="topic-metadata">

**Author:** [@unofficial](https://discourse.processing.org/u/unofficial)\
**Replies:** 4\
**Last updated:** [November 11, 2019, 9:51am UTC](https://discourse.processing.org/t/setvolume-ramptime-and-timefromnow-mystery/15376 "2019-11-11T09:51:41Z")

</div>

Hi there I am a veteran audio engineer and novice programmer, it is humbling to understand audio so well and yet be so mystified by coding it… Anyway I was just playing around with the setVolume function and to my chagr…

---

## [Error while documentation](https://discourse.processing.org/t/error-while-documentation/14914)

<div class="topic-metadata">

**Author:** [@kll](https://discourse.processing.org/u/kll)\
**Replies:** 3\
**Last updated:** [November 10, 2019, 1:10am UTC](https://discourse.processing.org/t/error-while-documentation/14914 "2019-11-10T01:10:35Z")

</div>

want inform about a funny problem with content in a /\* documentation \*/ section of a p5.js code example: p5.js Web Editor play and see that the error only is shown with the let ( in line 18 )

---

## [Sketch is displayed twice inside my index.html page](https://discourse.processing.org/t/sketch-is-displayed-twice-inside-my-index-html-page/15335)

<div class="topic-metadata">

**Author:** [@MsMonicaAraujo](https://discourse.processing.org/u/MsMonicaAraujo)\
**Replies:** 16\
**Last updated:** [November 8, 2019, 5:46pm UTC](https://discourse.processing.org/t/sketch-is-displayed-twice-inside-my-index-html-page/15335 "2019-11-08T17:46:27Z")

</div>

Hi, I’m trying to run my sketches in a pretty simple webpage, just to show students how to put P5.js and index.html together and run it. What happens is that the canvas and its elements and behavior are created twice on …

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

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