# p5.js

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

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

**Page:** 109

---

## [Does set() work differently in P5.JS than it does in Processing?](https://discourse.processing.org/t/does-set-work-differently-in-p5-js-than-it-does-in-processing/3570)

<div class="topic-metadata">

**Author:** [@HoboGreed](https://discourse.processing.org/u/HoboGreed)\
**Replies:** 1\
**Last updated:** [September 16, 2018, 11:48am UTC](https://discourse.processing.org/t/does-set-work-differently-in-p5-js-than-it-does-in-processing/3570 "2018-09-16T11:48:10Z")

</div>

point(250,250) draws a point but set(250,250,255) does not. function setup() { createCanvas(500,500); } function draw() { background(0); stroke(255); point(250,250); set(252,250,255) }

---

## [Variable not found](https://discourse.processing.org/t/variable-not-found/3541)

<div class="topic-metadata">

**Author:** [@Blue\_Obsidian](https://discourse.processing.org/u/Blue_Obsidian)\
**Replies:** 5\
**Last updated:** [September 15, 2018, 10:25pm UTC](https://discourse.processing.org/t/variable-not-found/3541 "2018-09-15T22:25:30Z")

</div>

I have a problem with my code. At line 105, it doesn’t find p1 and I don’t know why, so can you help me please? Here’s the link: https://editor.p5js.org/Dark\_Obsidian/sketches/H1krCM\_\_Q

---

## [How to run p5 in ElectronJS](https://discourse.processing.org/t/how-to-run-p5-in-electronjs/3467)

<div class="topic-metadata">

**Author:** [@kokoo](https://discourse.processing.org/u/kokoo)\
**Replies:** 2\
**Last updated:** [September 15, 2018, 2:47pm UTC](https://discourse.processing.org/t/how-to-run-p5-in-electronjs/3467 "2018-09-15T14:47:19Z")

</div>

Is there any video tutorial how to setup and run p5 scripts in Electron framework?

---

## [P5 Pathfinding Function Crashes Sketch](https://discourse.processing.org/t/p5-pathfinding-function-crashes-sketch/3524)

<div class="topic-metadata">

**Author:** [@OrangeC7](https://discourse.processing.org/u/OrangeC7)\
**Replies:** 3\
**Last updated:** [September 14, 2018, 5:46am UTC](https://discourse.processing.org/t/p5-pathfinding-function-crashes-sketch/3524 "2018-09-14T05:46:30Z")

</div>

I’m trying to write an A\* pathfinding function to see how well it does in a snake game I’m programming based on The Coding Train’s coding challenge here: (https://www.youtube.com/watch?v=OMoVcohRgZA), but for some reason…

---

## [Weird image glitch. p5.geolocation & CSS](https://discourse.processing.org/t/weird-image-glitch-p5-geolocation-css/3518)

<div class="topic-metadata">

**Author:** [@currymike](https://discourse.processing.org/u/currymike)\
**Replies:** 3\
**Last updated:** [September 14, 2018, 2:59am UTC](https://discourse.processing.org/t/weird-image-glitch-p5-geolocation-css/3518 "2018-09-14T02:59:41Z")

</div>

I am using the p5.geolocation library to measure the distance between the app user and a trigger point location. As the user moves closer to the trigger point the blur effect on an image is adjusted, the closer they are…

---

## [Reading XML data from website](https://discourse.processing.org/t/reading-xml-data-from-website/3500)

<div class="topic-metadata">

**Author:** [@specials](https://discourse.processing.org/u/specials)\
**Replies:** 3\
**Last updated:** [September 13, 2018, 8:22pm UTC](https://discourse.processing.org/t/reading-xml-data-from-website/3500 "2018-09-13T20:22:31Z")

</div>

I am attempting to read the product page of a certain website, however I get an error on line 27, stating that goXML does not have a function named listChildren, along with all other p5 .xml functions. However, xml, a va…

---

## [Set eslint to understand the p5.js library calls and not flag them as undefined](https://discourse.processing.org/t/set-eslint-to-understand-the-p5-js-library-calls-and-not-flag-them-as-undefined/3487)

<div class="topic-metadata">

**Author:** [@atoro](https://discourse.processing.org/u/atoro)\
**Replies:** 2\
**Last updated:** [September 13, 2018, 8:54am UTC](https://discourse.processing.org/t/set-eslint-to-understand-the-p5-js-library-calls-and-not-flag-them-as-undefined/3487 "2018-09-13T08:54:08Z")

</div>

Option 1: Use /\* eslint no-undef: 0 \*/ at the top of your file That will stop warnings for variables that are accessed but not defined within the same file. Example: /\* eslint no-undef: 0 \*/ setup = function() { cr…

---

## [Voice spelling letters and numbers with p5.js](https://discourse.processing.org/t/voice-spelling-letters-and-numbers-with-p5-js/3468)

<div class="topic-metadata">

**Author:** [@TeslaVector](https://discourse.processing.org/u/TeslaVector)\
**Replies:** 3\
**Last updated:** [September 13, 2018, 7:33am UTC](https://discourse.processing.org/t/voice-spelling-letters-and-numbers-with-p5-js/3468 "2018-09-13T07:33:14Z")

</div>

Hi guys! I have a BIG problem. :frowning: I make program when user push button like ‘a’, ‘s’, ‘g’, ‘0-9’ etc. The Program repeats letters with voice command. It is useful for blind person. Problem is when users fast typ…

---

## [Perlin noise implementation in p5.js](https://discourse.processing.org/t/perlin-noise-implementation-in-p5-js/3009)

<div class="topic-metadata">

**Author:** [@HEX0x6C](https://discourse.processing.org/u/HEX0x6C)\
**Replies:** 14\
**Last updated:** [September 12, 2018, 8:20pm UTC](https://discourse.processing.org/t/perlin-noise-implementation-in-p5-js/3009 "2018-09-12T20:20:46Z")

</div>

Hi. I noticed the outcomes of noise() function in Processing and p5.js is different (setting the same seeds). Do they use different implementations? Why?

---

## [Euler angles, while working on a flight simulator](https://discourse.processing.org/t/euler-angles-while-working-on-a-flight-simulator/3441)

<div class="topic-metadata">

**Author:** [@EMJ](https://discourse.processing.org/u/EMJ)\
**Replies:** 8\
**Last updated:** [September 12, 2018, 7:43pm UTC](https://discourse.processing.org/t/euler-angles-while-working-on-a-flight-simulator/3441 "2018-09-12T19:43:33Z")

</div>

Hi all, i’m quite a beginner, more in 3d level math than in coding (i’m not so confident in my english too), and i’m trying to build from scratch a working flight simulator, not with amazing graphics, just for now a 3d m…

---

## [netP5 (TCP/IP networking under android)](https://discourse.processing.org/t/netp5-tcp-ip-networking-under-android/3046)

<div class="topic-metadata">

**Author:** [@dtmr](https://discourse.processing.org/u/dtmr)\
**Replies:** 0\
**Last updated:** [August 27, 2018, 11:50pm UTC](https://discourse.processing.org/t/netp5-tcp-ip-networking-under-android/3046 "2018-08-27T23:50:00Z")

</div>

netP5 problem: The code below only works with the delay, otherwise the Client.send() operation throws a null pointer exception. Should I check/wait for something after creating a client? Client = new TcpClient(Listener,…

---

## [Best Practices for Implementing Multiplayer](https://discourse.processing.org/t/best-practices-for-implementing-multiplayer/2952)

<div class="topic-metadata">

**Author:** [@Battlesquid](https://discourse.processing.org/u/Battlesquid)\
**Replies:** 3\
**Last updated:** [September 10, 2018, 6:34pm UTC](https://discourse.processing.org/t/best-practices-for-implementing-multiplayer/2952 "2018-09-10T18:34:00Z")

</div>

Hello all. I’ve been working with p5.js and p5.play for some time, and I’ve been interested in making some multiplayer games, but I don’t know if my implementation is well structured. I tried my hand at it with this game …

---

## [Centering the center of div not top right corner](https://discourse.processing.org/t/centering-the-center-of-div-not-top-right-corner/3331)

<div class="topic-metadata">

**Author:** [@BlasterPal](https://discourse.processing.org/u/BlasterPal)\
**Replies:** 4\
**Last updated:** [September 8, 2018, 7:34pm UTC](https://discourse.processing.org/t/centering-the-center-of-div-not-top-right-corner/3331 "2018-09-08T19:34:06Z")

</div>

I’m using p5’s DOM library to create a div and add links to it. I want the div to show up in the center of the screen (aka the center point of the div should be the same as the center point of the screen). I’m using the …

---

## [Fetch API cannot load file](https://discourse.processing.org/t/fetch-api-cannot-load-file/3261)

<div class="topic-metadata">

**Author:** [@josephh](https://discourse.processing.org/u/josephh)\
**Replies:** 8\
**Last updated:** [September 8, 2018, 1:34am UTC](https://discourse.processing.org/t/fetch-api-cannot-load-file/3261 "2018-09-08T01:34:58Z")

</div>

Hi there, I have a problem with loading a binary file using the function loadBytes() in p5.js using Chrome ( 68.0.3440.106 Build official 64 bits ). It says : My code : var binary\_file; function preload(){ bina…

---

## [P5.js image width and height error](https://discourse.processing.org/t/p5-js-image-width-and-height-error/3345)

<div class="topic-metadata">

**Author:** [@josephh](https://discourse.processing.org/u/josephh)\
**Replies:** 4\
**Last updated:** [September 7, 2018, 3:25pm UTC](https://discourse.processing.org/t/p5-js-image-width-and-height-error/3345 "2018-09-07T15:25:54Z")

</div>

Hello there, Basically I want to load some images (in the folder pics/n\*.jpg) and get their pixel data in a 2d array (data = \[\]). I have this code : let data = \[\]; let img; function preload() { for (let i = 0; i \<…

---

## [How to remove the "loading" message from preload()](https://discourse.processing.org/t/how-to-remove-the-loading-message-from-preload/3317)

<div class="topic-metadata">

**Author:** [@currymike](https://discourse.processing.org/u/currymike)\
**Replies:** 4\
**Last updated:** [September 7, 2018, 2:45pm UTC](https://discourse.processing.org/t/how-to-remove-the-loading-message-from-preload/3317 "2018-09-07T14:45:34Z")

</div>

Is there a way to remove the “loading” message when the preload function is running? I’m fine with the screen being blank, just need the loading gone. I can’t seem to find the answer in the P5.JS reference. Any help w…

---

## [Local server: Apache instructions missing. Please revert](https://discourse.processing.org/t/local-server-apache-instructions-missing-please-revert/1397)

<div class="topic-metadata">

**Author:** [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Replies:** 0\
**Last updated:** [July 1, 2018, 1:31am UTC](https://discourse.processing.org/t/local-server-apache-instructions-missing-please-revert/1397 "2018-07-01T01:31:16Z")

</div>

I am referring to this wiki entry in the Processing|P5.js GitHub’s page under the wiki page tab. The instructions to configure the Apache server were replaced with instructions of how to setup php. These instructions onl…

---

## [Draw() not drawing when using pixels to fade image](https://discourse.processing.org/t/draw-not-drawing-when-using-pixels-to-fade-image/3267)

<div class="topic-metadata">

**Author:** [@vixo777](https://discourse.processing.org/u/vixo777)\
**Replies:** 3\
**Last updated:** [September 7, 2018, 2:01am UTC](https://discourse.processing.org/t/draw-not-drawing-when-using-pixels-to-fade-image/3267 "2018-09-07T02:01:25Z")

</div>

Hi all, I’m trying to implement a fade effect. The basic idea is to draw something on the canvas that fades overtime. I draw multiple times, and call fade after every draw, to create an effect where old drawings eventual…

---

## [How can I segment an image and create many images](https://discourse.processing.org/t/how-can-i-segment-an-image-and-create-many-images/3231)

<div class="topic-metadata">

**Author:** [@donammar](https://discourse.processing.org/u/donammar)\
**Replies:** 1\
**Last updated:** [September 3, 2018, 5:52pm UTC](https://discourse.processing.org/t/how-can-i-segment-an-image-and-create-many-images/3231 "2018-09-03T17:52:39Z")

</div>

How can I segment (crop) an image and create many images ? i don’t find good and easy tutorials on processing.js why ?

---

## [p5.Geolocate Library - Smallest usable geoFenceCiricle()](https://discourse.processing.org/t/p5-geolocate-library-smallest-usable-geofenceciricle/2735)

<div class="topic-metadata">

**Author:** [@currymike](https://discourse.processing.org/u/currymike)\
**Replies:** 5\
**Last updated:** [September 3, 2018, 2:20am UTC](https://discourse.processing.org/t/p5-geolocate-library-smallest-usable-geofenceciricle/2735 "2018-09-03T02:20:40Z")

</div>

Hello, I’m building an app for a Poetry Walk through a park using P5.JS and the Geolocate library. I have the basic structure of the app setup but I am having issues with the accuracy of the GPS coordinates. As the us…

---

## [How can I change the properties of a elements :focus in p5?](https://discourse.processing.org/t/how-can-i-change-the-properties-of-a-elements-focus-in-p5/3208)

<div class="topic-metadata">

**Author:** [@kiko](https://discourse.processing.org/u/kiko)\
**Replies:** 6\
**Last updated:** [September 3, 2018, 12:56am UTC](https://discourse.processing.org/t/how-can-i-change-the-properties-of-a-elements-focus-in-p5/3208 "2018-09-03T00:56:51Z")

</div>

So I have an input stored as a variable. let input = createInput(); Now, I want to remove the border that is created when you click on it. I know that can be done in css with input:focus{ outline:none; } So how…

---

## [saveJSON() downloads instead off saving the json file](https://discourse.processing.org/t/savejson-downloads-instead-off-saving-the-json-file/2755)

<div class="topic-metadata">

**Author:** [@ville2008](https://discourse.processing.org/u/ville2008)\
**Replies:** 2\
**Last updated:** [September 2, 2018, 9:19pm UTC](https://discourse.processing.org/t/savejson-downloads-instead-off-saving-the-json-file/2755 "2018-09-02T21:19:05Z")

</div>

i am trying to use a json file to save how many people have downloaded my program but when i use saveJSON it just downloads a file instead off saving the file

---

## [Draw 1 frame only](https://discourse.processing.org/t/draw-1-frame-only/3206)

<div class="topic-metadata">

**Author:** [@dislo](https://discourse.processing.org/u/dislo)\
**Replies:** 3\
**Last updated:** [September 2, 2018, 9:05pm UTC](https://discourse.processing.org/t/draw-1-frame-only/3206 "2018-09-02T21:05:31Z")

</div>

i just want to draw one picture, no animation. is this possible?

---

## [mousePressed not working with P5.Dom button creation](https://discourse.processing.org/t/mousepressed-not-working-with-p5-dom-button-creation/3203)

<div class="topic-metadata">

**Author:** [@tmarasco125](https://discourse.processing.org/u/tmarasco125)\
**Replies:** 3\
**Last updated:** [September 2, 2018, 8:55pm UTC](https://discourse.processing.org/t/mousepressed-not-working-with-p5-dom-button-creation/3203 "2018-09-02T20:55:50Z")

</div>

Hi! I just started using the newest version of p5.js and p5.dom.js, and the mousePressed() method throws an error when a DOM button is clicked. Here is my code: var button; function setup(){ noCanvas(); button = cr…

---

## [ES6 usage with p5 ide mode](https://discourse.processing.org/t/es6-usage-with-p5-ide-mode/3196)

<div class="topic-metadata">

**Author:** [@kokoo](https://discourse.processing.org/u/kokoo)\
**Replies:** 1\
**Last updated:** [September 2, 2018, 6:06pm UTC](https://discourse.processing.org/t/es6-usage-with-p5-ide-mode/3196 "2018-09-02T18:06:26Z")

</div>

Processing IDE gives errors due to some syntax checking that p5js-mode was using. Are there any plans for ecmascript 6 implementation in editor? Can’t use ‘let’ and classes

---

## [Space Invaders Enachments Design](https://discourse.processing.org/t/space-invaders-enachments-design/3106)

<div class="topic-metadata">

**Author:** [@Vazco18](https://discourse.processing.org/u/Vazco18)\
**Replies:** 7\
**Last updated:** [August 31, 2018, 9:24pm UTC](https://discourse.processing.org/t/space-invaders-enachments-design/3106 "2018-08-31T21:24:40Z")

</div>

Hi, First of all, I’m a starter to P5 and I’ve started on my semester 2 Project “Space Invaders”, Source file Download link via One Drive = https://scuonline-my.sharepoint.com/:f:/g/personal/t\_charles\_12\_student\_s…

---

## [Need help with converting java code to javascript code](https://discourse.processing.org/t/need-help-with-converting-java-code-to-javascript-code/3142)

<div class="topic-metadata">

**Author:** [@kernel](https://discourse.processing.org/u/kernel)\
**Replies:** 8\
**Last updated:** [August 31, 2018, 6:43pm UTC](https://discourse.processing.org/t/need-help-with-converting-java-code-to-javascript-code/3142 "2018-08-31T18:43:16Z")

</div>

Here is the code I found and I was trying to convert this into javascript code pathfinder\[\] paths; void setup() { size(800, 600); background(0); ellipseMode(CENTER); fill(255); noStroke(); smooth(); paths…

---

## [Assignment due soon i need help pls](https://discourse.processing.org/t/assignment-due-soon-i-need-help-pls/2904)

<div class="topic-metadata">

**Author:** [@codinghelppls12009](https://discourse.processing.org/u/codinghelppls12009)\
**Replies:** 8\
**Last updated:** [August 31, 2018, 9:20am UTC](https://discourse.processing.org/t/assignment-due-soon-i-need-help-pls/2904 "2018-08-31T09:20:58Z")

</div>

I have an assignment due and I need help within the next 5 hours. I am desperate pls help me. I will fail,. I feel like it all SHOULD work but it doesn’t. Please help me. What I need help with: my bee picture deletes …

---

## [Problem with DOM button causing site to reload](https://discourse.processing.org/t/problem-with-dom-button-causing-site-to-reload/3086)

<div class="topic-metadata">

**Author:** [@Bitstrips](https://discourse.processing.org/u/Bitstrips)\
**Replies:** 2\
**Last updated:** [August 29, 2018, 1:37am UTC](https://discourse.processing.org/t/problem-with-dom-button-causing-site-to-reload/3086 "2018-08-29T01:37:42Z")

</div>

I’m not sure if the button click is the source but when I submit the numbers the result would dissapear nearly instantly and then dissapear because of the site reloading. I want a result to show up at the output class. I …

---

## [Saving canvas in PDF](https://discourse.processing.org/t/saving-canvas-in-pdf/3025)

<div class="topic-metadata">

**Author:** [@HEX0x6C](https://discourse.processing.org/u/HEX0x6C)\
**Replies:** 9\
**Last updated:** [August 28, 2018, 6:24am UTC](https://discourse.processing.org/t/saving-canvas-in-pdf/3025 "2018-08-28T06:24:05Z")

</div>

I need to save a vector graphics version of the canvas in p5.js. Is there something like library processing.pdf.\* in p5.js? Hope so.

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

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