# p5.js

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

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

**Page:** 60

---

## [How to get the words to appear in a horizontal line rather than vertical line in p5.js?](https://discourse.processing.org/t/how-to-get-the-words-to-appear-in-a-horizontal-line-rather-than-vertical-line-in-p5-js/24430)

<div class="topic-metadata">

**Author:** [@sam101](https://discourse.processing.org/u/sam101)\
**Replies:** 2\
**Last updated:** [October 8, 2020, 12:35pm UTC](https://discourse.processing.org/t/how-to-get-the-words-to-appear-in-a-horizontal-line-rather-than-vertical-line-in-p5-js/24430 "2020-10-08T12:35:20Z")

</div>

Hey everyone I was just wondering how do I get the words to appear in a horizontal line rather than a vertical line in this code??? any help would be great! var myText = 'S H O U T'; var words; function setup() { cr…

---

## [Trouble with Vector.add](https://discourse.processing.org/t/trouble-with-vector-add/24170)

<div class="topic-metadata">

**Author:** [@noonscoomo](https://discourse.processing.org/u/noonscoomo)\
**Replies:** 3\
**Last updated:** [October 8, 2020, 7:27am UTC](https://discourse.processing.org/t/trouble-with-vector-add/24170 "2020-10-08T07:27:40Z")

</div>

Hi, I am in trouble with the p5.Vector.add() method and I don’t see why. My code generates a 2D Vector in setup, adds a random 2D vector in draw, pushes the result in an array and draws the whole array in a loop. If I …

---

## [WEBGL get the specific lineVertexes of a shape](https://discourse.processing.org/t/webgl-get-the-specific-linevertexes-of-a-shape/24399)

<div class="topic-metadata">

**Author:** [@SamuelCobb](https://discourse.processing.org/u/SamuelCobb)\
**Replies:** 1\
**Last updated:** [October 8, 2020, 12:11am UTC](https://discourse.processing.org/t/webgl-get-the-specific-linevertexes-of-a-shape/24399 "2020-10-08T00:11:07Z")

</div>

I am trying to make a ray-triangle intersection for a library that I am working on. My problem is not the actual ray-intersection algorithm, since I already have that ready. My issue is that I cannot access the individu…

---

## [Can i de-load or selectively load in images?](https://discourse.processing.org/t/can-i-de-load-or-selectively-load-in-images/24392)

<div class="topic-metadata">

**Author:** [@jstodd](https://discourse.processing.org/u/jstodd)\
**Replies:** 2\
**Last updated:** [October 7, 2020, 8:35am UTC](https://discourse.processing.org/t/can-i-de-load-or-selectively-load-in-images/24392 "2020-10-07T08:35:14Z")

</div>

Im having performance problems in my application due to i believe a lot of different images and files being loaded in at once. My program starts off fast, but gets slower over time. I believe this is a memory issue and …

---

## [P5.js and P5js-Sound on Android Studio with Webview](https://discourse.processing.org/t/p5-js-and-p5js-sound-on-android-studio-with-webview/24288)

<div class="topic-metadata">

**Author:** [@nxmusic](https://discourse.processing.org/u/nxmusic)\
**Replies:** 0\
**Last updated:** [October 2, 2020, 3:16pm UTC](https://discourse.processing.org/t/p5-js-and-p5js-sound-on-android-studio-with-webview/24288 "2020-10-02T15:16:17Z")

</div>

Hi! Only p5.js in Webview with android studio works ok, but when I add p5sound code only appears the loading… message Anyone have experience using p5 sound in android studio? Thaaaaaaanks

---

## [keyPressed to change image color, help!](https://discourse.processing.org/t/keypressed-to-change-image-color-help/24244)

<div class="topic-metadata">

**Author:** [@iwanttobelieve](https://discourse.processing.org/u/iwanttobelieve)\
**Replies:** 2\
**Last updated:** [October 1, 2020, 10:22pm UTC](https://discourse.processing.org/t/keypressed-to-change-image-color-help/24244 "2020-10-01T22:22:58Z")

</div>

Hey there! I was tasked to recreate the bouncing DVD logo screen - however I’m meant to make it so that when a key is pressed, the image changes a random color. I’ve tried a bunch of different combinations, and can’t se…

---

## [Tablet friendly drawing program: how to lock canvas down or make fullscreen-feeling](https://discourse.processing.org/t/tablet-friendly-drawing-program-how-to-lock-canvas-down-or-make-fullscreen-feeling/24206)

<div class="topic-metadata">

**Author:** [@kirkjerk](https://discourse.processing.org/u/kirkjerk)\
**Replies:** 2\
**Last updated:** [October 1, 2020, 9:14pm UTC](https://discourse.processing.org/t/tablet-friendly-drawing-program-how-to-lock-canvas-down-or-make-fullscreen-feeling/24206 "2020-10-01T21:14:34Z")

</div>

Any suggestions on how to “lock” down the canvas on a mobile device? I’d like to make a drawing doodle program but most gestures drag the screen with it. I thought I was close by using CSS to make the Canvas parent “pos…

---

## [Sketch not working in Chrome](https://discourse.processing.org/t/sketch-not-working-in-chrome/24272)

<div class="topic-metadata">

**Author:** [@alsumwas](https://discourse.processing.org/u/alsumwas)\
**Replies:** 0\
**Last updated:** [October 1, 2020, 3:24pm UTC](https://discourse.processing.org/t/sketch-not-working-in-chrome/24272 "2020-10-01T15:24:51Z")

</div>

I made this simple sketch and it will not open in Chrome after I export it from the p5.js web editor. Any suggestions? http://do.art.gvsu.edu/interactive21/sound/index.html

---

## [Button not working as expected](https://discourse.processing.org/t/button-not-working-as-expected/24273)

<div class="topic-metadata">

**Author:** [@alsumwas](https://discourse.processing.org/u/alsumwas)\
**Replies:** 0\
**Last updated:** [October 1, 2020, 3:31pm UTC](https://discourse.processing.org/t/button-not-working-as-expected/24273 "2020-10-01T15:31:24Z")

</div>

The sketch below works fine in the p5.js web editor but when I export it and upload it to the server the buttons do not work properly. Button c and d are the colors I want them to be but a, b, e, and f are the default c…

---

## [Web editor p5.js logging problem](https://discourse.processing.org/t/web-editor-p5-js-logging-problem/24275)

<div class="topic-metadata">

**Author:** [@ivan\_abreu](https://discourse.processing.org/u/ivan_abreu)\
**Replies:** 1\
**Last updated:** [October 1, 2020, 5:45pm UTC](https://discourse.processing.org/t/web-editor-p5-js-logging-problem/24275 "2020-10-01T17:45:51Z")

</div>

Do you have problems logging into the web editor of p5.js? : ( I teach my creative code classes on that platform Does anyone know what happens?

---

## [Trouble with code linking to JSON file in p5.js?](https://discourse.processing.org/t/trouble-with-code-linking-to-json-file-in-p5-js/24241)

<div class="topic-metadata">

**Author:** [@sam101](https://discourse.processing.org/u/sam101)\
**Replies:** 5\
**Last updated:** [October 1, 2020, 1:45pm UTC](https://discourse.processing.org/t/trouble-with-code-linking-to-json-file-in-p5-js/24241 "2020-10-01T13:45:51Z")

</div>

Hi everyone, so I’ve just changed my JSON data so that I can link it my “date” as well as the “hours”. So I wrote out this section two lines to get the data working, but so far no luck. Was wondering if anyone can help? …

---

## [Shader that matches filter(DILATE)?](https://discourse.processing.org/t/shader-that-matches-filter-dilate/24257)

<div class="topic-metadata">

**Author:** [@DanielH](https://discourse.processing.org/u/DanielH)\
**Replies:** 2\
**Last updated:** [October 1, 2020, 7:21am UTC](https://discourse.processing.org/t/shader-that-matches-filter-dilate/24257 "2020-10-01T07:21:43Z")

</div>

Anyone know if such a thing exists? Would be nice to provide shader equivalents for the basic filters included in p5js so that users can easily switch between 2D/filters and WEBGL

---

## [Table text error with p5js](https://discourse.processing.org/t/table-text-error-with-p5js/24246)

<div class="topic-metadata">

**Author:** [@Awesomeness278](https://discourse.processing.org/u/Awesomeness278)\
**Replies:** 3\
**Last updated:** [October 1, 2020, 12:06am UTC](https://discourse.processing.org/t/table-text-error-with-p5js/24246 "2020-10-01T00:06:46Z")

</div>

The table text setting in the p5js web editor causes an error to happen, even in a blank sketch.

---

## [Error Affecting All Programs](https://discourse.processing.org/t/error-affecting-all-programs/21115)

<div class="topic-metadata">

**Author:** [@shodai](https://discourse.processing.org/u/shodai)\
**Replies:** 7\
**Last updated:** [September 30, 2020, 5:27pm UTC](https://discourse.processing.org/t/error-affecting-all-programs/21115 "2020-09-30T17:27:49Z")

</div>

I am a teacher using P5.js and one of my students has run into a problem that I cannot understand/fix. For some reason, all of this students programs have stopped working. If I get the code and use it, it works fine, but…

---

## [Trouble Writing JSON code?](https://discourse.processing.org/t/trouble-writing-json-code/24232)

<div class="topic-metadata">

**Author:** [@sam101](https://discourse.processing.org/u/sam101)\
**Replies:** 1\
**Last updated:** [September 30, 2020, 1:12pm UTC](https://discourse.processing.org/t/trouble-writing-json-code/24232 "2020-09-30T13:12:33Z")

</div>

So I’m trying to nestle my “hours” array within my “Sunday” array. So the code below works and is validated, but when I repeat the code, that is of Mondays data underneath this code, it doesn’t validate anymore. I’ve tri…

---

## [How do I get my shapes to move/animate around the canvas on p5.js?](https://discourse.processing.org/t/how-do-i-get-my-shapes-to-move-animate-around-the-canvas-on-p5-js/24233)

<div class="topic-metadata">

**Author:** [@sam101](https://discourse.processing.org/u/sam101)\
**Replies:** 3\
**Last updated:** [September 30, 2020, 12:40pm UTC](https://discourse.processing.org/t/how-do-i-get-my-shapes-to-move-animate-around-the-canvas-on-p5-js/24233 "2020-09-30T12:40:33Z")

</div>

Hi everyone, I’m a bit lost in how I could get my shapes that I have created to move around the canvas. So far they are quite static. Any suggestions or methods I could look into would be great!

---

## [Why do some functions loop, and others don't?](https://discourse.processing.org/t/why-do-some-functions-loop-and-others-dont/24223)

<div class="topic-metadata">

**Author:** [@SheCurvesMobius](https://discourse.processing.org/u/SheCurvesMobius)\
**Replies:** 5\
**Last updated:** [September 30, 2020, 9:05am UTC](https://discourse.processing.org/t/why-do-some-functions-loop-and-others-dont/24223 "2020-09-30T09:05:05Z")

</div>

Hi all, I’m wondering if anyone has any insight into why some functions, will affect the next frame in the draw loop, while others won’t. For example: the fill() function (written at the bottom of the draw loop) will…

---

## [LoadModel() not working?](https://discourse.processing.org/t/loadmodel-not-working/24229)

<div class="topic-metadata">

**Author:** [@pheelia](https://discourse.processing.org/u/pheelia)\
**Replies:** 0\
**Last updated:** [September 29, 2020, 9:58pm UTC](https://discourse.processing.org/t/loadmodel-not-working/24229 "2020-09-29T21:58:20Z")

</div>

\`//draw a spinning teapot let teapot; function preload() { // Load model with normalise parameter set to true teapot = loadModel(‘assets/teapot.obj’, true); } function setup() { createCanvas(100, 100, WEBGL); } f…

---

## [Average captured image flow on p5.js?](https://discourse.processing.org/t/average-captured-image-flow-on-p5-js/24222)

<div class="topic-metadata">

**Author:** [@villares](https://discourse.processing.org/u/villares)\
**Replies:** 0\
**Last updated:** [September 29, 2020, 2:16pm UTC](https://discourse.processing.org/t/average-captured-image-flow-on-p5-js/24222 "2020-09-29T14:16:15Z")

</div>

I work mostly with Processing Java and Python modes, where I’m used to have OpenCV to calculate average image flow. Is there something that will provide a ready-to-use average image flow vector (like opencv.getAverageFlo…

---

## [Does P5 uses WebGL in its 2D context as well?](https://discourse.processing.org/t/does-p5-uses-webgl-in-its-2d-context-as-well/24217)

<div class="topic-metadata">

**Author:** [@dupuqub](https://discourse.processing.org/u/dupuqub)\
**Replies:** 0\
**Last updated:** [September 29, 2020, 10:22am UTC](https://discourse.processing.org/t/does-p5-uses-webgl-in-its-2d-context-as-well/24217 "2020-09-29T10:22:32Z")

</div>

I am currently looking for some cool graphics library and so far P5 really seems the ideal one to me, but WebGL is my selling point. I’ve looked into Babylon and Pixi too, and they do the job, but still, P5 feels right. …

---

## [Changing data visualisation through MousePressed function in p5.js?](https://discourse.processing.org/t/changing-data-visualisation-through-mousepressed-function-in-p5-js/24196)

<div class="topic-metadata">

**Author:** [@sam101](https://discourse.processing.org/u/sam101)\
**Replies:** 4\
**Last updated:** [September 29, 2020, 10:59am UTC](https://discourse.processing.org/t/changing-data-visualisation-through-mousepressed-function-in-p5-js/24196 "2020-09-29T10:59:41Z")

</div>

Hey everyone, okay so this issue has got me super confused. So basically I would like the sketch to show a data visualisation of one JSON file. (being a Sunday data). But when I mousePress, the data would represent anot…

---

## [Why when we create a code in the p5.js editor and download it when we run it in the google chrome browser it doesn't run?](https://discourse.processing.org/t/why-when-we-create-a-code-in-the-p5-js-editor-and-download-it-when-we-run-it-in-the-google-chrome-browser-it-doesnt-run/24203)

<div class="topic-metadata">

**Author:** [@Willian\_Xz](https://discourse.processing.org/u/Willian_Xz)\
**Replies:** 1\
**Last updated:** [September 28, 2020, 7:42pm UTC](https://discourse.processing.org/t/why-when-we-create-a-code-in-the-p5-js-editor-and-download-it-when-we-run-it-in-the-google-chrome-browser-it-doesnt-run/24203 "2020-09-28T19:42:33Z")

</div>

Greetings from Brazil friends! Why when we create a code in the p5.js editor and download it when we run it in the google chrome browser it doesn’t run? It just keeps showing “Loading …” Nothing happens. In the firef…

---

## [Is it possible to create more than one button for different actions in p5.js?](https://discourse.processing.org/t/is-it-possible-to-create-more-than-one-button-for-different-actions-in-p5-js/24194)

<div class="topic-metadata">

**Author:** [@sam101](https://discourse.processing.org/u/sam101)\
**Replies:** 1\
**Last updated:** [September 28, 2020, 4:27pm UTC](https://discourse.processing.org/t/is-it-possible-to-create-more-than-one-button-for-different-actions-in-p5-js/24194 "2020-09-28T16:27:13Z")

</div>

Hi everyone, was just wondering is there a way to create multiple buttons that can output different functions within p5.js. I’m looking into the button references on p5.js .org, but it looks like it hasn’t mentioned anyt…

---

## [How do I generate circles appearing one at a time, rather than a whole cluster of circles in p5.js](https://discourse.processing.org/t/how-do-i-generate-circles-appearing-one-at-a-time-rather-than-a-whole-cluster-of-circles-in-p5-js/24182)

<div class="topic-metadata">

**Author:** [@sam101](https://discourse.processing.org/u/sam101)\
**Replies:** 5\
**Last updated:** [September 28, 2020, 3:01pm UTC](https://discourse.processing.org/t/how-do-i-generate-circles-appearing-one-at-a-time-rather-than-a-whole-cluster-of-circles-in-p5-js/24182 "2020-09-28T15:01:15Z")

</div>

Hi everyone, so I was wondering how do I get the ellipse that I have drawn to appear one at a time, rather than having 10 all appear at once as a group? var data; var instagram, snapchat, messenger, facebook, email, in…

---

## [How do I generate colour based on my JSON data in p5.js?](https://discourse.processing.org/t/how-do-i-generate-colour-based-on-my-json-data-in-p5-js/24148)

<div class="topic-metadata">

**Author:** [@sam101](https://discourse.processing.org/u/sam101)\
**Replies:** 2\
**Last updated:** [September 28, 2020, 11:24am UTC](https://discourse.processing.org/t/how-do-i-generate-colour-based-on-my-json-data-in-p5-js/24148 "2020-09-28T11:24:25Z")

</div>

Hi everyone! I’m trying to figure out how I can generate colour that will respond to my JSON data. Heres the code so far and I’ve highlighted the bits at the end to show my attempt, but obviously it hasn’t worked. The …

---

## [MousePressed function not working?](https://discourse.processing.org/t/mousepressed-function-not-working/24187)

<div class="topic-metadata">

**Author:** [@sam101](https://discourse.processing.org/u/sam101)\
**Replies:** 3\
**Last updated:** [September 28, 2020, 10:59am UTC](https://discourse.processing.org/t/mousepressed-function-not-working/24187 "2020-09-28T10:59:00Z")

</div>

Hey everyone, so somehow my mousePressed function isn’t changing the days of the week text whenever I mousepress, but it is starting a new sketch… Don’t know whats preventing the text from changing? If anyone can figure…

---

## [Importing SVG to p5.js sketch](https://discourse.processing.org/t/importing-svg-to-p5-js-sketch/24072)

<div class="topic-metadata">

**Author:** [@yhlaskerimov](https://discourse.processing.org/u/yhlaskerimov)\
**Replies:** 16\
**Last updated:** [September 28, 2020, 8:00am UTC](https://discourse.processing.org/t/importing-svg-to-p5-js-sketch/24072 "2020-09-28T08:00:39Z")

</div>

Hi, everyone ! Is there any way to load an SVG(this SVG’s background is transparent, I need to import with transparency) to my p5 sketch ? I appreciate every help, thanks ! YK.

---

## [How to make a createCapture (video cam) responsive in p5js](https://discourse.processing.org/t/how-to-make-a-createcapture-video-cam-responsive-in-p5js/24138)

<div class="topic-metadata">

**Author:** [@Jinsel](https://discourse.processing.org/u/Jinsel)\
**Replies:** 1\
**Last updated:** [September 28, 2020, 1:40am UTC](https://discourse.processing.org/t/how-to-make-a-createcapture-video-cam-responsive-in-p5js/24138 "2020-09-28T01:40:52Z")

</div>

I wanna make my video cam be responsive on the webpage, so how to make it?

---

## [P5js in an epub3 on kobo ereader?](https://discourse.processing.org/t/p5js-in-an-epub3-on-kobo-ereader/9266)

<div class="topic-metadata">

**Author:** [@mrbbp](https://discourse.processing.org/u/mrbbp)\
**Replies:** 3\
**Last updated:** [September 27, 2020, 9:06pm UTC](https://discourse.processing.org/t/p5js-in-an-epub3-on-kobo-ereader/9266 "2020-09-27T21:06:12Z")

</div>

Hello, I’m starting playing with kobo ereader and epub 3 format. I’ts xhtml5, on kobo ereader with the kepub.epub js are running. I’m able to run basic script and attempt to use P5js, to use it canvas abilities… I’ve…

---

## [Buffering videos fully before playing them](https://discourse.processing.org/t/buffering-videos-fully-before-playing-them/24080)

<div class="topic-metadata">

**Author:** [@agidron](https://discourse.processing.org/u/agidron)\
**Replies:** 8\
**Last updated:** [September 27, 2020, 7:37pm UTC](https://discourse.processing.org/t/buffering-videos-fully-before-playing-them/24080 "2020-09-27T19:37:49Z")

</div>

Hello! I’m relatively new to JS and P5 with limited coding background, and I’m learning as I go. This is my first post here. I’m building a website that needs to stream several videos simultaneously for a music/video p…

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

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