# p5.js

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

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

**Page:** 88

---

## [Drag & Drop Folders impossible?](https://discourse.processing.org/t/drag-drop-folders-impossible/13394)

<div class="topic-metadata">

**Author:** [@kaotiklabs](https://discourse.processing.org/u/kaotiklabs)\
**Replies:** 1\
**Last updated:** [August 16, 2019, 11:48pm UTC](https://discourse.processing.org/t/drag-drop-folders-impossible/13394 "2019-08-16T23:48:45Z")

</div>

Hi, I need to drop files or folders into my p5js canvas. I’m using cnv.drop() but it only allows for a single file or an array of files. How could I also drop folders? How are you doing it? Thanks in advance.

---

## [Blockly javascript code](https://discourse.processing.org/t/blockly-javascript-code/13288)

<div class="topic-metadata">

**Author:** [@deseingalt](https://discourse.processing.org/u/deseingalt)\
**Replies:** 5\
**Last updated:** [August 16, 2019, 5:55pm UTC](https://discourse.processing.org/t/blockly-javascript-code/13288 "2019-08-16T17:55:33Z")

</div>

Hi, Does anybody know how to adapt a blockly javascript code to P5.Js…? Thanks

---

## [New to coding; need a lotta help!](https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372)

<div class="topic-metadata">

**Author:** [@CipherMan](https://discourse.processing.org/u/CipherMan)\
**Replies:** 14\
**Last updated:** [August 15, 2019, 11:35am UTC](https://discourse.processing.org/t/new-to-coding-need-a-lotta-help/13372 "2019-08-15T11:35:45Z")

</div>

I have been following along with Daniel Shiffman’s tutorial videos on YouTube, and some codes work but others don’t. I’m new to coding, but it seems that the problem is the variables I put in, that the reader(?) doesn’t …

---

## [Positioning styled Dom elements](https://discourse.processing.org/t/positioning-styled-dom-elements/13369)

<div class="topic-metadata">

**Author:** [@rkdnson](https://discourse.processing.org/u/rkdnson)\
**Replies:** 1\
**Last updated:** [August 14, 2019, 1:45am UTC](https://discourse.processing.org/t/positioning-styled-dom-elements/13369 "2019-08-14T01:45:31Z")

</div>

I am having trouble positioning a checkbox after calling the style.transform function to scale it. In posting this I am finding similar topics using select() but am still unsure. Below, my goal would be that the checkbo…

---

## [Could I use P5.js to make games that runs on Kaios Phones?](https://discourse.processing.org/t/could-i-use-p5-js-to-make-games-that-runs-on-kaios-phones/13355)

<div class="topic-metadata">

**Author:** [@alexpfb](https://discourse.processing.org/u/alexpfb)\
**Replies:** 2\
**Last updated:** [August 13, 2019, 8:56pm UTC](https://discourse.processing.org/t/could-i-use-p5-js-to-make-games-that-runs-on-kaios-phones/13355 "2019-08-13T20:56:16Z")

</div>

I would like to make some simple 2d games to run in low cost Phones that runs KaiOs (Like JioPhone. Is P5.js suitable for that? In terms of performance?

---

## [P5.js for Weebly](https://discourse.processing.org/t/p5-js-for-weebly/13341)

<div class="topic-metadata">

**Author:** [@jgavlik](https://discourse.processing.org/u/jgavlik)\
**Replies:** 1\
**Last updated:** [August 13, 2019, 4:09am UTC](https://discourse.processing.org/t/p5-js-for-weebly/13341 "2019-08-13T04:09:22Z")

</div>

Can I import my P5.js script into Weebly?

---

## [\[SOLVED\] Does my Android have rotationX?](https://discourse.processing.org/t/solved-does-my-android-have-rotationx/7977)

<div class="topic-metadata">

**Author:** [@saintrain](https://discourse.processing.org/u/saintrain)\
**Replies:** 0\
**Last updated:** [January 30, 2019, 11:28pm UTC](https://discourse.processing.org/t/solved-does-my-android-have-rotationx/7977 "2019-01-30T23:28:09Z")

</div>

Hmm! If i run setup(), rotationX is defined!? Sorry. Doug Hi! Android 4.4.2 using Chrome 71.0 typeOf(rotationX) returns “undefined”. Is 4.4.2 too old? Is there an alternative? Thanks! Doug. Edit: Using \<scrip…

---

## [P5.js and WebGL: drawing lines](https://discourse.processing.org/t/p5-js-and-webgl-drawing-lines/13274)

<div class="topic-metadata">

**Author:** [@graysonh](https://discourse.processing.org/u/graysonh)\
**Replies:** 3\
**Last updated:** [August 12, 2019, 8:38pm UTC](https://discourse.processing.org/t/p5-js-and-webgl-drawing-lines/13274 "2019-08-12T20:38:08Z")

</div>

Hi All, I’m very new to p5 (coming from Processing) and am attempting to convert one of my processing sketches into p5 so I can run it on OpenProcessing. My sketch involves using a texture, so I am using WebGL, but the…

---

## [\[SOLVED\] Missing Comma in Array](https://discourse.processing.org/t/solved-missing-comma-in-array/13314)

<div class="topic-metadata">

**Author:** [@tobebot](https://discourse.processing.org/u/tobebot)\
**Replies:** 3\
**Last updated:** [August 12, 2019, 6:47pm UTC](https://discourse.processing.org/t/solved-missing-comma-in-array/13314 "2019-08-12T18:47:34Z")

</div>

Hi… I have this estrange error, why, please?

---

## ["focused" in iOS Safari](https://discourse.processing.org/t/focused-in-ios-safari/12007)

<div class="topic-metadata">

**Author:** [@phoebus](https://discourse.processing.org/u/phoebus)\
**Replies:** 3\
**Last updated:** [August 12, 2019, 5:19pm UTC](https://discourse.processing.org/t/focused-in-ios-safari/12007 "2019-08-12T17:19:55Z")

</div>

Hello focused parameter doesn’t seem to work ok on Safari for iOS My website works fine on FireFox / Chrome / Edge on Mac / Windows / Linux / Android / iOS but on Safari/iOS it doesn’t get that “focused” is true Haven…

---

## [mouseWheel in Safari not active?](https://discourse.processing.org/t/mousewheel-in-safari-not-active/7428)

<div class="topic-metadata">

**Author:** [@maxbatt](https://discourse.processing.org/u/maxbatt)\
**Replies:** 5\
**Last updated:** [August 10, 2019, 10:29pm UTC](https://discourse.processing.org/t/mousewheel-in-safari-not-active/7428 "2019-08-10T22:29:52Z")

</div>

Hello all! Just signed up today and excited to be part of the forum. I am wondering if there is a way to activate mouseWheel in safari? For me, the example at p5.org doesn’t work in safari, and the page I am trying to b…

---

## [Set drawing style in one function](https://discourse.processing.org/t/set-drawing-style-in-one-function/13254)

<div class="topic-metadata">

**Author:** [@philipplehmann](https://discourse.processing.org/u/philipplehmann)\
**Replies:** 3\
**Last updated:** [August 10, 2019, 8:30am UTC](https://discourse.processing.org/t/set-drawing-style-in-one-function/13254 "2019-08-10T08:30:05Z")

</div>

Hey there What do you guys think about the idea of a all-in-one function to set the drawing style. I created such a function as a shortcut and find it very handy. Is there already a similar behavior which i missed? D…

---

## [Astronomy in p5](https://discourse.processing.org/t/astronomy-in-p5/13234)

<div class="topic-metadata">

**Author:** [@gbenedisgrab](https://discourse.processing.org/u/gbenedisgrab)\
**Replies:** 1\
**Last updated:** [August 10, 2019, 12:46am UTC](https://discourse.processing.org/t/astronomy-in-p5/13234 "2019-08-10T00:46:08Z")

</div>

Hi All, I want to make a p5 app that animates the stars moving in the night sky. I want it to be very similar to this site http://www.etwright.org/astro/plani.html Anyone have advice on what to look at. I found a d3…

---

## [loadTable in constructor - check data is loaded](https://discourse.processing.org/t/loadtable-in-constructor-check-data-is-loaded/13257)

<div class="topic-metadata">

**Author:** [@gxkendall](https://discourse.processing.org/u/gxkendall)\
**Replies:** 1\
**Last updated:** [August 9, 2019, 11:24pm UTC](https://discourse.processing.org/t/loadtable-in-constructor-check-data-is-loaded/13257 "2019-08-09T23:24:25Z")

</div>

I know that you should call loadTable in preload, so that the data will will be loaded before setup is called. But I want to call loadTable in a constructor, but make sure it is loaded before continuing. I don’t have E…

---

## [Question about openprocessing.org functionality](https://discourse.processing.org/t/question-about-openprocessing-org-functionality/13181)

<div class="topic-metadata">

**Author:** [@SheCurvesMobius](https://discourse.processing.org/u/SheCurvesMobius)\
**Replies:** 6\
**Last updated:** [August 8, 2019, 5:18pm UTC](https://discourse.processing.org/t/question-about-openprocessing-org-functionality/13181 "2019-08-08T17:18:46Z")

</div>

Hello all, If I place a sound in the setup function it will play when I hit the play button. However, if I navigate to the page through a link on my openprocessing.org homepage, then the sound won’t play. In that same s…

---

## [Can't read pixels from capture](https://discourse.processing.org/t/cant-read-pixels-from-capture/13245)

<div class="topic-metadata">

**Author:** [@joshuajenkins](https://discourse.processing.org/u/joshuajenkins)\
**Replies:** 2\
**Last updated:** [August 8, 2019, 4:53am UTC](https://discourse.processing.org/t/cant-read-pixels-from-capture/13245 "2019-08-08T04:53:19Z")

</div>

Hi, I’m obviously missing something foundational. But at the moment I’m trying to simply get the pixels array from a video capture. My code sample follows, note this is on up-to-date versions Chrome and MacOS. let capt…

---

## [Drawing arc in WEBGL](https://discourse.processing.org/t/drawing-arc-in-webgl/13065)

<div class="topic-metadata">

**Author:** [@Jithin](https://discourse.processing.org/u/Jithin)\
**Replies:** 5\
**Last updated:** [August 7, 2019, 10:36pm UTC](https://discourse.processing.org/t/drawing-arc-in-webgl/13065 "2019-08-07T22:36:36Z")

</div>

Is it possible to draw arc in WEBGL mode?

---

## [Can not save canvas images correctly from p5js in OpenProcessing](https://discourse.processing.org/t/can-not-save-canvas-images-correctly-from-p5js-in-openprocessing/13242)

<div class="topic-metadata">

**Author:** [@rbytes](https://discourse.processing.org/u/rbytes)\
**Replies:** 0\
**Last updated:** [August 7, 2019, 10:28pm UTC](https://discourse.processing.org/t/can-not-save-canvas-images-correctly-from-p5js-in-openprocessing/13242 "2019-08-07T22:28:11Z")

</div>

Why does saving screen images from p5.js in OpenProcessing produce such strange results in Safari on iPad? I follow exactly the examples given on the p5js reference page which specify the file name and extender, but so…

---

## [Rotate the video created by createCapture](https://discourse.processing.org/t/rotate-the-video-created-by-createcapture/13189)

<div class="topic-metadata">

**Author:** [@Skim464](https://discourse.processing.org/u/Skim464)\
**Replies:** 2\
**Last updated:** [August 7, 2019, 9:00pm UTC](https://discourse.processing.org/t/rotate-the-video-created-by-createcapture/13189 "2019-08-07T21:00:50Z")

</div>

Hello. I am doing a posenet implementation of ml5 and p5.js Typical setup for the ML5 Posenet is as following: function setup() { const canvas = createCanvas(640, 480); canvas.parent(‘videoContainer’); video = cre…

---

## [Processing alternative to inline onclick()](https://discourse.processing.org/t/processing-alternative-to-inline-onclick/13179)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 3\
**Last updated:** [August 7, 2019, 8:45pm UTC](https://discourse.processing.org/t/processing-alternative-to-inline-onclick/13179 "2019-08-07T20:45:55Z")

</div>

menu = new button({ x:menuxy\[0\]+xx, y:menuxy\[1\]+yy-10, width:190+12, height:30\*10, id:"menu", col:color(255,255,255,20), label:"", onClick: function(){ setups(); } }); This is what I am converting …

---

## [KeyTyped not working until mouse is pressed](https://discourse.processing.org/t/keytyped-not-working-until-mouse-is-pressed/13151)

<div class="topic-metadata">

**Author:** [@SheCurvesMobius](https://discourse.processing.org/u/SheCurvesMobius)\
**Replies:** 5\
**Last updated:** [August 7, 2019, 7:43am UTC](https://discourse.processing.org/t/keytyped-not-working-until-mouse-is-pressed/13151 "2019-08-07T07:43:56Z")

</div>

Hello, I’ve taken the below code from this example: https://p5js.org/reference/#/p5/keyTyped and I’m using openprocessing.org as an editor, if that’s helpful in this situation. In order to be able to get the sketch t…

---

## [Code 800A0404 issue](https://discourse.processing.org/t/code-800a0404-issue/2036)

<div class="topic-metadata">

**Author:** [@mary.mauntz](https://discourse.processing.org/u/mary.mauntz)\
**Replies:** 14\
**Last updated:** [August 5, 2019, 2:47pm UTC](https://discourse.processing.org/t/code-800a0404-issue/2036 "2019-08-05T14:47:34Z")

</div>

So I am new to HTML and Javscript, and I 'm trying to setup p5.js , however I received windows script host problem Code 800A0405 source microsoft JScript compilation error…how can I fix this ? Please help me!!! Thanks!!! …

---

## [Generating a new color for each circle](https://discourse.processing.org/t/generating-a-new-color-for-each-circle/13163)

<div class="topic-metadata">

**Author:** [@epignosis567](https://discourse.processing.org/u/epignosis567)\
**Replies:** 2\
**Last updated:** [August 5, 2019, 10:37am UTC](https://discourse.processing.org/t/generating-a-new-color-for-each-circle/13163 "2019-08-05T10:37:13Z")

</div>

Hi. I have been following a tutorial and I came up with the following code. However, it’s not doing what I wanted. I would expect that everything individual circle would change a different color, but instead they’re all …

---

## [Sound in setup doesn't play from openprocessing](https://discourse.processing.org/t/sound-in-setup-doesnt-play-from-openprocessing/13185)

<div class="topic-metadata">

**Author:** [@SheCurvesMobius](https://discourse.processing.org/u/SheCurvesMobius)\
**Replies:** 0\
**Last updated:** [August 4, 2019, 2:57pm UTC](https://discourse.processing.org/t/sound-in-setup-doesnt-play-from-openprocessing/13185 "2019-08-04T14:57:00Z")

</div>

Here’s another interesting finding. Can anyone crack this puzzle? If I place a sound in the setup function it will play when I hit the play button. However, if I navigate to the page through a link on my openprocessing.o…

---

## [Can't play sound](https://discourse.processing.org/t/cant-play-sound/13130)

<div class="topic-metadata">

**Author:** [@SheCurvesMobius](https://discourse.processing.org/u/SheCurvesMobius)\
**Replies:** 5\
**Last updated:** [August 4, 2019, 1:45pm UTC](https://discourse.processing.org/t/cant-play-sound/13130 "2019-08-04T13:45:05Z")

</div>

Hello, I’m just learning to work with sound and I can’t get my sketch to work. Here’s the code: let mySound; function preload() { soundFormats('mp3'); mySound = loadSound('doorbell.mp3'); } function setup() { …

---

## [Saving image from CreateGraphics doubles resolution](https://discourse.processing.org/t/saving-image-from-creategraphics-doubles-resolution/13160)

<div class="topic-metadata">

**Author:** [@rkdnson](https://discourse.processing.org/u/rkdnson)\
**Replies:** 1\
**Last updated:** [August 4, 2019, 12:37am UTC](https://discourse.processing.org/t/saving-image-from-creategraphics-doubles-resolution/13160 "2019-08-04T00:37:41Z")

</div>

Hello! I am working on a bit of code, and have recently put in the createGraphics() function. When saving the image created by createGraphics, my resolution is doubled. print(graphics.width); //gives me 800 - the corre…

---

## ['is equal to': == vs ===](https://discourse.processing.org/t/is-equal-to-vs/13150)

<div class="topic-metadata">

**Author:** [@SheCurvesMobius](https://discourse.processing.org/u/SheCurvesMobius)\
**Replies:** 2\
**Last updated:** [August 3, 2019, 11:34am UTC](https://discourse.processing.org/t/is-equal-to-vs/13150 "2019-08-03T11:34:34Z")

</div>

Hi all, I come from Processing where ‘is equal to’ is represented by ‘==’. Lauren McCarthy’s book “Getting Started with Processing” uses this standard as well. However I’ve noted that here: https://p5js.org/examples/co…

---

## [Start image in center then follow mouse?](https://discourse.processing.org/t/start-image-in-center-then-follow-mouse/12834)

<div class="topic-metadata">

**Author:** [@epignosis567](https://discourse.processing.org/u/epignosis567)\
**Replies:** 15\
**Last updated:** [August 3, 2019, 11:21am UTC](https://discourse.processing.org/t/start-image-in-center-then-follow-mouse/12834 "2019-08-03T11:21:21Z")

</div>

Hi. How could I edit this code so that when a person loads the page the image is in the center but then once they click/touch the image follows the mouse cursor/finger? Currently the image follows the cursor but that mea…

---

## [How to light a vertex](https://discourse.processing.org/t/how-to-light-a-vertex/13148)

<div class="topic-metadata">

**Author:** [@lofi](https://discourse.processing.org/u/lofi)\
**Replies:** 2\
**Last updated:** [August 3, 2019, 9:54am UTC](https://discourse.processing.org/t/how-to-light-a-vertex/13148 "2019-08-03T09:54:53Z")

</div>

I’m trying to make little “hills” and was hoping to light them up. I’m using sets of vertexes but cant get light to act on them. I can make light work on a sphere or a box, but not my shapes made with vertexes. I feel l…

---

## [Wrapping preload(), setup() and draw() in an ES6 class](https://discourse.processing.org/t/wrapping-preload-setup-and-draw-in-an-es6-class/13071)

<div class="topic-metadata">

**Author:** [@kenny83](https://discourse.processing.org/u/kenny83)\
**Replies:** 7\
**Last updated:** [August 3, 2019, 12:42am UTC](https://discourse.processing.org/t/wrapping-preload-setup-and-draw-in-an-es6-class/13071 "2019-08-03T00:42:18Z")

</div>

Hi all, Apologies if this has been discussed before; I did a quick search across Google and this forum but didn’t find much. Please point me in the right direction if this is a duplicate question :slight\_smile: So what…

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

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