# p5.js

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

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

**Page:** 26

---

## [Press Button to Dispaly Text on the Screen](https://discourse.processing.org/t/press-button-to-dispaly-text-on-the-screen/36591)

<div class="topic-metadata">

**Author:** [@Kitessa](https://discourse.processing.org/u/Kitessa)\
**Replies:** 1\
**Last updated:** [April 25, 2022, 8:11pm UTC](https://discourse.processing.org/t/press-button-to-dispaly-text-on-the-screen/36591 "2022-04-25T20:11:46Z")

</div>

Hi There, Just trying to make 3 buttons work in P5Js. I am trying to have some text displayed every time you press the button but I am struggling to write this piece of code that will get text displayed. Thast my code s…

---

## [\[P5\] Can I import IP camera video data?](https://discourse.processing.org/t/p5-can-i-import-ip-camera-video-data/36580)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 1\
**Last updated:** [April 25, 2022, 2:30am UTC](https://discourse.processing.org/t/p5-can-i-import-ip-camera-video-data/36580 "2022-04-25T02:30:14Z")

</div>

\[P5\] Can I import IP camera video data? Please refer to the photo above. In JAVA Mode (1) Video library (2) IP Capture library (3) VLCJVideo library It can be solved through In P5 Mode Do you have any solution…

---

## [Can't figure out logic for overlapping squares when clicked](https://discourse.processing.org/t/cant-figure-out-logic-for-overlapping-squares-when-clicked/36563)

<div class="topic-metadata">

**Author:** [@Kipe](https://discourse.processing.org/u/Kipe)\
**Replies:** 2\
**Last updated:** [April 24, 2022, 1:10am UTC](https://discourse.processing.org/t/cant-figure-out-logic-for-overlapping-squares-when-clicked/36563 "2022-04-24T01:10:52Z")

</div>

I’m having trouble figuring out how to emulate this with p5.js. My code is below. I’m able to get each box to move individually, even if they’re overlapping… But the moment I try to change the order of the boxes array th…

---

## [Find the color of a pixel](https://discourse.processing.org/t/find-the-color-of-a-pixel/36558)

<div class="topic-metadata">

**Author:** [@hermitdog](https://discourse.processing.org/u/hermitdog)\
**Replies:** 1\
**Last updated:** [April 24, 2022, 12:36am UTC](https://discourse.processing.org/t/find-the-color-of-a-pixel/36558 "2022-04-24T00:36:22Z")

</div>

\</\> button \* homework policy \* asking questions

---

## [Finding the color of a pixel](https://discourse.processing.org/t/finding-the-color-of-a-pixel/36555)

<div class="topic-metadata">

**Author:** [@hermitdog](https://discourse.processing.org/u/hermitdog)\
**Replies:** 2\
**Last updated:** [April 24, 2022, 12:06am UTC](https://discourse.processing.org/t/finding-the-color-of-a-pixel/36555 "2022-04-24T00:06:23Z")

</div>

Blockquote In previous versions of Processing, I could find the color of a pixel using get(x,y) But in P5js get(x,y) gives me something like \[146, 200 150, 255\] What I need is some way to check that the location is …

---

## [Save sketch as js-file with random params at runtime](https://discourse.processing.org/t/save-sketch-as-js-file-with-random-params-at-runtime/36542)

<div class="topic-metadata">

**Author:** [@res56](https://discourse.processing.org/u/res56)\
**Replies:** 3\
**Last updated:** [April 23, 2022, 11:55am UTC](https://discourse.processing.org/t/save-sketch-as-js-file-with-random-params-at-runtime/36542 "2022-04-23T11:55:45Z")

</div>

Hi frens, it is possible to save a sketch as javascript-file with “values” of random function at runtime? Thanks in advance, Res

---

## [How do I get trailing lines not dots?](https://discourse.processing.org/t/how-do-i-get-trailing-lines-not-dots/36522)

<div class="topic-metadata">

**Author:** [@locky.mcdonald](https://discourse.processing.org/u/locky.mcdonald)\
**Replies:** 11\
**Last updated:** [April 22, 2022, 5:09pm UTC](https://discourse.processing.org/t/how-do-i-get-trailing-lines-not-dots/36522 "2022-04-22T17:09:58Z")

</div>

\`function setup() { createCanvas(800, 800); } function draw() { background("#ffffff04"); if (mouseIsPressed) { stroke(mouseX, 0, mouseY); strokeWeight(10); smooth(); point(mouseX-5, mouseY-5, pmouseX, pmouseY ); poi…

---

## [Relative Slider position using CSS techniques](https://discourse.processing.org/t/relative-slider-position-using-css-techniques/36515)

<div class="topic-metadata">

**Author:** [@res56](https://discourse.processing.org/u/res56)\
**Replies:** 1\
**Last updated:** [April 22, 2022, 10:08am UTC](https://discourse.processing.org/t/relative-slider-position-using-css-techniques/36515 "2022-04-22T10:08:09Z")

</div>

Hi frens, it is possible to integrate a p5js-slider in react-dom structure: \<Row\> \<Col className="slider-label"\>Movement\</Col\> \<Col className="slider01"\>\*Place for p5js-slider\*\</Col\> …

---

## [Progress with g4js - a new GUI library for p5.js](https://discourse.processing.org/t/progress-with-g4js-a-new-gui-library-for-p5-js/36493)

<div class="topic-metadata">

**Author:** [@quark](https://discourse.processing.org/u/quark)\
**Replies:** 0\
**Last updated:** [April 21, 2022, 9:49am UTC](https://discourse.processing.org/t/progress-with-g4js-a-new-gui-library-for-p5-js/36493 "2022-04-21T09:49:52Z")

</div>

I know that there is another discussion about this library but its focus on compatibility and development tools. In this discussion I am interested in your thoughts about the API and functionality (e.g. controls availabl…

---

## [Converting coding challenge ‘slide-puzzle-canvas’ from p5.js to Processing (Java)](https://discourse.processing.org/t/converting-coding-challenge-slide-puzzle-canvas-from-p5-js-to-processing-java/36401)

<div class="topic-metadata">

**Author:** [@psamead](https://discourse.processing.org/u/psamead)\
**Replies:** 1\
**Last updated:** [April 19, 2022, 4:58pm UTC](https://discourse.processing.org/t/converting-coding-challenge-slide-puzzle-canvas-from-p5-js-to-processing-java/36401 "2022-04-19T16:58:50Z")

</div>

Hi my friends, I am trying to learn coding challenge Slide-Puzzle, the 'slide- puzzle-canvas" and convert p5js code to processing version. But I am struggling with the PGraphics and the copy function. Here is the code …

---

## [P5.js image not appearing](https://discourse.processing.org/t/p5-js-image-not-appearing/36435)

<div class="topic-metadata">

**Author:** [@cardgame](https://discourse.processing.org/u/cardgame)\
**Replies:** 2\
**Last updated:** [April 19, 2022, 2:15pm UTC](https://discourse.processing.org/t/p5-js-image-not-appearing/36435 "2022-04-19T14:15:23Z")

</div>

Hi, I was just following the tutorials from ml5.js and I could not see the images I don’t know why, I moved the image file to the folder which has the html.

---

## [Problem with TensorFlow load model](https://discourse.processing.org/t/problem-with-tensorflow-load-model/36390)

<div class="topic-metadata">

**Author:** [@Omri](https://discourse.processing.org/u/Omri)\
**Replies:** 4\
**Last updated:** [April 17, 2022, 7:32pm UTC](https://discourse.processing.org/t/problem-with-tensorflow-load-model/36390 "2022-04-17T19:32:25Z")

</div>

Hey, first time I’m using TensorFlow.js and I got a problem: I trained a model and saved it on my computer (2 files: JSON and bin). Now I want to load it on another sketch, but I got this error that it like didn’t load…

---

## [SVG images don't display?](https://discourse.processing.org/t/svg-images-dont-display/36288)

<div class="topic-metadata">

**Author:** [@bluemoon](https://discourse.processing.org/u/bluemoon)\
**Replies:** 3\
**Last updated:** [April 14, 2022, 12:21am UTC](https://discourse.processing.org/t/svg-images-dont-display/36288 "2022-04-14T00:21:48Z")

</div>

Hey Folks, trying to load some SVGs in the p5js - I’m not getting any errors but the images just don’t display I’m using setup code like swords = loadImage('assets/swords/Asset15.svg'); and draw code like image(swords…

---

## [How to reverse a animation loop that pulls values from an array](https://discourse.processing.org/t/how-to-reverse-a-animation-loop-that-pulls-values-from-an-array/36242)

<div class="topic-metadata">

**Author:** [@gary](https://discourse.processing.org/u/gary)\
**Replies:** 6\
**Last updated:** [April 13, 2022, 6:16pm UTC](https://discourse.processing.org/t/how-to-reverse-a-animation-loop-that-pulls-values-from-an-array/36242 "2022-04-13T18:16:21Z")

</div>

I’m having difficulty figuring out how to reverse the direction of an animated loop when it reaches the end of an array. I found an example online that creates two “states” with an additive and subtractive loop within ea…

---

## [iOS15: How to use rotationX, accelerationX](https://discourse.processing.org/t/ios15-how-to-use-rotationx-accelerationx/36278)

<div class="topic-metadata">

**Author:** [@Ingo](https://discourse.processing.org/u/Ingo)\
**Replies:** 2\
**Last updated:** [April 11, 2022, 2:34pm UTC](https://discourse.processing.org/t/ios15-how-to-use-rotationx-accelerationx/36278 "2022-04-11T14:34:29Z")

</div>

Hi, I’d like to write some webapps with my students, but the old code doesn’t work anymore, because of security reasons, I think. So found this video: https://www.youtube.com/watch?v=AbB9ayaffTc and tried it, but it doe…

---

## [P5js open MIDI file](https://discourse.processing.org/t/p5js-open-midi-file/36259)

<div class="topic-metadata">

**Author:** [@patricio1979](https://discourse.processing.org/u/patricio1979)\
**Replies:** 4\
**Last updated:** [April 10, 2022, 11:44pm UTC](https://discourse.processing.org/t/p5js-open-midi-file/36259 "2022-04-10T23:44:24Z")

</div>

Is there a way to open MIDI files in P5js? I’ve found a library but is written in typescript Tonejs Also, is there a way to integrate that typescript library with P5js?

---

## [Converting a text file into a multidimensional array of data points](https://discourse.processing.org/t/converting-a-text-file-into-a-multidimensional-array-of-data-points/36007)

<div class="topic-metadata">

**Author:** [@TheSynchronomicon](https://discourse.processing.org/u/TheSynchronomicon)\
**Replies:** 4\
**Last updated:** [April 10, 2022, 7:11pm UTC](https://discourse.processing.org/t/converting-a-text-file-into-a-multidimensional-array-of-data-points/36007 "2022-04-10T19:11:15Z")

</div>

I want to be able to convert the following array from a text file \[\[-7.5,-7.5,-5.0\], \[-2.5,-7.5,0.0\], \[2.5,-7.5,0.0\], \[7.5,-7.5,-5.0\]\], , \[\[-7.5,-2.5,-7.5\], \[-2.5,-2.5,5.0\], \[2.5,-2.5,5.0\], \[7.5,-2.5,-7.5\]\], , \[\[-7.5,…

---

## [Object attributes randomly removed?](https://discourse.processing.org/t/object-attributes-randomly-removed/36214)

<div class="topic-metadata">

**Author:** [@PrincessLeia](https://discourse.processing.org/u/PrincessLeia)\
**Replies:** 2\
**Last updated:** [April 9, 2022, 10:28pm UTC](https://discourse.processing.org/t/object-attributes-randomly-removed/36214 "2022-04-09T22:28:14Z")

</div>

Hi, so I’ve been learning the maths involved with the calculations for the reflection velocity of objects hitting uneven or circular surfaces. In this project: p5.js Web Editor I have the problem where most of my objec…

---

## [Multiple elements on one p5.Geometry()](https://discourse.processing.org/t/multiple-elements-on-one-p5-geometry/36220)

<div class="topic-metadata">

**Author:** [@zjorge](https://discourse.processing.org/u/zjorge)\
**Replies:** 5\
**Last updated:** [April 8, 2022, 8:56pm UTC](https://discourse.processing.org/t/multiple-elements-on-one-p5-geometry/36220 "2022-04-08T20:56:42Z")

</div>

I need to build procedural geometries with p5.Geometry and model() ? I’m doing ok when it is only one element but if I need more than one I can’t model() an array of Geometries or each individually on a for loop. I’m not…

---

## [Audio glitching issue with sound lib - any fix in sight?](https://discourse.processing.org/t/audio-glitching-issue-with-sound-lib-any-fix-in-sight/34446)

<div class="topic-metadata">

**Author:** [@moutcast](https://discourse.processing.org/u/moutcast)\
**Replies:** 1\
**Last updated:** [April 8, 2022, 12:51pm UTC](https://discourse.processing.org/t/audio-glitching-issue-with-sound-lib-any-fix-in-sight/34446 "2022-04-08T12:51:30Z")

</div>

hi, i was interested to use p5js to bring my sound exeriments from the analog synth world and from other digital platforms to the browser based world. but there is this audio glitching issue that i and appaerently others…

---

## [Sketch in a \<div\>](https://discourse.processing.org/t/sketch-in-a-div/36189)

<div class="topic-metadata">

**Author:** [@CheeseBread](https://discourse.processing.org/u/CheeseBread)\
**Replies:** 2\
**Last updated:** [April 8, 2022, 12:31pm UTC](https://discourse.processing.org/t/sketch-in-a-div/36189 "2022-04-08T12:31:52Z")

</div>

hello, I need to put my sketch (voxel\_view\_canvas3.js) in a div (id=“canvas\_voxel\_colors”) where is write CANVAS, but the sketch doesn’t show. What am I doing wrong? link to the project (p5.js Web Editor)

---

## [How to remove a sketch](https://discourse.processing.org/t/how-to-remove-a-sketch/36164)

<div class="topic-metadata">

**Author:** [@MPROCD](https://discourse.processing.org/u/MPROCD)\
**Replies:** 3\
**Last updated:** [April 7, 2022, 8:23am UTC](https://discourse.processing.org/t/how-to-remove-a-sketch/36164 "2022-04-07T08:23:33Z")

</div>

Hello I am new to the open processing with p5.js. I wrote several sketches about the same topic and I want to remove part of them. How do I delete a sketch in that environment? Thanks

---

## [Editor.p5js.org - login currently impossible?](https://discourse.processing.org/t/editor-p5js-org-login-currently-impossible/36135)

<div class="topic-metadata">

**Author:** [@Laurent](https://discourse.processing.org/u/Laurent)\
**Replies:** 2\
**Last updated:** [April 5, 2022, 4:47pm UTC](https://discourse.processing.org/t/editor-p5js-org-login-currently-impossible/36135 "2022-04-05T16:47:05Z")

</div>

Hi everyone I don’t know if it’s a local network problem but about 30’ ago my students were no more able to save their projects (sketchs) into https://editor.p5js.org. They had login at the begining of the lesson and at…

---

## [P5.js code without stringbuilder](https://discourse.processing.org/t/p5-js-code-without-stringbuilder/36084)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 6\
**Last updated:** [April 5, 2022, 1:51pm UTC](https://discourse.processing.org/t/p5-js-code-without-stringbuilder/36084 "2022-04-05T13:51:29Z")

</div>

how do I rewrite this code without string builder? function setup() { createCanvas(600,600); initializeFields(); var n = 20; } function getAlphaNumericString(n) { // chose a Character random from this St…

---

## [Converting a boundaries function with applyForce from .pde to .p5](https://discourse.processing.org/t/converting-a-boundaries-function-with-applyforce-from-pde-to-p5/35984)

<div class="topic-metadata">

**Author:** [@ZizoMass](https://discourse.processing.org/u/ZizoMass)\
**Replies:** 6\
**Last updated:** [April 4, 2022, 3:27pm UTC](https://discourse.processing.org/t/converting-a-boundaries-function-with-applyforce-from-pde-to-p5/35984 "2022-04-04T15:27:42Z")

</div>

Hi, guys I’m converting an old project that I had done in processing, and I’m having a lot of difficulties converting this function. The function makes a game object float within a pre-limited area, changing the moveme…

---

## [Disable pinch zoom on mobile](https://discourse.processing.org/t/disable-pinch-zoom-on-mobile/36100)

<div class="topic-metadata">

**Author:** [@tristan1](https://discourse.processing.org/u/tristan1)\
**Replies:** 2\
**Last updated:** [April 4, 2022, 11:13am UTC](https://discourse.processing.org/t/disable-pinch-zoom-on-mobile/36100 "2022-04-04T11:13:49Z")

</div>

Hey everyone, I am creating a litte pingpong game with multiple touch so that two player can play with each other on mobile device. While playing the two touches trigger zooming in and out the screen, which strongly …

---

## [Change LIVE capture animation to a gif/moving animation](https://discourse.processing.org/t/change-live-capture-animation-to-a-gif-moving-animation/36102)

<div class="topic-metadata">

**Author:** [@drnturtle](https://discourse.processing.org/u/drnturtle)\
**Replies:** 0\
**Last updated:** [April 4, 2022, 4:14am UTC](https://discourse.processing.org/t/change-live-capture-animation-to-a-gif-moving-animation/36102 "2022-04-04T04:14:52Z")

</div>

So lately I have done some exploration on the camera delay sort of effect on P5.js, and I just couldn’t wrap my head around something— When I try to replace the img source from “createCapture(VIDEO)” to "loadImage(‘XXXX.…

---

## [Firebase in P5JS](https://discourse.processing.org/t/firebase-in-p5js/36080)

<div class="topic-metadata">

**Author:** [@Omri](https://discourse.processing.org/u/Omri)\
**Replies:** 0\
**Last updated:** [April 2, 2022, 3:44pm UTC](https://discourse.processing.org/t/firebase-in-p5js/36080 "2022-04-02T15:44:10Z")

</div>

Hey there, I want to use firebase in my project and I follow Shiffman’s project to do so, but I think the firebase configuration has changed… in Shiffman’s HTML he wrote: \<script src="https://www.gstatic.com/firebasej…

---

## [Uncaught ReferenceError: createRadio is not defined](https://discourse.processing.org/t/uncaught-referenceerror-createradio-is-not-defined/36075)

<div class="topic-metadata">

**Author:** [@Omri](https://discourse.processing.org/u/Omri)\
**Replies:** 4\
**Last updated:** [April 2, 2022, 1:00pm UTC](https://discourse.processing.org/t/uncaught-referenceerror-createradio-is-not-defined/36075 "2022-04-02T13:00:26Z")

</div>

Hey, I’m trying to use the createRadio() function, but I get this error: Uncaught ReferenceError: createRadio is not defined at setup (p5js-temp-sketch\_220402a1584838079584472986.js:4:3) at m.\<anonymous\> (p5.min…

---

## [Loading objs with callbacks](https://discourse.processing.org/t/loading-objs-with-callbacks/36066)

<div class="topic-metadata">

**Author:** [@Damdada](https://discourse.processing.org/u/Damdada)\
**Replies:** 2\
**Last updated:** [April 1, 2022, 7:40pm UTC](https://discourse.processing.org/t/loading-objs-with-callbacks/36066 "2022-04-01T19:40:05Z")

</div>

Hi, im trying to load multiple OBJs and Images with callbacks into my sketch. The loading works fine but the Problem is that the Images and OBJs order is diffrent evreytime i load the sketch. So the images i take for th…

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

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