# p5.js

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

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

**Page:** 93

---

## [So close... how to display images from RSS](https://discourse.processing.org/t/so-close-how-to-display-images-from-rss/11750)

<div class="topic-metadata">

**Author:** [@Artie\_veirkant\_sux](https://discourse.processing.org/u/Artie_veirkant_sux)\
**Replies:** 0\
**Last updated:** [May 31, 2019, 11:36pm UTC](https://discourse.processing.org/t/so-close-how-to-display-images-from-rss/11750 "2019-05-31T23:36:29Z")

</div>

Hey again, Returning after some code tweaks, I still can’t get images to display from RSS. I’ve significantly refactored my code and have successfully created a tool for grabbing and loading images. The problem arises w…

---

## [Getting rid of input boxes later on / "encrypting passwords"](https://discourse.processing.org/t/getting-rid-of-input-boxes-later-on-encrypting-passwords/11709)

<div class="topic-metadata">

**Author:** [@CodeTime](https://discourse.processing.org/u/CodeTime)\
**Replies:** 4\
**Last updated:** [May 31, 2019, 1:53pm UTC](https://discourse.processing.org/t/getting-rid-of-input-boxes-later-on-encrypting-passwords/11709 "2019-05-31T13:53:36Z")

</div>

So I am trying to make a facebook imitation for practice. I was able to make the full front page, where you can sign up and log in and everything. My problem right now is that the input boxes do not disappear when you go…

---

## [Animating lines with 3 different positions](https://discourse.processing.org/t/animating-lines-with-3-different-positions/11731)

<div class="topic-metadata">

**Author:** [@antoniofrom1984](https://discourse.processing.org/u/antoniofrom1984)\
**Replies:** 1\
**Last updated:** [May 31, 2019, 1:45pm UTC](https://discourse.processing.org/t/animating-lines-with-3-different-positions/11731 "2019-05-31T13:45:07Z")

</div>

https://editor.p5js.org/antoniofrom1984/sketches/8n9le2Wvh In my project i have 2 lines. Each line changes position when you click on the screen. The position of each line always falls randomly in thirds of the screen…

---

## [Save canvas image to a variable \[p5.js\]](https://discourse.processing.org/t/save-canvas-image-to-a-variable-p5-js/11657)

<div class="topic-metadata">

**Author:** [@josebv](https://discourse.processing.org/u/josebv)\
**Replies:** 2\
**Last updated:** [May 30, 2019, 5:45pm UTC](https://discourse.processing.org/t/save-canvas-image-to-a-variable-p5-js/11657 "2019-05-30T17:45:47Z")

</div>

Hey, I’m trying to save a canvas image to variable, because later y want to push that variable into a an array, that at end of the loop goes to a database. I know that: saveCanvas(canvas, name,".png") downloads an im…

---

## [Create mulitple ''pages'' in p5.js](https://discourse.processing.org/t/create-mulitple-pages-in-p5-js/11471)

<div class="topic-metadata">

**Author:** [@maxah999](https://discourse.processing.org/u/maxah999)\
**Replies:** 11\
**Last updated:** [May 30, 2019, 4:22pm UTC](https://discourse.processing.org/t/create-mulitple-pages-in-p5-js/11471 "2019-05-30T16:22:27Z")

</div>

Hi there ! I’m trying to recode the game found in https://www.humanbenchmark.com/tests/reactiontime for a project. I tried multiple things but i’m a slow learner when it comes to code, and i’m trying to create it one sl…

---

## [Generate one random number](https://discourse.processing.org/t/generate-one-random-number/11707)

<div class="topic-metadata">

**Author:** [@l3ehfar](https://discourse.processing.org/u/l3ehfar)\
**Replies:** 5\
**Last updated:** [May 30, 2019, 11:33am UTC](https://discourse.processing.org/t/generate-one-random-number/11707 "2019-05-30T11:33:47Z")

</div>

how can I generate only one random number per 200 frameCount? my code does produce many random numbers per 200 frameCount but I want it to repeat only once.

---

## [How to create small increment in random number](https://discourse.processing.org/t/how-to-create-small-increment-in-random-number/11669)

<div class="topic-metadata">

**Author:** [@noob](https://discourse.processing.org/u/noob)\
**Replies:** 9\
**Last updated:** [May 30, 2019, 3:10am UTC](https://discourse.processing.org/t/how-to-create-small-increment-in-random-number/11669 "2019-05-30T03:10:55Z")

</div>

Hi All I have been stuck this problem for few days. Couldn’t figure it out how create small increment in random number. This is my code: var jitter; function setup() { createCanvas(400, 400); background(220); s…

---

## [How to draw text that follows scale and translations? GUI?](https://discourse.processing.org/t/how-to-draw-text-that-follows-scale-and-translations-gui/11683)

<div class="topic-metadata">

**Author:** [@oOoOoO](https://discourse.processing.org/u/oOoOoO)\
**Replies:** 2\
**Last updated:** [May 29, 2019, 4:35pm UTC](https://discourse.processing.org/t/how-to-draw-text-that-follows-scale-and-translations-gui/11683 "2019-05-29T16:35:49Z")

</div>

I want to draw a highscore table over my game, but I am constantly scaling and translating the canvas, so it wont stay where I want it to. How do I create a GUI type thing that will stay in the top right corner of the sc…

---

## [loadFont is not working](https://discourse.processing.org/t/loadfont-is-not-working/10146)

<div class="topic-metadata">

**Author:** [@baisampayans](https://discourse.processing.org/u/baisampayans)\
**Replies:** 9\
**Last updated:** [May 29, 2019, 10:17am UTC](https://discourse.processing.org/t/loadfont-is-not-working/10146 "2019-05-29T10:17:59Z")

</div>

Hi All, I am using react-p5-wrapper npm module to use p5 sketches inside my react based portfolio site. While it works pretty fine, I got stuck in loadFonts. As per the example and documentation, in preload function l…

---

## [Steps to nodes again](https://discourse.processing.org/t/steps-to-nodes-again/11619)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 1\
**Last updated:** [May 28, 2019, 5:19pm UTC](https://discourse.processing.org/t/steps-to-nodes-again/11619 "2019-05-28T17:19:36Z")

</div>

https://editor.p5js.org/paulgoux/sketches/eiY8BkMUm So I’m trying to calculate the steps in between each node, and this is working seemingly ok, however some will be out by about 1-5 steps. I don’t understand whats caus…

---

## [Device events doesn't work anymore](https://discourse.processing.org/t/device-events-doesnt-work-anymore/11649)

<div class="topic-metadata">

**Author:** [@Ingo](https://discourse.processing.org/u/Ingo)\
**Replies:** 0\
**Last updated:** [May 28, 2019, 5:38am UTC](https://discourse.processing.org/t/device-events-doesnt-work-anymore/11649 "2019-05-28T05:38:37Z")

</div>

Hi there, I started yesterday to develop a game for iOS and had to realize that it isn’t possible anymore to use the mobile orientations like accelerationX, rotateX or deviceoriention: http://ingo-bartling.de/planks/ . …

---

## [P5 js 3D texture not loaded on iOS](https://discourse.processing.org/t/p5-js-3d-texture-not-loaded-on-ios/11562)

<div class="topic-metadata">

**Author:** [@jinbread](https://discourse.processing.org/u/jinbread)\
**Replies:** 1\
**Last updated:** [May 26, 2019, 2:40pm UTC](https://discourse.processing.org/t/p5-js-3d-texture-not-loaded-on-ios/11562 "2019-05-26T14:40:40Z")

</div>

Hi, I am trying to make the code below on web and mobile. As you can see, the web seems to be fine, but when I try to open it on the mobile, it shows nothing. I assume, there is some problem with loading texture, but n…

---

## [HELP: playMode('sustain') is not working](https://discourse.processing.org/t/help-playmode-sustain-is-not-working/11565)

<div class="topic-metadata">

**Author:** [@Carpece](https://discourse.processing.org/u/Carpece)\
**Replies:** 1\
**Last updated:** [May 26, 2019, 5:20am UTC](https://discourse.processing.org/t/help-playmode-sustain-is-not-working/11565 "2019-05-26T05:20:12Z")

</div>

Hi to all… here’s my code. I can’t figure out why playMode(‘sustain’) is not working… I’ve point to it inside a conditional and maybe could be the problem but I don’t find the solution. https://editor.p5js.org/carpece/s…

---

## [Beginner needing help with coding sketch](https://discourse.processing.org/t/beginner-needing-help-with-coding-sketch/11533)

<div class="topic-metadata">

**Author:** [@kelsierose94](https://discourse.processing.org/u/kelsierose94)\
**Replies:** 6\
**Last updated:** [May 26, 2019, 4:19am UTC](https://discourse.processing.org/t/beginner-needing-help-with-coding-sketch/11533 "2019-05-26T04:19:41Z")

</div>

Hi everyone! I’m a beginner coder (as in, learnt a few months ago) and a project I’m working on requires me to make a mini game. Here is what I have: https://editor.p5js.org/kelsierose94/sketches/ha9-e5FAw the yellow …

---

## [Play p5.js not an importable libraries in Processing IDE?](https://discourse.processing.org/t/play-p5-js-not-an-importable-libraries-in-processing-ide/11538)

<div class="topic-metadata">

**Author:** [@Laurent](https://discourse.processing.org/u/Laurent)\
**Replies:** 2\
**Last updated:** [May 25, 2019, 4:51pm UTC](https://discourse.processing.org/t/play-p5-js-not-an-importable-libraries-in-processing-ide/11538 "2019-05-25T16:51:04Z")

</div>

Hi everyone, Does anyone know why the Play p5.js (http://molleindustria.github.io/p5.play/) is not avalaible from the ‘Import libraries’ command of Procesing IDE, while there are many others? Is it “safe” to use it or d…

---

## [Processing.js vs p5.js](https://discourse.processing.org/t/processing-js-vs-p5-js/11521)

<div class="topic-metadata">

**Author:** [@schmittmachine](https://discourse.processing.org/u/schmittmachine)\
**Replies:** 1\
**Last updated:** [May 25, 2019, 3:49pm UTC](https://discourse.processing.org/t/processing-js-vs-p5-js/11521 "2019-05-25T15:49:59Z")

</div>

Sorry if this was already discussed here (I didn’t find any reference to it though), but I really miss the now stalled processing.js project. The main reason being that it was more compatible with the processing languag…

---

## [Adding files in p5.js editor changes?](https://discourse.processing.org/t/adding-files-in-p5-js-editor-changes/11555)

<div class="topic-metadata">

**Author:** [@KevinFS](https://discourse.processing.org/u/KevinFS)\
**Replies:** 2\
**Last updated:** [May 25, 2019, 11:30am UTC](https://discourse.processing.org/t/adding-files-in-p5-js-editor-changes/11555 "2019-05-25T11:30:04Z")

</div>

Yesterday I could add image files to the p5.js online editor via a drag and drop menu from the “sktetch” menu. Today, no more drag and drop…what’s up?

---

## [Get data from ultrasonic sensor hc-sr04 on Raspberry Pi](https://discourse.processing.org/t/get-data-from-ultrasonic-sensor-hc-sr04-on-raspberry-pi/11478)

<div class="topic-metadata">

**Author:** [@petemanzel](https://discourse.processing.org/u/petemanzel)\
**Replies:** 1\
**Last updated:** [May 24, 2019, 2:12pm UTC](https://discourse.processing.org/t/get-data-from-ultrasonic-sensor-hc-sr04-on-raspberry-pi/11478 "2019-05-24T14:12:45Z")

</div>

Hello, i intend to visualize realtime sensor data from an ultrasonic sensor (hc-sr04) on an Raspberry Pi with p5.js. How can i read in the data? Thanks!

---

## [Square is not defined (?)](https://discourse.processing.org/t/square-is-not-defined/11536)

<div class="topic-metadata">

**Author:** [@Laurent](https://discourse.processing.org/u/Laurent)\
**Replies:** 1\
**Last updated:** [May 24, 2019, 9:09am UTC](https://discourse.processing.org/t/square-is-not-defined/11536 "2019-05-24T09:09:56Z")

</div>

Hi everyone, Sorry for this very basic question, but I’ve got the following error when using the square() function of p5.js, even if using the rect() function instead works very well : Uncaught ReferenceError: square i…

---

## [How to give suggestions in input box?](https://discourse.processing.org/t/how-to-give-suggestions-in-input-box/11492)

<div class="topic-metadata">

**Author:** [@CodeTime](https://discourse.processing.org/u/CodeTime)\
**Replies:** 3\
**Last updated:** [May 22, 2019, 2:27pm UTC](https://discourse.processing.org/t/how-to-give-suggestions-in-input-box/11492 "2019-05-22T14:27:20Z")

</div>

I have created an input box where a user can type and I do things later on with what they type in. I was wondering if there was any way in p5.js to put grey text in the input box to “suggest” what the user is to type in,…

---

## [How to pass arguments to new sketch in instance mode](https://discourse.processing.org/t/how-to-pass-arguments-to-new-sketch-in-instance-mode/11453)

<div class="topic-metadata">

**Author:** [@TimR](https://discourse.processing.org/u/TimR)\
**Replies:** 2\
**Last updated:** [May 22, 2019, 6:49am UTC](https://discourse.processing.org/t/how-to-pass-arguments-to-new-sketch-in-instance-mode/11453 "2019-05-22T06:49:27Z")

</div>

Hey all, Is there a way to pass an arguments array/object to a new sketch in instance mode? I would like to pass settings to the new sketch, like information on who is it’s parent element. But this could also be used t…

---

## [Factal trees grow as mousePressed](https://discourse.processing.org/t/factal-trees-grow-as-mousepressed/11089)

<div class="topic-metadata">

**Author:** [@youyou0032](https://discourse.processing.org/u/youyou0032)\
**Replies:** 3\
**Last updated:** [May 21, 2019, 3:47pm UTC](https://discourse.processing.org/t/factal-trees-grow-as-mousepressed/11089 "2019-05-21T15:47:51Z")

</div>

Hi Everyone I am a beginner in coding and I am working on my first official project. I followed the Coding challenge #14 Fractal tree. It works and very well. I am very happy. And then, I want to change the growth of …

---

## [Video as gl texture setup?](https://discourse.processing.org/t/video-as-gl-texture-setup/11427)

<div class="topic-metadata">

**Author:** [@jedierikb](https://discourse.processing.org/u/jedierikb)\
**Replies:** 4\
**Last updated:** [May 21, 2019, 12:28pm UTC](https://discourse.processing.org/t/video-as-gl-texture-setup/11427 "2019-05-21T12:28:41Z")

</div>

Trying to get a video as a gl texture: https://codepen.io/jedierikb/pen/MdvqGp Any suggestions what steps I missed to get the video to appear as a texture? Much appreciated, thanks!

---

## [How to get atributes from sketch it's parent element](https://discourse.processing.org/t/how-to-get-atributes-from-sketch-its-parent-element/11452)

<div class="topic-metadata">

**Author:** [@TimR](https://discourse.processing.org/u/TimR)\
**Replies:** 3\
**Last updated:** [May 21, 2019, 7:34am UTC](https://discourse.processing.org/t/how-to-get-atributes-from-sketch-its-parent-element/11452 "2019-05-21T07:34:27Z")

</div>

I’ve made a P5 sketch in instance mode. Now, I wanted to get to know some of the settings from it’s parent element. Like dimensions. For this I thought a good starting point would be to be able to know who is it’s paren…

---

## [How do I load images from and array of URLs?](https://discourse.processing.org/t/how-do-i-load-images-from-and-array-of-urls/11435)

<div class="topic-metadata">

**Author:** [@Artie\_veirkant\_sux](https://discourse.processing.org/u/Artie_veirkant_sux)\
**Replies:** 5\
**Last updated:** [May 21, 2019, 5:59am UTC](https://discourse.processing.org/t/how-do-i-load-images-from-and-array-of-urls/11435 "2019-05-21T05:59:51Z")

</div>

Hey all, Snatching URLs from RSS, I’ve been able to populate an array of links; ran into some issues loading the images. Trying to use that array outside of its class has been problematic, and I don’t know where to plac…

---

## [Error on loadJSON](https://discourse.processing.org/t/error-on-loadjson/11439)

<div class="topic-metadata">

**Author:** [@thealex23ro](https://discourse.processing.org/u/thealex23ro)\
**Replies:** 9\
**Last updated:** [May 21, 2019, 2:33am UTC](https://discourse.processing.org/t/error-on-loadjson/11439 "2019-05-21T02:33:23Z")

</div>

I’m attempting to save some data but i’m getting the following error: XML Parsing Error: syntax error Location: file:///path/JS/Domino/data/test.json Line Number 1, Column 1: (there’s nothing after de colon) I tried…

---

## [Is it possible to trim a curveVertex() shape?](https://discourse.processing.org/t/is-it-possible-to-trim-a-curvevertex-shape/11314)

<div class="topic-metadata">

**Author:** [@nardove](https://discourse.processing.org/u/nardove)\
**Replies:** 9\
**Last updated:** [May 20, 2019, 5:40pm UTC](https://discourse.processing.org/t/is-it-possible-to-trim-a-curvevertex-shape/11314 "2019-05-20T17:40:02Z")

</div>

Hi, I’m drawing a curveVertex shape by adding a point(x,y) at different intervals of time, this points are stored in an array, the array is use to draw the curve. When my object goes to the edge of the screen, I render…

---

## [Problem with code p5js](https://discourse.processing.org/t/problem-with-code-p5js/11379)

<div class="topic-metadata">

**Author:** [@bitCrasher](https://discourse.processing.org/u/bitCrasher)\
**Replies:** 5\
**Last updated:** [May 19, 2019, 12:54pm UTC](https://discourse.processing.org/t/problem-with-code-p5js/11379 "2019-05-19T12:54:03Z")

</div>

hello! i’m trying to rewrite this code in processing: https://www.openprocessing.org/sketch/617540 but there is a part i don’t understand row 8: noiseSeed = noiseSeed || 1 this code pass to block function an int: …

---

## [Drop CSV file to loadTable()](https://discourse.processing.org/t/drop-csv-file-to-loadtable/11324)

<div class="topic-metadata">

**Author:** [@phoebus](https://discourse.processing.org/u/phoebus)\
**Replies:** 4\
**Last updated:** [May 19, 2019, 10:40am UTC](https://discourse.processing.org/t/drop-csv-file-to-loadtable/11324 "2019-05-19T10:40:04Z")

</div>

Hello I make a txt file with a header line, separated by commas, and some data lignes. ID, name, age, favorite color 00, Robert, 32, blue 01, Michele, 36, white If I use the drop() function, I get the file parameter t…

---

## [Check if a shape exists inside a complex shape](https://discourse.processing.org/t/check-if-a-shape-exists-inside-a-complex-shape/11176)

<div class="topic-metadata">

**Author:** [@Alisha](https://discourse.processing.org/u/Alisha)\
**Replies:** 4\
**Last updated:** [May 19, 2019, 6:43am UTC](https://discourse.processing.org/t/check-if-a-shape-exists-inside-a-complex-shape/11176 "2019-05-19T06:43:05Z")

</div>

I have a custom shape, which I made using: beginShape(LINES); vertex(190, 231); vertex(203, 143); vertex(203, 143); vertex(298, 153); vertex(298, 153); vertex(365,…

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

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