# p5.js

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

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

**Page:** 77

---

## [Organising a single canvas-long code in instance mode](https://discourse.processing.org/t/organising-a-single-canvas-long-code-in-instance-mode/18779)

<div class="topic-metadata">

**Author:** [@calornorte](https://discourse.processing.org/u/calornorte)\
**Replies:** 0\
**Last updated:** [March 18, 2020, 11:40pm UTC](https://discourse.processing.org/t/organising-a-single-canvas-long-code-in-instance-mode/18779 "2020-03-18T23:40:57Z")

</div>

I’m writing a very long code for a single canvas in instance mode and it’s getting confusing, specially the draw area. how can I organise an instance mode code in different sketches (for a single canvas) considering its…

---

## [blendMode() behaves differently in Chrome vs Firefox](https://discourse.processing.org/t/blendmode-behaves-differently-in-chrome-vs-firefox/18590)

<div class="topic-metadata">

**Author:** [@hellonearthis](https://discourse.processing.org/u/hellonearthis)\
**Replies:** 1\
**Last updated:** [March 17, 2020, 6:16pm UTC](https://discourse.processing.org/t/blendmode-behaves-differently-in-chrome-vs-firefox/18590 "2020-03-17T18:16:45Z")

</div>

I’ve been playing around with blendmode() and found it seems to behave different in chrome vs firefox. Is this a browser thing or a p5 bug? I’m using latest versions of the browser and win 10 pro. Tried it on my deskt…

---

## [How can i use raw signal data for p5.fft?](https://discourse.processing.org/t/how-can-i-use-raw-signal-data-for-p5-fft/18724)

<div class="topic-metadata">

**Author:** [@PoltHoliC](https://discourse.processing.org/u/PoltHoliC)\
**Replies:** 0\
**Last updated:** [March 17, 2020, 2:54am UTC](https://discourse.processing.org/t/how-can-i-use-raw-signal-data-for-p5-fft/18724 "2020-03-17T02:54:33Z")

</div>

Recently i used p5 for signal processing on web. what I am doing now is get data from my Data Acquisition Embedded Device and send the raw data(actually python list) to web. and i want to process fft on web. but most…

---

## [WEBGL cylinder between two points](https://discourse.processing.org/t/webgl-cylinder-between-two-points/13806)

<div class="topic-metadata">

**Author:** [@AshaSato](https://discourse.processing.org/u/AshaSato)\
**Replies:** 9\
**Last updated:** [March 15, 2020, 10:23pm UTC](https://discourse.processing.org/t/webgl-cylinder-between-two-points/13806 "2020-03-15T22:23:07Z")

</div>

Hi there! The 3D primitive cylinder function draws a cylinder from its midpoint. I am trying to write a function that will enable me to draw a cylinder between two specified points. My approach so far has been to find …

---

## [Development of a new design and user-interface for the website](https://discourse.processing.org/t/development-of-a-new-design-and-user-interface-for-the-website/18688)

<div class="topic-metadata">

**Author:** [@codengame](https://discourse.processing.org/u/codengame)\
**Replies:** 0\
**Last updated:** [March 15, 2020, 7:23pm UTC](https://discourse.processing.org/t/development-of-a-new-design-and-user-interface-for-the-website/18688 "2020-03-15T19:23:17Z")

</div>

I was planning to try out some Bootstrap features to improve the appearance of the pages. The showcase page can be modified to match the type of content it holds. I can work on a new design of the specific pages to impr…

---

## [Unable to find the Language buttons handlebar](https://discourse.processing.org/t/unable-to-find-the-language-buttons-handlebar/18673)

<div class="topic-metadata">

**Author:** [@codengame](https://discourse.processing.org/u/codengame)\
**Replies:** 0\
**Last updated:** [March 15, 2020, 9:45am UTC](https://discourse.processing.org/t/unable-to-find-the-language-buttons-handlebar/18673 "2020-03-15T09:45:57Z")

</div>

I want to edit the Language buttons to make a drop-down menu but I am unable to find the HTML code for the language buttons on Github. In default.hsb there is a handlebar call {{\>i18n}} which calls the language buttons.…

---

## [K12 Education Support](https://discourse.processing.org/t/k12-education-support/14486)

<div class="topic-metadata">

**Author:** [@tanhengyeow](https://discourse.processing.org/u/tanhengyeow)\
**Replies:** 1\
**Last updated:** [March 11, 2020, 6:45pm UTC](https://discourse.processing.org/t/k12-education-support/14486 "2020-03-11T18:45:11Z")

</div>

Hi everyone! I read the developer roadmap here, https://github.com/processing/p5.js/blob/master/developer\_docs/roadmap.md and realized there are some initiatives planned for K12 support. K12 education and empowering ki…

---

## [I need help changing values in an array](https://discourse.processing.org/t/i-need-help-changing-values-in-an-array/18586)

<div class="topic-metadata">

**Author:** [@Ricochet1451](https://discourse.processing.org/u/Ricochet1451)\
**Replies:** 2\
**Last updated:** [March 11, 2020, 4:01pm UTC](https://discourse.processing.org/t/i-need-help-changing-values-in-an-array/18586 "2020-03-11T16:01:39Z")

</div>

I am currently trying to make a chess game. But i am having some issues changing values. If you look on line 214 of sketch, i am trying to set the pawn to the upper right to “available”, but it wont let me change the val…

---

## [Having problems with buttons/sound on cellphone](https://discourse.processing.org/t/having-problems-with-buttons-sound-on-cellphone/18579)

<div class="topic-metadata">

**Author:** [@KatGreen](https://discourse.processing.org/u/KatGreen)\
**Replies:** 1\
**Last updated:** [March 11, 2020, 4:38am UTC](https://discourse.processing.org/t/having-problems-with-buttons-sound-on-cellphone/18579 "2020-03-11T04:38:59Z")

</div>

Hello everyone, fist timer here so sorry if I am making a mess of this post: I’ve created this really simple page with three buttons: track 1, track 2 and STOP. Track 1 - plays track 1 (and stops track 2 if it’s playin…

---

## [Autocomplete code from IDE](https://discourse.processing.org/t/autocomplete-code-from-ide/18483)

<div class="topic-metadata">

**Author:** [@JPatagonico](https://discourse.processing.org/u/JPatagonico)\
**Replies:** 5\
**Last updated:** [March 9, 2020, 6:10pm UTC](https://discourse.processing.org/t/autocomplete-code-from-ide/18483 "2020-03-09T18:10:28Z")

</div>

Hi, I activated the autocomplete option from the IDE preferences. Autocomplete using ctrl + space is not working. How does code autocomplete work? I performed tests with Java and P5.js and in both cases it did not wor…

---

## [Scale canvas in web editor](https://discourse.processing.org/t/scale-canvas-in-web-editor/18411)

<div class="topic-metadata">

**Author:** [@1igor](https://discourse.processing.org/u/1igor)\
**Replies:** 7\
**Last updated:** [March 8, 2020, 9:21pm UTC](https://discourse.processing.org/t/scale-canvas-in-web-editor/18411 "2020-03-08T21:21:11Z")

</div>

Hi! I have a big canvas which doesn’t fit in my screen with editor. Can I somehow change its scale so I could see it whole without zooming out the whole page?

---

## [How to create two canvases to run separate WebGL app](https://discourse.processing.org/t/how-to-create-two-canvases-to-run-separate-webgl-app/18304)

<div class="topic-metadata">

**Author:** [@zyhllr](https://discourse.processing.org/u/zyhllr)\
**Replies:** 2\
**Last updated:** [March 6, 2020, 7:48pm UTC](https://discourse.processing.org/t/how-to-create-two-canvases-to-run-separate-webgl-app/18304 "2020-03-06T19:48:45Z")

</div>

How to create two cnavas to run separate WebGL app

---

## [Signup new account using caps in name on https://editor.p5js.org](https://discourse.processing.org/t/signup-new-account-using-caps-in-name-on-https-editor-p5js-org/18427)

<div class="topic-metadata">

**Author:** [@podryna](https://discourse.processing.org/u/podryna)\
**Replies:** 3\
**Last updated:** [March 6, 2020, 7:43pm UTC](https://discourse.processing.org/t/signup-new-account-using-caps-in-name-on-https-editor-p5js-org/18427 "2020-03-06T19:43:47Z")

</div>

It seems we are hitting a possible bug related to having caps in the login name. For example signup with: Login name: GeorgeZ Password: 123456 Email: \<a valid email address\> Note; These are all fake for testing purpos…

---

## [Shared library for simple functions](https://discourse.processing.org/t/shared-library-for-simple-functions/18374)

<div class="topic-metadata">

**Author:** [@podryna](https://discourse.processing.org/u/podryna)\
**Replies:** 13\
**Last updated:** [March 6, 2020, 7:17pm UTC](https://discourse.processing.org/t/shared-library-for-simple-functions/18374 "2020-03-06T19:17:40Z")

</div>

Hi, I’m trying to create a simple library of functions that can be used by elementary school students to do some coding. The first function is one that draws a grid on the canvas with simple coordinate labels. These stud…

---

## [Matterjs with posenet in p5js](https://discourse.processing.org/t/matterjs-with-posenet-in-p5js/18454)

<div class="topic-metadata">

**Author:** [@l3ehfar](https://discourse.processing.org/u/l3ehfar)\
**Replies:** 0\
**Last updated:** [March 6, 2020, 6:32pm UTC](https://discourse.processing.org/t/matterjs-with-posenet-in-p5js/18454 "2020-03-06T18:32:45Z")

</div>

Is there anyone have any idea, guidance, tutorial etc. to use posenet (ml5.js) to interact with matter.js bodies in p5.js?

---

## [Text input values don't seem to be working](https://discourse.processing.org/t/text-input-values-dont-seem-to-be-working/18337)

<div class="topic-metadata">

**Author:** [@Pixelfixation](https://discourse.processing.org/u/Pixelfixation)\
**Replies:** 5\
**Last updated:** [March 6, 2020, 6:09pm UTC](https://discourse.processing.org/t/text-input-values-dont-seem-to-be-working/18337 "2020-03-06T18:09:52Z")

</div>

I have this sketch I have been working on. https://editor.p5js.org/pixelfixation/sketches/o8UMGxdk I am working on the input boxes under the sketch. On lines 81-88 i am setting up the inputs and on 118 thru 133 i am wo…

---

## [Click event on 3D primitive](https://discourse.processing.org/t/click-event-on-3d-primitive/18426)

<div class="topic-metadata">

**Author:** [@samWolf](https://discourse.processing.org/u/samWolf)\
**Replies:** 4\
**Last updated:** [March 5, 2020, 6:14pm UTC](https://discourse.processing.org/t/click-event-on-3d-primitive/18426 "2020-03-05T18:14:28Z")

</div>

Hey all, any idea how to fire an event when a 3D primitive is clicked. In my case, I’m trying to click on a rotating box and link to another html page. Please help meeh. let cnv; let brand; let clientH; let clientW; le…

---

## [P5.sound.js with p5.svg.js](https://discourse.processing.org/t/p5-sound-js-with-p5-svg-js/18382)

<div class="topic-metadata">

**Author:** [@everyman](https://discourse.processing.org/u/everyman)\
**Replies:** 2\
**Last updated:** [March 5, 2020, 2:48pm UTC](https://discourse.processing.org/t/p5-sound-js-with-p5-svg-js/18382 "2020-03-05T14:48:48Z")

</div>

Hello. I’ve been using the p5.svg.js library that I downloaded from here: https://github.com/zenozeng/p5.js-svg/releases with a compatible version of p5.js that was supplied. I’d like to now use the p5.sound.js library …

---

## [Reset frameRate()](https://discourse.processing.org/t/reset-framerate/18359)

<div class="topic-metadata">

**Author:** [@Mamboleoo](https://discourse.processing.org/u/Mamboleoo)\
**Replies:** 9\
**Last updated:** [March 5, 2020, 10:04am UTC](https://discourse.processing.org/t/reset-framerate/18359 "2020-03-05T10:04:13Z")

</div>

Hey there, I’m having a demo where I need the frameRate to be set to 5. But later on the demo I need to reset the frameRate to the default one. I don’t want to set a fixed value frameRate(30) as I want my frameRate to…

---

## [Mobile functionality not working](https://discourse.processing.org/t/mobile-functionality-not-working/18362)

<div class="topic-metadata">

**Author:** [@SheCurvesMobius](https://discourse.processing.org/u/SheCurvesMobius)\
**Replies:** 1\
**Last updated:** [March 5, 2020, 9:22am UTC](https://discourse.processing.org/t/mobile-functionality-not-working/18362 "2020-03-05T09:22:19Z")

</div>

Hi all, I’m interested in starting to use the mobile functionality with p5, but when I check the examples on their site: https://p5js.org/examples/mobile-tilted-3d-box.html https://p5js.org/examples/mobile-acceleratio…

---

## [P5.js tables saveTable](https://discourse.processing.org/t/p5-js-tables-savetable/18341)

<div class="topic-metadata">

**Author:** [@ctrembla](https://discourse.processing.org/u/ctrembla)\
**Replies:** 16\
**Last updated:** [March 3, 2020, 6:14pm UTC](https://discourse.processing.org/t/p5-js-tables-savetable/18341 "2020-03-03T18:14:47Z")

</div>

I’m trying to save my highscore when my player dies but instead of saving it to the file it got the info from. It creates a new file and send it download. Why is it doing that? & how can I get it to save the file to the …

---

## [Enemy x keeps equaling nan](https://discourse.processing.org/t/enemy-x-keeps-equaling-nan/18302)

<div class="topic-metadata">

**Author:** [@ctrembla](https://discourse.processing.org/u/ctrembla)\
**Replies:** 6\
**Last updated:** [March 2, 2020, 10:46pm UTC](https://discourse.processing.org/t/enemy-x-keeps-equaling-nan/18302 "2020-03-02T22:46:54Z")

</div>

I’m trying to create a tower defense game, but atm my enemy keeps vanishing & it’s x keeps showing up nan. Can anyone tell me why? sketch.js var wall = \[35\]; var bs = 25; var enemy; function preload(){ wallT = loadT…

---

## [Give randomly generated objects a destination rather than a velocity?](https://discourse.processing.org/t/give-randomly-generated-objects-a-destination-rather-than-a-velocity/18260)

<div class="topic-metadata">

**Author:** [@wavyboneee](https://discourse.processing.org/u/wavyboneee)\
**Replies:** 5\
**Last updated:** [March 2, 2020, 12:51pm UTC](https://discourse.processing.org/t/give-randomly-generated-objects-a-destination-rather-than-a-velocity/18260 "2020-03-02T12:51:58Z")

</div>

I’m new to coding so this might sound very stupid but any help would be great. I know how to increment x and y values to create object movement, and am in the process of learning how to do this using vectors, however I …

---

## [Rotating an object need to know the position of the points globally](https://discourse.processing.org/t/rotating-an-object-need-to-know-the-position-of-the-points-globally/18270)

<div class="topic-metadata">

**Author:** [@Pixelfixation](https://discourse.processing.org/u/Pixelfixation)\
**Replies:** 4\
**Last updated:** [March 1, 2020, 8:51pm UTC](https://discourse.processing.org/t/rotating-an-object-need-to-know-the-position-of-the-points-globally/18270 "2020-03-01T20:51:54Z")

</div>

Hey! I am making a simulation for my calc 1 professor. He wants a simulation of a ferris wheel where I can check the positions of the passengers on the Y axis at different points in time during the rotations. What I need…

---

## [Problem with pulling values from array of colours, strings](https://discourse.processing.org/t/problem-with-pulling-values-from-array-of-colours-strings/18267)

<div class="topic-metadata">

**Author:** [@leobrooks](https://discourse.processing.org/u/leobrooks)\
**Replies:** 9\
**Last updated:** [March 1, 2020, 7:18pm UTC](https://discourse.processing.org/t/problem-with-pulling-values-from-array-of-colours-strings/18267 "2020-03-01T19:18:45Z")

</div>

Hello, I’ve extracted my problem from a larger sketch, but the main problem is here. When I run this, the colours and letters appear alright, but I get this error: Uncaught Error: \[object Arguments\]is not a valid colo…

---

## [Making a circle disappear when clicked on](https://discourse.processing.org/t/making-a-circle-disappear-when-clicked-on/18239)

<div class="topic-metadata">

**Author:** [@meh](https://discourse.processing.org/u/meh)\
**Replies:** 6\
**Last updated:** [March 1, 2020, 5:03pm UTC](https://discourse.processing.org/t/making-a-circle-disappear-when-clicked-on/18239 "2020-03-01T17:03:16Z")

</div>

I have some experience with java but I am new to p5js. I created a game with circles falling down and you gain 1 point every time you click on a circle, also when a circle reaches the bottom of the screen you lose a life…

---

## [Manually calculate "p5.vector.fromAngle?"](https://discourse.processing.org/t/manually-calculate-p5-vector-fromangle/18252)

<div class="topic-metadata">

**Author:** [@commie630](https://discourse.processing.org/u/commie630)\
**Replies:** 1\
**Last updated:** [March 1, 2020, 10:03am UTC](https://discourse.processing.org/t/manually-calculate-p5-vector-fromangle/18252 "2020-03-01T10:03:23Z")

</div>

Broad question, but how can I manually calculate a vector from an angle/radian as opposed to using p5.vector.fromAngle? (platform agonistic)

---

## [Translation contribution](https://discourse.processing.org/t/translation-contribution/18261)

<div class="topic-metadata">

**Author:** [@phe0](https://discourse.processing.org/u/phe0)\
**Replies:** 1\
**Last updated:** [March 1, 2020, 2:00am UTC](https://discourse.processing.org/t/translation-contribution/18261 "2020-03-01T02:00:41Z")

</div>

Hello, I’ve been working on the translation of the p5.js website to portuguese, but I did not understand how to the reference section should work, it doesn’t have an english json file, but it has an es.json file, the pa…

---

## [Distance between randomly spawned objects](https://discourse.processing.org/t/distance-between-randomly-spawned-objects/18026)

<div class="topic-metadata">

**Author:** [@Kothal](https://discourse.processing.org/u/Kothal)\
**Replies:** 6\
**Last updated:** [February 29, 2020, 9:10pm UTC](https://discourse.processing.org/t/distance-between-randomly-spawned-objects/18026 "2020-02-29T21:10:29Z")

</div>

I’m a beginner who just started out learning js and p5. I started working on making my own game from scratch, it’s actually a replica of the chrome dino game, I managed to do everything I wanted to and I’m almost finishe…

---

## [How do i change the circle's color when the mouse hovers over it?](https://discourse.processing.org/t/how-do-i-change-the-circles-color-when-the-mouse-hovers-over-it/18226)

<div class="topic-metadata">

**Author:** [@cesca](https://discourse.processing.org/u/cesca)\
**Replies:** 6\
**Last updated:** [February 29, 2020, 8:30pm UTC](https://discourse.processing.org/t/how-do-i-change-the-circles-color-when-the-mouse-hovers-over-it/18226 "2020-02-29T20:30:46Z")

</div>

I am super, super new to this so pls assume i know nothing: I adapted this code from a Daniel Shiffman tutorial. I know i have to use the dist function to compare mouseY, mouseX and the circle’s radius but idk how to wri…

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

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