# Beginners

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

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

**Page:** 11

---

## [Is there a way to running my P5.js code locally without a webserver?](https://discourse.processing.org/t/is-there-a-way-to-running-my-p5-js-code-locally-without-a-webserver/25284)

<div class="topic-metadata">

**Author:** [@GabrielVinicios](https://discourse.processing.org/u/GabrielVinicios)\
**Replies:** 1\
**Last updated:** [November 8, 2020, 5:07pm UTC](https://discourse.processing.org/t/is-there-a-way-to-running-my-p5-js-code-locally-without-a-webserver/25284 "2020-11-08T17:07:27Z")

</div>

Hi! I am developing some educational games in P5. Soon, I will bring them to you to see. Is there a way to running my P5.js code locally, without a webserver? I tought putting all the libraries (p5.js) and all my js f…

---

## [Function for a still camera? WEBGL](https://discourse.processing.org/t/function-for-a-still-camera-webgl/25249)

<div class="topic-metadata">

**Author:** [@WTnick](https://discourse.processing.org/u/WTnick)\
**Replies:** 1\
**Last updated:** [November 7, 2020, 5:01pm UTC](https://discourse.processing.org/t/function-for-a-still-camera-webgl/25249 "2020-11-07T17:01:48Z")

</div>

Hello! I started programming about a month ago. Anyways I was working on a first-person demo and decided to make it so the mouse would move the camera. To test it out I used cam.pan and made it follow mouseX and mouseY. …

---

## [Where can I find the p5.js library folder for basic sketches to download?](https://discourse.processing.org/t/where-can-i-find-the-p5-js-library-folder-for-basic-sketches-to-download/25239)

<div class="topic-metadata">

**Author:** [@anna\_rose](https://discourse.processing.org/u/anna_rose)\
**Replies:** 2\
**Last updated:** [November 7, 2020, 9:10am UTC](https://discourse.processing.org/t/where-can-i-find-the-p5-js-library-folder-for-basic-sketches-to-download/25239 "2020-11-07T09:10:25Z")

</div>

Hi, I was wondering if someone could help me because whenever I download p5.js complete, the example folder doesn’t include the library. This means that when I edit the text in Brackets(my editor) it doesn’t have any de…

---

## [loadImage() problem / Cross-Origin](https://discourse.processing.org/t/loadimage-problem-cross-origin/24569)

<div class="topic-metadata">

**Author:** [@\_sv\_11](https://discourse.processing.org/u/_sv_11)\
**Replies:** 2\
**Last updated:** [November 3, 2020, 1:43am UTC](https://discourse.processing.org/t/loadimage-problem-cross-origin/24569 "2020-11-03T01:43:13Z")

</div>

Hi @all I want to load data from a weather-api and also i want to load images from my computer. But when i run the code the following error is displayed. (in german) Can someone help me? //-------------------------…

---

## [Difference between "new createVector()" and "createVector()"](https://discourse.processing.org/t/difference-between-new-createvector-and-createvector/25056)

<div class="topic-metadata">

**Author:** [@Jason210](https://discourse.processing.org/u/Jason210)\
**Replies:** 6\
**Last updated:** [October 31, 2020, 5:45pm UTC](https://discourse.processing.org/t/difference-between-new-createvector-and-createvector/25056 "2020-10-31T17:45:17Z")

</div>

Hi Can someone explain in simple terms what the difference is between createVector() and new createVector()? Jason

---

## [Translating Syntax Shorthand for Beginners?](https://discourse.processing.org/t/translating-syntax-shorthand-for-beginners/24995)

<div class="topic-metadata">

**Author:** [@mnoble](https://discourse.processing.org/u/mnoble)\
**Replies:** 21\
**Last updated:** [October 31, 2020, 11:21am UTC](https://discourse.processing.org/t/translating-syntax-shorthand-for-beginners/24995 "2020-10-31T11:21:21Z")

</div>

Hello Team Forum, I found this cool sketch but it is reduced to programming shorthand I have no experience with. I keep trying to format in what I am used but keep failing. t=0,draw=\_=\>{t++||createCanvas(w=720,w)+strok…

---

## [P5.js Text along a curve](https://discourse.processing.org/t/p5-js-text-along-a-curve/25002)

<div class="topic-metadata">

**Author:** [@ucsduni](https://discourse.processing.org/u/ucsduni)\
**Replies:** 3\
**Last updated:** [October 30, 2020, 6:59am UTC](https://discourse.processing.org/t/p5-js-text-along-a-curve/25002 "2020-10-30T06:59:11Z")

</div>

I was wondering how I can turn a string into something that allows for text to be displayed along a curve.

---

## [Why cant I run 2 5pjs sketches on a html website?](https://discourse.processing.org/t/why-cant-i-run-2-5pjs-sketches-on-a-html-website/24806)

<div class="topic-metadata">

**Author:** [@olaf000olaf](https://discourse.processing.org/u/olaf000olaf)\
**Replies:** 6\
**Last updated:** [October 22, 2020, 12:43am UTC](https://discourse.processing.org/t/why-cant-i-run-2-5pjs-sketches-on-a-html-website/24806 "2020-10-22T00:43:50Z")

</div>

I put two script sources but the second one is not showing up, why and how can I fix this? \<!DOCTYPE html\> \<html lang=" \<head\> \<title\>MNCE P5.js2020 Neon Gallery\</title\> \<meta charset="utf-8"\> \<meta name="viewpo…

---

## [I'm trying to run 5p.js code from the example files but it is stuck at "loading..."](https://discourse.processing.org/t/im-trying-to-run-5p-js-code-from-the-example-files-but-it-is-stuck-at-loading/24794)

<div class="topic-metadata">

**Author:** [@olaf000olaf](https://discourse.processing.org/u/olaf000olaf)\
**Replies:** 3\
**Last updated:** [October 21, 2020, 3:05pm UTC](https://discourse.processing.org/t/im-trying-to-run-5p-js-code-from-the-example-files-but-it-is-stuck-at-loading/24794 "2020-10-21T15:05:36Z")

</div>

I’ve double-clicked the index.html file in the example folder that you can download from the p5js website and it’s stuck at loading. I have copy-pasted 51 lines of code from a project I made in open processing into the s…

---

## [About p5.js sketch](https://discourse.processing.org/t/about-p5-js-sketch/24777)

<div class="topic-metadata">

**Author:** [@Imsso](https://discourse.processing.org/u/Imsso)\
**Replies:** 1\
**Last updated:** [October 21, 2020, 7:31am UTC](https://discourse.processing.org/t/about-p5-js-sketch/24777 "2020-10-21T07:31:35Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hi I am trying to use p5.js and have a question about all sketches I make on p5.js editor Is anyone can access to sketches I made? Is there a…

---

## [P5.js help with running the compiled js](https://discourse.processing.org/t/p5-js-help-with-running-the-compiled-js/24781)

<div class="topic-metadata">

**Author:** [@Gyuu](https://discourse.processing.org/u/Gyuu)\
**Replies:** 3\
**Last updated:** [October 21, 2020, 7:00am UTC](https://discourse.processing.org/t/p5-js-help-with-running-the-compiled-js/24781 "2020-10-21T07:00:51Z")

</div>

index.html \<!DOCTYPE html\> \<html lang="en"\> \<head\> \<meta charset="utf-8" /\> \<meta name="viewport" content="width=device-width, initial-scale=1.0"\> \<title\>Sketch\</title\> \<link rel="stylesheet" type="tex…

---

## [A Javascript prototype question](https://discourse.processing.org/t/a-javascript-prototype-question/24699)

<div class="topic-metadata">

**Author:** [@flamo](https://discourse.processing.org/u/flamo)\
**Replies:** 3\
**Last updated:** [October 19, 2020, 8:37am UTC](https://discourse.processing.org/t/a-javascript-prototype-question/24699 "2020-10-19T08:37:14Z")

</div>

I am currently learning on how to use prototype in JS. I am curious about what happened after I extended a prototype and then I store the function as variable. why the console.log gives me a Window object for the canvas?…

---

## [Issue with windowWidth under windowResize for mobile](https://discourse.processing.org/t/issue-with-windowwidth-under-windowresize-for-mobile/24621)

<div class="topic-metadata">

**Author:** [@minirachel](https://discourse.processing.org/u/minirachel)\
**Replies:** 2\
**Last updated:** [October 16, 2020, 5:01pm UTC](https://discourse.processing.org/t/issue-with-windowwidth-under-windowresize-for-mobile/24621 "2020-10-16T17:01:42Z")

</div>

Hi, I’m having difficulty resizing a canvas while using instance mode on mobile view. It looks like the final width it lands on is 3x’s the starting width. I’ve included relevant code below (view full published code here)…

---

## [Print in console](https://discourse.processing.org/t/print-in-console/24650)

<div class="topic-metadata">

**Author:** [@Alcys6](https://discourse.processing.org/u/Alcys6)\
**Replies:** 3\
**Last updated:** [October 16, 2020, 4:54pm UTC](https://discourse.processing.org/t/print-in-console/24650 "2020-10-16T16:54:18Z")

</div>

Hello, It has been quite a while that I used processing hence I have old habits that do not seems to work now. Previoulsy I was used to « print » the content of the variables in the console at the bottom of the screen …

---

## [How to change the state of a checkbox created with createCheckbox()?](https://discourse.processing.org/t/how-to-change-the-state-of-a-checkbox-created-with-createcheckbox/24514)

<div class="topic-metadata">

**Author:** [@sipe40](https://discourse.processing.org/u/sipe40)\
**Replies:** 2\
**Last updated:** [October 11, 2020, 1:06pm UTC](https://discourse.processing.org/t/how-to-change-the-state-of-a-checkbox-created-with-createcheckbox/24514 "2020-10-11T13:06:44Z")

</div>

Hi! I’ve created a checkbox using box1 = createCheckbox('test', true); and I want to be able to change the state of that checkbox. However, box1.elt.checked returns undefined. This seems to be, because box1.elt returns …

---

## [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…

---

## [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…

---

## [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.

---

## [Unable to get JSON file to work in p5.js](https://discourse.processing.org/t/unable-to-get-json-file-to-work-in-p5-js/24116)

<div class="topic-metadata">

**Author:** [@sam101](https://discourse.processing.org/u/sam101)\
**Replies:** 7\
**Last updated:** [September 26, 2020, 7:28am UTC](https://discourse.processing.org/t/unable-to-get-json-file-to-work-in-p5-js/24116 "2020-09-26T07:28:11Z")

</div>

I’m trying to load my p5.js sketch, but the sketch keeps coming up as loading. Then when I check to see, there is an error message saying"Uncaught (in promise) SyntaxError: Unexpected token / in JSON at position 0", whic…

---

## [Canvas not appearing in Div](https://discourse.processing.org/t/canvas-not-appearing-in-div/24008)

<div class="topic-metadata">

**Author:** [@minirachel](https://discourse.processing.org/u/minirachel)\
**Replies:** 2\
**Last updated:** [September 21, 2020, 10:13pm UTC](https://discourse.processing.org/t/canvas-not-appearing-in-div/24008 "2020-09-21T22:13:24Z")

</div>

Hi, I’m brand new. I’m building a project that relies on a section in the middle of the website generating a random output from a list. This is my p5 code: let words = \["stretching", "drink water", "sun" \] function set…

---

## [Error Message Help Pls](https://discourse.processing.org/t/error-message-help-pls/23924)

<div class="topic-metadata">

**Author:** [@BigBigRed](https://discourse.processing.org/u/BigBigRed)\
**Replies:** 2\
**Last updated:** [September 20, 2020, 1:28pm UTC](https://discourse.processing.org/t/error-message-help-pls/23924 "2020-09-20T13:28:11Z")

</div>

I am totally new to p5js. trying (I think) to execute p5js to run locally but get this error message from Windows. any ideas? I have no ideas.

---

## [Loading multiple .tsp or plain .txt files 70+ located in a directory](https://discourse.processing.org/t/loading-multiple-tsp-or-plain-txt-files-70-located-in-a-directory/23908)

<div class="topic-metadata">

**Author:** [@ChipperActual](https://discourse.processing.org/u/ChipperActual)\
**Replies:** 1\
**Last updated:** [September 19, 2020, 5:02pm UTC](https://discourse.processing.org/t/loading-multiple-tsp-or-plain-txt-files-70-located-in-a-directory/23908 "2020-09-19T17:02:53Z")

</div>

Hey All Very green with JS, stuck on how to load/read multiple files located within a directory(over 70 of them) was able to load one with the preload function ‘loadStrings’, any assistance would be much appreciated.

---

## [P5.js loadStrings() error: Fetch API cannot load file](https://discourse.processing.org/t/p5-js-loadstrings-error-fetch-api-cannot-load-file/23842)

<div class="topic-metadata">

**Author:** [@Tsloa](https://discourse.processing.org/u/Tsloa)\
**Replies:** 9\
**Last updated:** [September 14, 2020, 2:13pm UTC](https://discourse.processing.org/t/p5-js-loadstrings-error-fetch-api-cannot-load-file/23842 "2020-09-14T14:13:49Z")

</div>

I am trying to use LoadStrings() in a p5.js and in the console, I get the error “p5.js:60518 Fetch API cannot load file:\[FILENAME\].txt. URL scheme must be “http” or “https” for CORS request.” I googled it and people sai…

---

## [Need help correcting this converted P5.js code](https://discourse.processing.org/t/need-help-correcting-this-converted-p5-js-code/23804)

<div class="topic-metadata">

**Author:** [@coreyep](https://discourse.processing.org/u/coreyep)\
**Replies:** 3\
**Last updated:** [September 13, 2020, 5:52pm UTC](https://discourse.processing.org/t/need-help-correcting-this-converted-p5-js-code/23804 "2020-09-13T17:52:09Z")

</div>

I converted my Java processing code to P5.js, which I pasted below but my notifications box is telling me that I am missing semicolons for “static final let NUM\_LINES = 10;” and all of my “let x\_(let t) {” and “let y\_1(l…

---

## [Empty-example/loading sketches/node-server](https://discourse.processing.org/t/empty-example-loading-sketches-node-server/23739)

<div class="topic-metadata">

**Author:** [@brightbeam](https://discourse.processing.org/u/brightbeam)\
**Replies:** 4\
**Last updated:** [September 10, 2020, 4:19am UTC](https://discourse.processing.org/t/empty-example-loading-sketches-node-server/23739 "2020-09-10T04:19:22Z")

</div>

Hi everyone. I just started a book on p5.js and im trying to run the empty-example included with the complete p5.js dowload and can’t seem to get it to appear in the browser. It loads somewhat because the title appears i…

---

## [blendMode in instance mode](https://discourse.processing.org/t/blendmode-in-instance-mode/23657)

<div class="topic-metadata">

**Author:** [@nikodemd](https://discourse.processing.org/u/nikodemd)\
**Replies:** 9\
**Last updated:** [September 9, 2020, 3:36pm UTC](https://discourse.processing.org/t/blendmode-in-instance-mode/23657 "2020-09-09T15:36:04Z")

</div>

Hi guys! I am running into issues while converting p5 global code into instance mode. I am making sliders that control blending of the images using blendMode(SCREEN). In global sketch, all was fine. When I transition to…

---

## [https://p5js.org/reference/#/p5.Element/position](https://discourse.processing.org/t/https-p5js-org-reference-p5-element-position/23737)

<div class="topic-metadata">

**Author:** [@ats3788](https://discourse.processing.org/u/ats3788)\
**Replies:** 1\
**Last updated:** [September 8, 2020, 1:10pm UTC](https://discourse.processing.org/t/https-p5js-org-reference-p5-element-position/23737 "2020-09-08T13:10:36Z")

</div>

Hello I fiddle with P5 and tried this https://p5js.org/reference/#/p5.Element/positionPreformatted text let cnv = createCanvas(100, 100); // positions canvas 50px to the right and 100px // below upper left corner…

---

## [How to remove an object](https://discourse.processing.org/t/how-to-remove-an-object/23733)

<div class="topic-metadata">

**Author:** [@ats3788](https://discourse.processing.org/u/ats3788)\
**Replies:** 2\
**Last updated:** [September 8, 2020, 8:57am UTC](https://discourse.processing.org/t/how-to-remove-an-object/23733 "2020-09-08T08:57:00Z")

</div>

Hello I create an object like this let balls = \[\]; b = new Ball(random(150, ScreenX) , 0, r, red, green, blue); but how can I free / remove this Object

---

## [Fonts -- Loading Base64 Encoded Fonts](https://discourse.processing.org/t/fonts-loading-base64-encoded-fonts/23721)

<div class="topic-metadata">

**Author:** [@DennisM](https://discourse.processing.org/u/DennisM)\
**Replies:** 2\
**Last updated:** [September 7, 2020, 1:37pm UTC](https://discourse.processing.org/t/fonts-loading-base64-encoded-fonts/23721 "2020-09-07T13:37:36Z")

</div>

Hi, is there, i was wondering if there is any possibility to load base64 encrypted font files. Or to use encrypted fonts through any method. cheers dennis

---

## [How to set up a Local Host](https://discourse.processing.org/t/how-to-set-up-a-local-host/23581)

<div class="topic-metadata">

**Author:** [@Khaled](https://discourse.processing.org/u/Khaled)\
**Replies:** 2\
**Last updated:** [August 31, 2020, 7:57pm UTC](https://discourse.processing.org/t/how-to-set-up-a-local-host/23581 "2020-08-31T19:57:16Z")

</div>

Hello, first time posting here… I just started to use p5.js coming from python, and wanted to try something with p5.sound. but I’m having an issue with preload (), it’s not loading the sound file and web page is stuck …

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

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