# p5.js

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

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

**Page:** 98

---

## [CreateCapture(VIDEO)](https://discourse.processing.org/t/createcapture-video/9812)

<div class="topic-metadata">

**Author:** [@vidasdemo](https://discourse.processing.org/u/vidasdemo)\
**Replies:** 0\
**Last updated:** [March 31, 2019, 4:59pm UTC](https://discourse.processing.org/t/createcapture-video/9812 "2019-03-31T16:59:55Z")

</div>

irrespective of what webcam I use CreateCapture always returns a video of size 300 by 150 when using p5.js web editor. Although I can use the size function to change the display size it seems that image function still ex…

---

## [P5.js TWO\_PI not working?](https://discourse.processing.org/t/p5-js-two-pi-not-working/9439)

<div class="topic-metadata">

**Author:** [@Code\_Caffeine](https://discourse.processing.org/u/Code_Caffeine)\
**Replies:** 3\
**Last updated:** [March 31, 2019, 4:39pm UTC](https://discourse.processing.org/t/p5-js-two-pi-not-working/9439 "2019-03-31T16:39:05Z")

</div>

I am trying to make a clock in p5.js after watching the Coding Train video on the topic. However, when I try to create an arc, the angle TWO\_PI produces no output, where I expect a full circle. Every other angle I have t…

---

## [Hex color in p5js web editor](https://discourse.processing.org/t/hex-color-in-p5js-web-editor/9762)

<div class="topic-metadata">

**Author:** [@Leo\_Aguiar](https://discourse.processing.org/u/Leo_Aguiar)\
**Replies:** 6\
**Last updated:** [March 31, 2019, 3:43pm UTC](https://discourse.processing.org/t/hex-color-in-p5js-web-editor/9762 "2019-03-31T15:43:27Z")

</div>

Hi forum, Why does this not work in the p5js web editor? function setup() { createCanvas(400, 400); } function draw() { background(220); let c1 = color('#f92804'); fill(c1); rect(width/2,height/2,50,50); …

---

## [Adjust pixels array but don't render on screen p5 js](https://discourse.processing.org/t/adjust-pixels-array-but-dont-render-on-screen-p5-js/9643)

<div class="topic-metadata">

**Author:** [@Milky](https://discourse.processing.org/u/Milky)\
**Replies:** 5\
**Last updated:** [March 31, 2019, 3:23pm UTC](https://discourse.processing.org/t/adjust-pixels-array-but-dont-render-on-screen-p5-js/9643 "2019-03-31T15:23:23Z")

</div>

Hello, I want to train a neural network, which will use the pixels array as input but I don’t want it to constantly render it while I am training it. Is it possible to not render any of the lines and vertices I drew but…

---

## [Disintegration/perish effect in p5.js](https://discourse.processing.org/t/disintegration-perish-effect-in-p5-js/9744)

<div class="topic-metadata">

**Author:** [@blkpanther](https://discourse.processing.org/u/blkpanther)\
**Replies:** 2\
**Last updated:** [March 31, 2019, 12:36pm UTC](https://discourse.processing.org/t/disintegration-perish-effect-in-p5-js/9744 "2019-03-31T12:36:09Z")

</div>

Is there any way to make any shape in p5.js disintegrate into particles or turn into ashes? Or is there any sample code that shows a similar effect where the original object or image perish? Alternatively any libraries t…

---

## [\[SOLVED\] P5js check if tiles are the same color](https://discourse.processing.org/t/solved-p5js-check-if-tiles-are-the-same-color/8832)

<div class="topic-metadata">

**Author:** [@ZachMcMkay](https://discourse.processing.org/u/ZachMcMkay)\
**Replies:** 15\
**Last updated:** [March 31, 2019, 11:32am UTC](https://discourse.processing.org/t/solved-p5js-check-if-tiles-are-the-same-color/8832 "2019-03-31T11:32:41Z")

</div>

I’m creating a short program that can randomize tiles to alternate white, then a random color from a set of 8 specific colors. However what i want to add to this is a way to check if the tiles around it are the same col…

---

## [Print object names in red or blue](https://discourse.processing.org/t/print-object-names-in-red-or-blue/9778)

<div class="topic-metadata">

**Author:** [@pawlisko](https://discourse.processing.org/u/pawlisko)\
**Replies:** 3\
**Last updated:** [March 30, 2019, 3:20pm UTC](https://discourse.processing.org/t/print-object-names-in-red-or-blue/9778 "2019-03-30T15:20:14Z")

</div>

My professor assigned this assignment and I just can’t figure out how to do it. Can anyone help me out or at least give me a head start. I’ve been trying to figure it out all day today and I get more and more confused. T…

---

## [Add Libraries to p5.js Web Editor](https://discourse.processing.org/t/add-libraries-to-p5-js-web-editor/9756)

<div class="topic-metadata">

**Author:** [@ChipAnyanwu](https://discourse.processing.org/u/ChipAnyanwu)\
**Replies:** 3\
**Last updated:** [March 29, 2019, 2:04pm UTC](https://discourse.processing.org/t/add-libraries-to-p5-js-web-editor/9756 "2019-03-29T14:04:27Z")

</div>

Hello Everyone! I have a quick question about the p5.js web editor. I’m trying to make a project that utilizes the p5.play library and I wanted to use the p5 web editor to do so. I imported the library file and referenc…

---

## [Doubts regarding pose estimation on 2D video using posenet?](https://discourse.processing.org/t/doubts-regarding-pose-estimation-on-2d-video-using-posenet/9675)

<div class="topic-metadata">

**Author:** [@basicvisual](https://discourse.processing.org/u/basicvisual)\
**Replies:** 2\
**Last updated:** [March 29, 2019, 8:23am UTC](https://discourse.processing.org/t/doubts-regarding-pose-estimation-on-2d-video-using-posenet/9675 "2019-03-29T08:23:32Z")

</div>

Hello I have been playing with the pre trained model for posenet . I had a general question, I tried to do pose estimation on a random video . I seem to get results totally where the skeleton is drawn totally off the hu…

---

## [P5.js issue - "bullet.push is not a function"](https://discourse.processing.org/t/p5-js-issue-bullet-push-is-not-a-function/9677)

<div class="topic-metadata">

**Author:** [@torridger](https://discourse.processing.org/u/torridger)\
**Replies:** 4\
**Last updated:** [March 28, 2019, 4:06am UTC](https://discourse.processing.org/t/p5-js-issue-bullet-push-is-not-a-function/9677 "2019-03-28T04:06:22Z")

</div>

Hi there, trying to follow this tutorial by TheCodingTrain on YouTube with some modification: I keep getting the error “bullet.push is not a function”. Any help is much appreciated. Please see my sketch.…

---

## [Run p5js with Parcel](https://discourse.processing.org/t/run-p5js-with-parcel/9681)

<div class="topic-metadata">

**Author:** [@Lotas94](https://discourse.processing.org/u/Lotas94)\
**Replies:** 6\
**Last updated:** [March 28, 2019, 4:06am UTC](https://discourse.processing.org/t/run-p5js-with-parcel/9681 "2019-03-28T04:06:00Z")

</div>

Hi there, I’m trying to run a script based on p5js library, it works well in a classic file (index.html, css, and scripts) but if I run this with parcel (npm run dev), there are no errors but the elements expected are n…

---

## [Loading a video stored locally on the PC](https://discourse.processing.org/t/loading-a-video-stored-locally-on-the-pc/9646)

<div class="topic-metadata">

**Author:** [@basicvisual](https://discourse.processing.org/u/basicvisual)\
**Replies:** 6\
**Last updated:** [March 27, 2019, 1:27pm UTC](https://discourse.processing.org/t/loading-a-video-stored-locally-on-the-pc/9646 "2019-03-27T13:27:47Z")

</div>

Hello , I am trying to load a video to the canvas which is stored locally . I went to the drop down menu and uploaded a small video , named test.mp4. I used the example code to run the video but i seem to get a blank s…

---

## [GL\_INVALID\_OPERATION when reusing shader](https://discourse.processing.org/t/gl-invalid-operation-when-reusing-shader/9659)

<div class="topic-metadata">

**Author:** [@ahihi](https://discourse.processing.org/u/ahihi)\
**Replies:** 3\
**Last updated:** [March 27, 2019, 10:33am UTC](https://discourse.processing.org/t/gl-invalid-operation-when-reusing-shader/9659 "2019-03-27T10:33:53Z")

</div>

hello, i’m trying to implement a separable gaussian blur using fragment shaders, as described in https://github.com/Jam3/glsl-fast-gaussian-blur my code is at https://owo.uwu.fi/p5blur/ basically, the idea is to perfo…

---

## [Placement of sliders outside canvas](https://discourse.processing.org/t/placement-of-sliders-outside-canvas/9631)

<div class="topic-metadata">

**Author:** [@mpsteenstrup](https://discourse.processing.org/u/mpsteenstrup)\
**Replies:** 8\
**Last updated:** [March 27, 2019, 9:04am UTC](https://discourse.processing.org/t/placement-of-sliders-outside-canvas/9631 "2019-03-27T09:04:53Z")

</div>

Hi i am trying to place sliders directly under the canvas, but other text added to html keep getting in between. Does anyone have a solution to keep the sliders and buttons next to the canvas? the problem is visible her…

---

## [Multiple Key Inputs](https://discourse.processing.org/t/multiple-key-inputs/9662)

<div class="topic-metadata">

**Author:** [@Samira](https://discourse.processing.org/u/Samira)\
**Replies:** 3\
**Last updated:** [March 27, 2019, 12:10am UTC](https://discourse.processing.org/t/multiple-key-inputs/9662 "2019-03-27T00:10:22Z")

</div>

I’m trying to create a game where two people move at once. I’ve realised that you can’t have more than one key input at a time which makes my idea impossible. I was wondering if there was a way where I could have more th…

---

## [Create input accept numbers only](https://discourse.processing.org/t/create-input-accept-numbers-only/9624)

<div class="topic-metadata">

**Author:** [@d0nk](https://discourse.processing.org/u/d0nk)\
**Replies:** 2\
**Last updated:** [March 26, 2019, 10:52am UTC](https://discourse.processing.org/t/create-input-accept-numbers-only/9624 "2019-03-26T10:52:08Z")

</div>

Hello! I am new to P5js, trying to work with DOM library to accept number as user input. Is there a way to restrict the input box to accept numbers only as input?

---

## [glitchP5 library no download links found](https://discourse.processing.org/t/glitchp5-library-no-download-links-found/9621)

<div class="topic-metadata">

**Author:** [@clicksandpops](https://discourse.processing.org/u/clicksandpops)\
**Replies:** 6\
**Last updated:** [March 26, 2019, 12:00am UTC](https://discourse.processing.org/t/glitchp5-library-no-download-links-found/9621 "2019-03-26T00:00:18Z")

</div>

Hello folks looking for this library and unfortunately it is nowhere to be found! Any suggestions?

---

## [@types/p5 not find like class in typeScript](https://discourse.processing.org/t/types-p5-not-find-like-class-in-typescript/9475)

<div class="topic-metadata">

**Author:** [@Stanlepunk](https://discourse.processing.org/u/Stanlepunk)\
**Replies:** 5\
**Last updated:** [March 24, 2019, 9:29am UTC](https://discourse.processing.org/t/types-p5-not-find-like-class-in-typescript/9475 "2019-03-24T09:29:09Z")

</div>

I download the last version of P5 types for TypeScript. I place it in the node folder, when I use importation the folder is detected but after when I try to implement p5 in the class, Sublim Text say the class is not fo…

---

## [Using right mouse -- without context menu?](https://discourse.processing.org/t/using-right-mouse-without-context-menu/9379)

<div class="topic-metadata">

**Author:** [@Convict999](https://discourse.processing.org/u/Convict999)\
**Replies:** 4\
**Last updated:** [March 22, 2019, 10:56pm UTC](https://discourse.processing.org/t/using-right-mouse-without-context-menu/9379 "2019-03-22T22:56:38Z")

</div>

Has anyone got an example of how to override the browser right click function in the preview window? It looks possible, but the thread i found isnt clear enough for my knowledge level. My code to check the rmb press se…

---

## [Uploading a text file to a server/URL](https://discourse.processing.org/t/uploading-a-text-file-to-a-server-url/9350)

<div class="topic-metadata">

**Author:** [@Schred](https://discourse.processing.org/u/Schred)\
**Replies:** 16\
**Last updated:** [March 22, 2019, 7:22pm UTC](https://discourse.processing.org/t/uploading-a-text-file-to-a-server-url/9350 "2019-03-22T19:22:20Z")

</div>

Hi! Before we start this: I have zero knowledge of webprogramming whatsoever. Sounds like this is going to be fun? Great! :stuck\_out\_tongue: Ok but honestly: I don’t know how complicated my question really is and whethe…

---

## [Need help. Cannot find why tests are failing](https://discourse.processing.org/t/need-help-cannot-find-why-tests-are-failing/9528)

<div class="topic-metadata">

**Author:** [@abhinavsagar](https://discourse.processing.org/u/abhinavsagar)\
**Replies:** 3\
**Last updated:** [March 22, 2019, 3:24pm UTC](https://discourse.processing.org/t/need-help-cannot-find-why-tests-are-failing/9528 "2019-03-22T15:24:20Z")

</div>

Can someone tell me why my tests are are failing at this PR https://github.com/processing/p5.js/pull/3633

---

## [P5 Project Questions](https://discourse.processing.org/t/p5-project-questions/9520)

<div class="topic-metadata">

**Author:** [@ixd](https://discourse.processing.org/u/ixd)\
**Replies:** 2\
**Last updated:** [March 22, 2019, 5:27am UTC](https://discourse.processing.org/t/p5-project-questions/9520 "2019-03-22T05:27:19Z")

</div>

So I managed to upload MP3 files to the online editor, but I can’t figure out how to make them play when I click on an ellipse… I got the first one to play when I click on the first ellipse, but I can’t figure out how to…

---

## [Creating a screensaver with P5.js](https://discourse.processing.org/t/creating-a-screensaver-with-p5-js/261)

<div class="topic-metadata">

**Author:** [@spacewarper](https://discourse.processing.org/u/spacewarper)\
**Replies:** 11\
**Last updated:** [March 22, 2019, 1:13am UTC](https://discourse.processing.org/t/creating-a-screensaver-with-p5-js/261 "2019-03-22T01:13:43Z")

</div>

While I have found some general frameworks that allow packaging HTML5 code into a screensaver, most of which based on WebKit, I would like this thread to be a point of information gathering and discussion about all best …

---

## [How to draw 3d spiral in p5.js in 2d without webgl or any 3D engine](https://discourse.processing.org/t/how-to-draw-3d-spiral-in-p5-js-in-2d-without-webgl-or-any-3d-engine/9339)

<div class="topic-metadata">

**Author:** [@blkpanther](https://discourse.processing.org/u/blkpanther)\
**Replies:** 9\
**Last updated:** [March 22, 2019, 12:15am UTC](https://discourse.processing.org/t/how-to-draw-3d-spiral-in-p5-js-in-2d-without-webgl-or-any-3d-engine/9339 "2019-03-22T00:15:29Z")

</div>

I intend to draw spirals in the shape of a 3d spring, as in the doodle below. How can I do that through trigonometry without 3d engines like webgl? Thanks!

---

## [Have a text follow a Bezier curve](https://discourse.processing.org/t/have-a-text-follow-a-bezier-curve/9399)

<div class="topic-metadata">

**Author:** [@sevaus](https://discourse.processing.org/u/sevaus)\
**Replies:** 5\
**Last updated:** [March 21, 2019, 11:59pm UTC](https://discourse.processing.org/t/have-a-text-follow-a-bezier-curve/9399 "2019-03-21T23:59:54Z")

</div>

Hello, I have some Bezier curves that represent the transitions of automata: https://imgur.com/a/aOsZvtZ These Bezier curves are draggable: https://imgur.com/DycuyKP I want to have the text follow the Bezier curve whe…

---

## [Mouse precision and smooth drawing](https://discourse.processing.org/t/mouse-precision-and-smooth-drawing/9444)

<div class="topic-metadata">

**Author:** [@slowking](https://discourse.processing.org/u/slowking)\
**Replies:** 2\
**Last updated:** [March 21, 2019, 10:10pm UTC](https://discourse.processing.org/t/mouse-precision-and-smooth-drawing/9444 "2019-03-21T22:10:27Z")

</div>

Helllo! In p5.js you have access to two sets of variables related to mouse position - mouseX/mouseY and pmouseX/pmouseY. I try to make an app where an user can draw some thing on the screen using mouse or drawing tablet…

---

## [Helping Tool for Educators](https://discourse.processing.org/t/helping-tool-for-educators/9321)

<div class="topic-metadata">

**Author:** [@janglee](https://discourse.processing.org/u/janglee)\
**Replies:** 7\
**Last updated:** [March 20, 2019, 4:30pm UTC](https://discourse.processing.org/t/helping-tool-for-educators/9321 "2019-03-20T16:30:47Z")

</div>

Hello you all, p5.js is a library and set of tools that make it easy to use the JavaScript programming language for creative coding and heavily used for teaching purposes. One thing I find missing is that explaining sk…

---

## [touchEnded() clicks twice](https://discourse.processing.org/t/touchended-clicks-twice/9263)

<div class="topic-metadata">

**Author:** [@antocreo](https://discourse.processing.org/u/antocreo)\
**Replies:** 2\
**Last updated:** [March 19, 2019, 12:14pm UTC](https://discourse.processing.org/t/touchended-clicks-twice/9263 "2019-03-19T12:14:09Z")

</div>

Hi everyone, I am having some problem with touchEnded() function. I am using it to switch from a case to another and it works fine with the mouse on laptop. However, if I use a tablet it seems that the touch lasts lon…

---

## [Troubles with variables](https://discourse.processing.org/t/troubles-with-variables/9383)

<div class="topic-metadata">

**Author:** [@Raidzor](https://discourse.processing.org/u/Raidzor)\
**Replies:** 2\
**Last updated:** [March 18, 2019, 3:26pm UTC](https://discourse.processing.org/t/troubles-with-variables/9383 "2019-03-18T15:26:23Z")

</div>

Being a beginner, I struggle to understand the structure you have to put variables in to actually make them work. Let’s suppose I have to create an object, an ellipse, that moves with constant speed, or even acceleration…

---

## [Storing PGraphics to List of Images?](https://discourse.processing.org/t/storing-pgraphics-to-list-of-images/9391)

<div class="topic-metadata">

**Author:** [@FSXAC](https://discourse.processing.org/u/FSXAC)\
**Replies:** 2\
**Last updated:** [March 18, 2019, 12:38am UTC](https://discourse.processing.org/t/storing-pgraphics-to-list-of-images/9391 "2019-03-18T00:38:18Z")

</div>

Hi all, I want to “pre-render” some PGraphics to a list of images, what is the function to copy the PImage as an image (similar to how image() treats PGraphics as parameter as an image). Here is what I want to do in co…

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

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