# Beginners

**URL:** https://discourse.processing.org/c/p5js/p5js-beginners/16.md?page=5

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

**Page:** 6

---

## [How to remove a sketch](https://discourse.processing.org/t/how-to-remove-a-sketch/36164)

<div class="topic-metadata">

**Author:** [@MPROCD](https://discourse.processing.org/u/MPROCD)\
**Replies:** 3\
**Last updated:** [April 7, 2022, 8:23am UTC](https://discourse.processing.org/t/how-to-remove-a-sketch/36164 "2022-04-07T08:23:33Z")

</div>

Hello I am new to the open processing with p5.js. I wrote several sketches about the same topic and I want to remove part of them. How do I delete a sketch in that environment? Thanks

---

## [Uncaught ReferenceError: createRadio is not defined](https://discourse.processing.org/t/uncaught-referenceerror-createradio-is-not-defined/36075)

<div class="topic-metadata">

**Author:** [@Omri](https://discourse.processing.org/u/Omri)\
**Replies:** 4\
**Last updated:** [April 2, 2022, 1:00pm UTC](https://discourse.processing.org/t/uncaught-referenceerror-createradio-is-not-defined/36075 "2022-04-02T13:00:26Z")

</div>

Hey, I’m trying to use the createRadio() function, but I get this error: Uncaught ReferenceError: createRadio is not defined at setup (p5js-temp-sketch\_220402a1584838079584472986.js:4:3) at m.\<anonymous\> (p5.min…

---

## [Fragment shaders need width and height multiplied by pixelDensity()](https://discourse.processing.org/t/fragment-shaders-need-width-and-height-multiplied-by-pixeldensity/36045)

<div class="topic-metadata">

**Author:** [@DaveH](https://discourse.processing.org/u/DaveH)\
**Replies:** 1\
**Last updated:** [March 31, 2022, 12:38pm UTC](https://discourse.processing.org/t/fragment-shaders-need-width-and-height-multiplied-by-pixeldensity/36045 "2022-03-31T12:38:15Z")

</div>

I’ve spent days trying to figure out why my rendering was off on my Android phone. Then I realised I was fixing things for the Windows computer I’m writing on had 150% scaling. Which means it was broken elsewhere. And …

---

## [Undefined Error](https://discourse.processing.org/t/undefined-error/36023)

<div class="topic-metadata">

**Author:** [@throwaway](https://discourse.processing.org/u/throwaway)\
**Replies:** 2\
**Last updated:** [March 30, 2022, 3:22pm UTC](https://discourse.processing.org/t/undefined-error/36023 "2022-03-30T15:22:14Z")

</div>

Here is my code. /\*eslint-env es6\*/ const button = document.querySelector('button') const body = document.querySelector('body') const colors = getRandomColor() body.style.backgroundColor = 'violet' button.addEventListe…

---

## [P5 convert to Processing problem](https://discourse.processing.org/t/p5-convert-to-processing-problem/36018)

<div class="topic-metadata">

**Author:** [@AbleYudada](https://discourse.processing.org/u/AbleYudada)\
**Replies:** 2\
**Last updated:** [March 30, 2022, 2:19pm UTC](https://discourse.processing.org/t/p5-convert-to-processing-problem/36018 "2022-03-30T14:19:09Z")

</div>

hello guys! Recently I am rewriting a p5js code to Processing but there is a strange problem. I have checked that the data is normal, but Processing cannot update the status of the screen in real time. It seems that the…

---

## [Token Error: Colors](https://discourse.processing.org/t/token-error-colors/36000)

<div class="topic-metadata">

**Author:** [@throwaway](https://discourse.processing.org/u/throwaway)\
**Replies:** 2\
**Last updated:** [March 30, 2022, 11:27am UTC](https://discourse.processing.org/t/token-error-colors/36000 "2022-03-30T11:27:02Z")

</div>

Here is my code /\*eslint-env es6\*/ const button = document.querySelector('button') const body = document.querySelector('body') const colors = getRandomColor() body.style.backgroundColor = 'violet' button.addEventListen…

---

## [WebGL alpha can't be used as a texture](https://discourse.processing.org/t/webgl-alpha-cant-be-used-as-a-texture/35981)

<div class="topic-metadata">

**Author:** [@DaveH](https://discourse.processing.org/u/DaveH)\
**Replies:** 3\
**Last updated:** [March 30, 2022, 5:48am UTC](https://discourse.processing.org/t/webgl-alpha-cant-be-used-as-a-texture/35981 "2022-03-30T05:48:56Z")

</div>

Hi, I’m using WebGL as a createGraphics object for rendering a texture. My fragment shader uses the alpha channel in gl\_FragColor for a smooth cut-out. I want to render the webGL context using this alpha channel, but i…

---

## [Masking several polygons](https://discourse.processing.org/t/masking-several-polygons/35718)

<div class="topic-metadata">

**Author:** [@ricardgarcia](https://discourse.processing.org/u/ricardgarcia)\
**Replies:** 2\
**Last updated:** [March 16, 2022, 8:02am UTC](https://discourse.processing.org/t/masking-several-polygons/35718 "2022-03-16T08:02:38Z")

</div>

Hey there, I’m a bit new to creative coding and even more using p5js. I’m currently working on a sketch in which I need to mask a letter several times (several rows and a cut letter inside) in the canvas. I was approac…

---

## [Install P5. js mode for all user in a computer](https://discourse.processing.org/t/install-p5-js-mode-for-all-user-in-a-computer/35178)

<div class="topic-metadata">

**Author:** [@Yingyi](https://discourse.processing.org/u/Yingyi)\
**Replies:** 2\
**Last updated:** [March 15, 2022, 6:34am UTC](https://discourse.processing.org/t/install-p5-js-mode-for-all-user-in-a-computer/35178 "2022-03-15T06:34:24Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Good Day! This is IT technician, I am install Processing 4 in our Mac Computer Lab, and install P5.js mode by click " Add mode" button locates …

---

## [My P5.js software doesn't run anymore, please help!](https://discourse.processing.org/t/my-p5-js-software-doesnt-run-anymore-please-help/35678)

<div class="topic-metadata">

**Author:** [@blom.faes](https://discourse.processing.org/u/blom.faes)\
**Replies:** 2\
**Last updated:** [March 11, 2022, 12:53pm UTC](https://discourse.processing.org/t/my-p5-js-software-doesnt-run-anymore-please-help/35678 "2022-03-11T12:53:31Z")

</div>

I am working on a project, but have accidently clicked some button which linked my “Microsoft Print” software to my Run button(also to the keybind). So everytime I try to run my software this windows tab opens up …

---

## [\[p5.js\] I don't know how to make it into a p5 file](https://discourse.processing.org/t/p5-js-i-dont-know-how-to-make-it-into-a-p5-file/35187)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 5\
**Last updated:** [February 16, 2022, 6:41pm UTC](https://discourse.processing.org/t/p5-js-i-dont-know-how-to-make-it-into-a-p5-file/35187 "2022-02-16T18:41:56Z")

</div>

LINK : Sea life sketch sketch - jagracar Looking at the above, You can see that it was made with p5. Based on the above, I am trying to save it as p5.js using ‘Processing’. File: WEB\_FISH\_TEST.zip - Google Driv…

---

## [Sketch conversion Processing to p5.js](https://discourse.processing.org/t/sketch-conversion-processing-to-p5-js/35037)

<div class="topic-metadata">

**Author:** [@CoPiQuMi](https://discourse.processing.org/u/CoPiQuMi)\
**Replies:** 4\
**Last updated:** [February 8, 2022, 4:58pm UTC](https://discourse.processing.org/t/sketch-conversion-processing-to-p5-js/35037 "2022-02-08T16:58:23Z")

</div>

Hi everyone, My apologies if my message may no respect some of the rules of the community, this is my first one. I’ll try to do my best ! I’m trying to convert the following processing sketch to p5.js, I think I manage…

---

## [How to access main p5.Renderer object?](https://discourse.processing.org/t/how-to-access-main-p5-renderer-object/34951)

<div class="topic-metadata">

**Author:** [@benjaminmarkus](https://discourse.processing.org/u/benjaminmarkus)\
**Replies:** 1\
**Last updated:** [February 6, 2022, 12:42am UTC](https://discourse.processing.org/t/how-to-access-main-p5-renderer-object/34951 "2022-02-06T00:42:55Z")

</div>

Is there a way to refer to the main p5.Renderer object that draws to the canvas in a way one would refer to an object created with createGraphics()? An example: //how it works when you created a Renderer: var myRenderer…

---

## [How do I load images?](https://discourse.processing.org/t/how-do-i-load-images/34965)

<div class="topic-metadata">

**Author:** [@tazrXxx](https://discourse.processing.org/u/tazrXxx)\
**Replies:** 27\
**Last updated:** [February 4, 2022, 6:13am UTC](https://discourse.processing.org/t/how-do-i-load-images/34965 "2022-02-04T06:13:08Z")

</div>

Hi! I was researching Javascript libraries and I found p5.js. It looks simple and easy, so I decided to try it out. So I made this little code snippet where it should just put up an image on the screen, but for some rea…

---

## [Setting alpha for a point in HSB mode](https://discourse.processing.org/t/setting-alpha-for-a-point-in-hsb-mode/34959)

<div class="topic-metadata">

**Author:** [@goldorak](https://discourse.processing.org/u/goldorak)\
**Replies:** 1\
**Last updated:** [February 4, 2022, 12:57am UTC](https://discourse.processing.org/t/setting-alpha-for-a-point-in-hsb-mode/34959 "2022-02-04T00:57:54Z")

</div>

Hi, I’m trying to change randomly the alpha setting of a point. Here is a summary of my code strokeWeight(10); c = color(0,0,0); c.setAlpha(random(10)); stroke(c); point(i,j); I can’t get any kind of graduat…

---

## [Code is not executed in Processing, but in p5.js Web Editor](https://discourse.processing.org/t/code-is-not-executed-in-processing-but-in-p5-js-web-editor/34867)

<div class="topic-metadata">

**Author:** [@Master\_Kneater](https://discourse.processing.org/u/Master_Kneater)\
**Replies:** 21\
**Last updated:** [February 2, 2022, 10:08am UTC](https://discourse.processing.org/t/code-is-not-executed-in-processing-but-in-p5-js-web-editor/34867 "2022-02-02T10:08:44Z")

</div>

Hello everyone, as the title suggests I am having a problem running my javascript code in Processing. However, if I copy this code into the p5.js web editor (https://editor.p5js.org/) the code works without problems. I u…

---

## [About loadImage() method](https://discourse.processing.org/t/about-loadimage-method/34814)

<div class="topic-metadata">

**Author:** [@MoathJ](https://discourse.processing.org/u/MoathJ)\
**Replies:** 8\
**Last updated:** [January 26, 2022, 7:41am UTC](https://discourse.processing.org/t/about-loadimage-method/34814 "2022-01-26T07:41:25Z")

</div>

Hi!! I have faced a problem in loadImage() function, which the p5.js editor doesn’t load a photos by there url, this is the code. function setup() { createCanvas(120, 120); } function draw() { let gender = “Female”…

---

## [Despite translation my square isn't rotating properly](https://discourse.processing.org/t/despite-translation-my-square-isnt-rotating-properly/34831)

<div class="topic-metadata">

**Author:** [@goldorak](https://discourse.processing.org/u/goldorak)\
**Replies:** 2\
**Last updated:** [January 25, 2022, 11:52am UTC](https://discourse.processing.org/t/despite-translation-my-square-isnt-rotating-properly/34831 "2022-01-25T11:52:25Z")

</div>

Hi, I’ve been struggling with rotating my squares. My rectmode is centered and I use degrees. I also understood I need to use translation as well but my square isn’t rotating properly. Here is my very simple code fun…

---

## [Unable to get console output with p5.js mode in Processing IDE](https://discourse.processing.org/t/unable-to-get-console-output-with-p5-js-mode-in-processing-ide/34691)

<div class="topic-metadata">

**Author:** [@svan](https://discourse.processing.org/u/svan)\
**Replies:** 10\
**Last updated:** [January 21, 2022, 7:54am UTC](https://discourse.processing.org/t/unable-to-get-console-output-with-p5-js-mode-in-processing-ide/34691 "2022-01-21T07:54:36Z")

</div>

For some reason I am unable to get console output in Processing using p5.js mode. Nothing shows up in the Processing window or in the web output screen. function setup() { createCanvas(400, 400); background(220); …

---

## [How do i use 2 loops to place a image in each circles?](https://discourse.processing.org/t/how-do-i-use-2-loops-to-place-a-image-in-each-circles/34723)

<div class="topic-metadata">

**Author:** [@Anjel](https://discourse.processing.org/u/Anjel)\
**Replies:** 1\
**Last updated:** [January 19, 2022, 9:59am UTC](https://discourse.processing.org/t/how-do-i-use-2-loops-to-place-a-image-in-each-circles/34723 "2022-01-19T09:59:32Z")

</div>

I am suppose to insert a image in each circle, which to my understanding i could use this to make a grid for (var j = 0; j \< 4; j++ ) { for (var i=0; i \< 8; i++ ){ image(item, 467 + (i \* 70), 331 + (j \* 60)); } } i…

---

## [How to stop a p5js script from looping print()](https://discourse.processing.org/t/how-to-stop-a-p5js-script-from-looping-print/34705)

<div class="topic-metadata">

**Author:** [@Ruimao96](https://discourse.processing.org/u/Ruimao96)\
**Replies:** 1\
**Last updated:** [January 18, 2022, 3:55am UTC](https://discourse.processing.org/t/how-to-stop-a-p5js-script-from-looping-print/34705 "2022-01-18T03:55:50Z")

</div>

so I accidentally put print() in my script and it start trying to save the picture nonstop. How do I stop this? of course I know how using noloop can make draw only run once, but that is not my question. If the saving ta…

---

## [How to change name of tab in openprocessing.org IDE?](https://discourse.processing.org/t/how-to-change-name-of-tab-in-openprocessing-org-ide/34676)

<div class="topic-metadata">

**Author:** [@kenjones](https://discourse.processing.org/u/kenjones)\
**Replies:** 2\
**Last updated:** [January 17, 2022, 5:10pm UTC](https://discourse.processing.org/t/how-to-change-name-of-tab-in-openprocessing-org-ide/34676 "2022-01-17T17:10:52Z")

</div>

I know how to create a new tab in the openprocessing.org IDE by clicking the button labeled “+” to the right of the names of the tabs above the code editor. But, by default, the tabs are named “tabx”, where “x” is a nume…

---

## [How to save a sketch a local image or a font?](https://discourse.processing.org/t/how-to-save-a-sketch-a-local-image-or-a-font/34672)

<div class="topic-metadata">

**Author:** [@Pierre1](https://discourse.processing.org/u/Pierre1)\
**Replies:** 11\
**Last updated:** [January 17, 2022, 2:47pm UTC](https://discourse.processing.org/t/how-to-save-a-sketch-a-local-image-or-a-font/34672 "2022-01-17T14:47:17Z")

</div>

After Submit and Save (which work well) , I can’t see how to upload either an image or a font.

---

## [Displaying an image web-editor openprocessing.org](https://discourse.processing.org/t/displaying-an-image-web-editor-openprocessing-org/34563)

<div class="topic-metadata">

**Author:** [@kenjones](https://discourse.processing.org/u/kenjones)\
**Replies:** 36\
**Last updated:** [January 13, 2022, 5:58am UTC](https://discourse.processing.org/t/displaying-an-image-web-editor-openprocessing-org/34563 "2022-01-13T05:58:04Z")

</div>

I am simply trying to display an image and I’m not getting what I expect. The 1624 × 1934 image is displayed as a small brown square in the middle of the screen. I have two questions: Why isn’t the image displayed in t…

---

## [Split function overrides string.split?](https://discourse.processing.org/t/split-function-overrides-string-split/34518)

<div class="topic-metadata">

**Author:** [@Errorbot1122](https://discourse.processing.org/u/Errorbot1122)\
**Replies:** 1\
**Last updated:** [January 8, 2022, 12:05am UTC](https://discourse.processing.org/t/split-function-overrides-string-split/34518 "2022-01-08T00:05:31Z")

</div>

For some reason every time, when I tried to use the string.split() function, but it says this error. TypeError: Cannot read properties of undefined (reading 'split') Did you just try to use p5.js's split() function? If …

---

## [How to use size() function on external canvas](https://discourse.processing.org/t/how-to-use-size-function-on-external-canvas/34493)

<div class="topic-metadata">

**Author:** [@Errorbot1122](https://discourse.processing.org/u/Errorbot1122)\
**Replies:** 1\
**Last updated:** [January 7, 2022, 2:51am UTC](https://discourse.processing.org/t/how-to-use-size-function-on-external-canvas/34493 "2022-01-07T02:51:22Z")

</div>

I currently want to use the size() method on an external canvas, but I’m worried the size function will change the CSS W/H instead of the W/H attribute itself. almost like this: webglCanvas = select('#mainViewport'); w…

---

## [Same shader, multiple graphics?](https://discourse.processing.org/t/same-shader-multiple-graphics/34427)

<div class="topic-metadata">

**Author:** [@modusponens](https://discourse.processing.org/u/modusponens)\
**Replies:** 2\
**Last updated:** [January 4, 2022, 6:38am UTC](https://discourse.processing.org/t/same-shader-multiple-graphics/34427 "2022-01-04T06:38:49Z")

</div>

Is it possible for more than one graphics object to use the same shader? In this sketch here, I would expect two squares to be drawn, a yellow one on the left and a blue on the right, but only the yellow one appears: A…

---

## [All new to this trying to understand](https://discourse.processing.org/t/all-new-to-this-trying-to-understand/34429)

<div class="topic-metadata">

**Author:** [@visnudeva](https://discourse.processing.org/u/visnudeva)\
**Replies:** 12\
**Last updated:** [January 3, 2022, 7:54am UTC](https://discourse.processing.org/t/all-new-to-this-trying-to-understand/34429 "2022-01-03T07:54:30Z")

</div>

I’m trying to understand something very basic looking at the exemple and trying to modify them but i don’t get it yet. For exemple with the code here: what should i do to get many circles doing the same thing ?

---

## [Creating chalk-like lines](https://discourse.processing.org/t/creating-chalk-like-lines/34411)

<div class="topic-metadata">

**Author:** [@cconsta1](https://discourse.processing.org/u/cconsta1)\
**Replies:** 0\
**Last updated:** [January 1, 2022, 4:39pm UTC](https://discourse.processing.org/t/creating-chalk-like-lines/34411 "2022-01-01T16:39:07Z")

</div>

Hi all! I’m so excited to find out there is a forum for p5.js :slightly\_smiling\_face: So, I’m trying to create something that will look like chalky, sort of vertical lines similar to the attached picture. Using the…

---

## [How to feed curve() an array of points](https://discourse.processing.org/t/how-to-feed-curve-an-array-of-points/34310)

<div class="topic-metadata">

**Author:** [@nsegal](https://discourse.processing.org/u/nsegal)\
**Replies:** 4\
**Last updated:** [December 27, 2021, 9:49am UTC](https://discourse.processing.org/t/how-to-feed-curve-an-array-of-points/34310 "2021-12-27T09:49:52Z")

</div>

I made a DataPoint object that has an x property and a y property. I generated an array of these and now want to draw a curve that takes the array as its argument. I tried something like the following: let s = "" for …

[Previous page](https://discourse.processing.org/c/p5js/p5js-beginners/16.md?page=4)

[Next page](https://discourse.processing.org/c/p5js/p5js-beginners/16.md?page=6)
