# Beginners

**URL:** https://discourse.processing.org/c/processing/processing-beginners/14.md?page=7

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

**Page:** 8

---

## [Method initialize without writing in setup or draw](https://discourse.processing.org/t/method-initialize-without-writing-in-setup-or-draw/40740)

<div class="topic-metadata">

**Author:** [@OverLord](https://discourse.processing.org/u/OverLord)\
**Replies:** 4\
**Last updated:** [January 30, 2023, 7:19am UTC](https://discourse.processing.org/t/method-initialize-without-writing-in-setup-or-draw/40740 "2023-01-30T07:19:32Z")

</div>

And btw, what are some ways I can initialize a method without writing method(); in setup() or draw() ??

---

## [Loading files from outside the \`data\` folder](https://discourse.processing.org/t/loading-files-from-outside-the-data-folder/40743)

<div class="topic-metadata">

**Author:** [@Brahvim](https://discourse.processing.org/u/Brahvim)\
**Replies:** 1\
**Last updated:** [January 30, 2023, 8:18am UTC](https://discourse.processing.org/t/loading-files-from-outside-the-data-folder/40743 "2023-01-30T08:18:24Z")

</div>

Can one load files from outside the data folder of a sketch using functions like loadImage()? Apparently Java paths can look like: ../../../../C:/Users/Brahvim/Projects/Photo Edits/Outputs/image.png, …but it doesn’t se…

---

## [How to Properly Install Processing 4 on Windows 10 and Remove “Search for App in App Store Prompt”?](https://discourse.processing.org/t/how-to-properly-install-processing-4-on-windows-10-and-remove-search-for-app-in-app-store-prompt/40698)

<div class="topic-metadata">

**Author:** [@CaseyJ](https://discourse.processing.org/u/CaseyJ)\
**Replies:** 2\
**Last updated:** [January 24, 2023, 11:25pm UTC](https://discourse.processing.org/t/how-to-properly-install-processing-4-on-windows-10-and-remove-search-for-app-in-app-store-prompt/40698 "2023-01-24T23:25:49Z")

</div>

I have never really been sure how to properly install processing 3 or 4. After downloading and extracting I’m just not sure where to place the folder. Obviously downloads isn’t a good option. I’ve been placing it in pro…

---

## [Simple Pixel Sorter - Grey Screen Only?](https://discourse.processing.org/t/simple-pixel-sorter-grey-screen-only/40581)

<div class="topic-metadata">

**Author:** [@JHPC](https://discourse.processing.org/u/JHPC)\
**Replies:** 8\
**Last updated:** [January 22, 2023, 3:54pm UTC](https://discourse.processing.org/t/simple-pixel-sorter-grey-screen-only/40581 "2023-01-22T15:54:43Z")

</div>

Dear All, I’m trying to experiment with very simple pixel sorter. My code has been sourced from The Coding Train. I plug it into Processing 4, and have adjusted the screen size for the image which is 600 x 400 pixels.…

---

## [Problem with PGraphics - pixel\[\] gives scattered pixels](https://discourse.processing.org/t/problem-with-pgraphics-pixel-gives-scattered-pixels/40664)

<div class="topic-metadata">

**Author:** [@Phil2K](https://discourse.processing.org/u/Phil2K)\
**Replies:** 3\
**Last updated:** [January 22, 2023, 3:32pm UTC](https://discourse.processing.org/t/problem-with-pgraphics-pixel-gives-scattered-pixels/40664 "2023-01-22T15:32:26Z")

</div>

Hi, I got a little test and I cant get it do act like I want to - I guess I dont fully understand how to use the PGraphics. My ultimate goal is to load a picture and replicate it with a string art. First step I thought…

---

## [Run a java Processing sketch with Python](https://discourse.processing.org/t/run-a-java-processing-sketch-with-python/40619)

<div class="topic-metadata">

**Author:** [@BBGiraffe](https://discourse.processing.org/u/BBGiraffe)\
**Replies:** 2\
**Last updated:** [January 22, 2023, 6:38am UTC](https://discourse.processing.org/t/run-a-java-processing-sketch-with-python/40619 "2023-01-22T06:38:09Z")

</div>

Hi, I want to use a python script run a processing sketch multiple time but with different args for each run. I have processing sketch that works well if i run it manually via a cmd line eg “processing-java.exe --sketc…

---

## [KeyPressed cannot show a random position to a ellipse](https://discourse.processing.org/t/keypressed-cannot-show-a-random-position-to-a-ellipse/40665)

<div class="topic-metadata">

**Author:** [@carmavals](https://discourse.processing.org/u/carmavals)\
**Replies:** 5\
**Last updated:** [January 22, 2023, 1:22am UTC](https://discourse.processing.org/t/keypressed-cannot-show-a-random-position-to-a-ellipse/40665 "2023-01-22T01:22:20Z")

</div>

Hello! I have a question about a sketch. I am trying to draw a ellipse on a random position everytime a key is pressed in this case the key ‘a’. The situation is that it does draw the ellipse in a random position but it…

---

## [What type is \`this\` in a sketch?](https://discourse.processing.org/t/what-type-is-this-in-a-sketch/39676)

<div class="topic-metadata">

**Author:** [@grough](https://discourse.processing.org/u/grough)\
**Replies:** 5\
**Last updated:** [January 20, 2023, 3:00pm UTC](https://discourse.processing.org/t/what-type-is-this-in-a-sketch/39676 "2023-01-20T15:00:41Z")

</div>

Hi, When I run this code in a sketch: println(this); I see this in the console: sketch\_221111b@31393958 What datatype or class does this belong to? I’m trying to write a function that accepts this as an argument, b…

---

## [Using system time functions causes sketch to not run? ("Target VM failed to initialize")](https://discourse.processing.org/t/using-system-time-functions-causes-sketch-to-not-run-target-vm-failed-to-initialize/40597)

<div class="topic-metadata">

**Author:** [@Stetez14](https://discourse.processing.org/u/Stetez14)\
**Replies:** 4\
**Last updated:** [January 19, 2023, 6:37pm UTC](https://discourse.processing.org/t/using-system-time-functions-causes-sketch-to-not-run-target-vm-failed-to-initialize/40597 "2023-01-19T18:37:44Z")

</div>

I’m not sure if this is the correct forum, but I seem to have encountered a major issue in my project. My sketch has started fine so far but suddenly stopped working. Through some basic troubleshooting, I found the issu…

---

## [I cannot change Sketchbook folder](https://discourse.processing.org/t/i-cannot-change-sketchbook-folder/40629)

<div class="topic-metadata">

**Author:** [@Alkis](https://discourse.processing.org/u/Alkis)\
**Replies:** 7\
**Last updated:** [January 19, 2023, 10:23am UTC](https://discourse.processing.org/t/i-cannot-change-sketchbook-folder/40629 "2023-01-19T10:23:21Z")

</div>

I change the Sketchbook folder in Preferences and the default one (C:\\Users{username}\\AppData\\Roaming\\Processing) always comes back! Can anyone tell me how to change Sketchbook folder in Processing 4? Thank you.

---

## [Is it possible to use a string for a type like "int something+""+i = i"](https://discourse.processing.org/t/is-it-possible-to-use-a-string-for-a-type-like-int-something-i-i/40624)

<div class="topic-metadata">

**Author:** [@Aryszin](https://discourse.processing.org/u/Aryszin)\
**Replies:** 3\
**Last updated:** [January 17, 2023, 9:37pm UTC](https://discourse.processing.org/t/is-it-possible-to-use-a-string-for-a-type-like-int-something-i-i/40624 "2023-01-17T21:37:33Z")

</div>

Hello! Is it possible to do this? int something, something1, something2, something3, something4, something5; for(int i = 0; i \< 5; i++) { something+""+i = i; } \*so it uses all 5 variables and doesnt make the va…

---

## [Is color a typedef or something else?](https://discourse.processing.org/t/is-color-a-typedef-or-something-else/40595)

<div class="topic-metadata">

**Author:** [@Math\_Machine](https://discourse.processing.org/u/Math_Machine)\
**Replies:** 3\
**Last updated:** [January 15, 2023, 7:42am UTC](https://discourse.processing.org/t/is-color-a-typedef-or-something-else/40595 "2023-01-15T07:42:58Z")

</div>

Hi everybody! So, I’ve had this question for a while now. It appears the type color in java is equivalent to the int type in every single way, to the point that the built-in java compile-time error checker (I wish I knew…

---

## [Drawing multiple objects with calculations related to the previous object](https://discourse.processing.org/t/drawing-multiple-objects-with-calculations-related-to-the-previous-object/40565)

<div class="topic-metadata">

**Author:** [@i-draw-monkeys](https://discourse.processing.org/u/i-draw-monkeys)\
**Replies:** 4\
**Last updated:** [January 13, 2023, 10:51am UTC](https://discourse.processing.org/t/drawing-multiple-objects-with-calculations-related-to-the-previous-object/40565 "2023-01-13T10:51:27Z")

</div>

I need help figuring out how to figure out something. So I have hardcoded two circles and an external and internal tangent line. Here is the code: PVector c1, c2; //center of circles PVector t1, t2; //tangent points of…

---

## [Please explain this to me : multiplying done before dividing?](https://discourse.processing.org/t/please-explain-this-to-me-multiplying-done-before-dividing/40410)

<div class="topic-metadata">

**Author:** [@adrinalino](https://discourse.processing.org/u/adrinalino)\
**Replies:** 7\
**Last updated:** [January 12, 2023, 10:52pm UTC](https://discourse.processing.org/t/please-explain-this-to-me-multiplying-done-before-dividing/40410 "2023-01-12T22:52:10Z")

</div>

I was pulling my hairs for not being able to solve a simple N-body setup until I noticed something strange. I was under the impression that multiplying was done before dividing but not in this case. Am I overlooking some…

---

## [Loading Class In Data Folder?](https://discourse.processing.org/t/loading-class-in-data-folder/40546)

<div class="topic-metadata">

**Author:** [@svan](https://discourse.processing.org/u/svan)\
**Replies:** 2\
**Last updated:** [January 11, 2023, 3:41am UTC](https://discourse.processing.org/t/loading-class-in-data-folder/40546 "2023-01-11T03:41:56Z")

</div>

Is there a way to load a class stored in the ‘data’ folder? No problem if the class is under a separate tab in the main app, but what if it is stored in the data folder?

---

## [I get the error: Syntax Error - Missing name or ; near ‘’? for my first line of code](https://discourse.processing.org/t/i-get-the-error-syntax-error-missing-name-or-near-for-my-first-line-of-code/40517)

<div class="topic-metadata">

**Author:** [@Kaboom21](https://discourse.processing.org/u/Kaboom21)\
**Replies:** 1\
**Last updated:** [January 9, 2023, 5:14am UTC](https://discourse.processing.org/t/i-get-the-error-syntax-error-missing-name-or-near-for-my-first-line-of-code/40517 "2023-01-09T05:14:41Z")

</div>

I have used processing and made a game with python in it and this is my first time using java I’m getting this error for my first line of code which is class Player {

---

## [What is temp and how it works (constructor)](https://discourse.processing.org/t/what-is-temp-and-how-it-works-constructor/40506)

<div class="topic-metadata">

**Author:** [@Siyue](https://discourse.processing.org/u/Siyue)\
**Replies:** 5\
**Last updated:** [January 8, 2023, 2:30pm UTC](https://discourse.processing.org/t/what-is-temp-and-how-it-works-constructor/40506 "2023-01-08T14:30:55Z")

</div>

So from processing tutorial https://www.youtube.com/watch?v=NrwaKOsplZk&list=PLzJbM9-DyOZyMZzVda3HaWviHqfPiYN7e&index=36 , there is a “temp” argument to define the diameter. my question is any relative explanation for te…

---

## ["error on void " what is wrong?](https://discourse.processing.org/t/error-on-void-what-is-wrong/40510)

<div class="topic-metadata">

**Author:** [@Siyue](https://discourse.processing.org/u/Siyue)\
**Replies:** 4\
**Last updated:** [January 8, 2023, 2:52pm UTC](https://discourse.processing.org/t/error-on-void-what-is-wrong/40510 "2023-01-08T14:52:51Z")

</div>

hey guys. I am still on the beginner’s page and trying to figure out the OOP and the error hint keep telling me “error on void” and I have no idea where did I go wrong. Bubble b1; Bubble b2 void setup() { size(600, …

---

## [Syntax error with void setup and draw functions](https://discourse.processing.org/t/syntax-error-with-void-setup-and-draw-functions/40508)

<div class="topic-metadata">

**Author:** [@vinnyvin](https://discourse.processing.org/u/vinnyvin)\
**Replies:** 4\
**Last updated:** [January 8, 2023, 12:23pm UTC](https://discourse.processing.org/t/syntax-error-with-void-setup-and-draw-functions/40508 "2023-01-08T12:23:31Z")

</div>

void setup() { size(200, 200); rectMode(CENTER); noStroke(); fill(0, 102, 153, 204); } void draw() { background(255); rect(width-mouseX, height-mouseY, 50, 50); rect(mouseX, mouseY, 50, 50); } I keep gett…

---

## [Use save(); in the background](https://discourse.processing.org/t/use-save-in-the-background/40446)

<div class="topic-metadata">

**Author:** [@Lissie](https://discourse.processing.org/u/Lissie)\
**Replies:** 5\
**Last updated:** [January 5, 2023, 4:43pm UTC](https://discourse.processing.org/t/use-save-in-the-background/40446 "2023-01-05T16:43:13Z")

</div>

When i want to use the save function, the programm lags for a few milliseconds, can i make it so it does it in the background?

---

## [The sketch crashes when I press some other key that isn't a letter or a number](https://discourse.processing.org/t/the-sketch-crashes-when-i-press-some-other-key-that-isnt-a-letter-or-a-number/31960)

<div class="topic-metadata">

**Author:** [@vinijoncrafts](https://discourse.processing.org/u/vinijoncrafts)\
**Replies:** 3\
**Last updated:** [January 2, 2023, 11:12pm UTC](https://discourse.processing.org/t/the-sketch-crashes-when-i-press-some-other-key-that-isnt-a-letter-or-a-number/31960 "2023-01-02T23:12:23Z")

</div>

If I press a key like shift, alt, caps lock, etc. the sketch crashes. How do I make this stop happening? Thanks for reading this :slight\_smile: here’s the code: float v = 5; int x = 1920/2; int y = 1080/2; boolean \[\] ke…

---

## [Syntax error even though there is none](https://discourse.processing.org/t/syntax-error-even-though-there-is-none/40417)

<div class="topic-metadata">

**Author:** [@iinnessic](https://discourse.processing.org/u/iinnessic)\
**Replies:** 10\
**Last updated:** [January 2, 2023, 9:44pm UTC](https://discourse.processing.org/t/syntax-error-even-though-there-is-none/40417 "2023-01-02T21:44:12Z")

</div>

My console says there is a synthax error even though i am pretty sure there is none… void mousePressed () { Variante = int ( random (1,6)); }

---

## [How to work with classes in Processing](https://discourse.processing.org/t/how-to-work-with-classes-in-processing/40395)

<div class="topic-metadata">

**Author:** [@OverLord](https://discourse.processing.org/u/OverLord)\
**Replies:** 7\
**Last updated:** [January 2, 2023, 12:51am UTC](https://discourse.processing.org/t/how-to-work-with-classes-in-processing/40395 "2023-01-02T00:51:24Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hi processing community. I would like to ask you how you can work with classes I already learned a little bit how to work with classes and funct…

---

## [Lens ellipse follow mouse](https://discourse.processing.org/t/lens-ellipse-follow-mouse/40270)

<div class="topic-metadata">

**Author:** [@vrtx](https://discourse.processing.org/u/vrtx)\
**Replies:** 10\
**Last updated:** [December 31, 2022, 8:08pm UTC](https://discourse.processing.org/t/lens-ellipse-follow-mouse/40270 "2022-12-31T20:08:40Z")

</div>

Hi, guys. I found this code, and i am changing it for studing. Is there how i make the lens ellipse follow the mouse? /\*\* \* Lens Demo Effect \* by luis2048. \* \* A picture is shown and it looks like a magnifying gl…

---

## [Referencing colour value I defined in the main project again in class after redefining it in class?](https://discourse.processing.org/t/referencing-colour-value-i-defined-in-the-main-project-again-in-class-after-redefining-it-in-class/40308)

<div class="topic-metadata">

**Author:** [@MarkusWiesinger](https://discourse.processing.org/u/MarkusWiesinger)\
**Replies:** 5\
**Last updated:** [December 26, 2022, 6:03pm UTC](https://discourse.processing.org/t/referencing-colour-value-i-defined-in-the-main-project-again-in-class-after-redefining-it-in-class/40308 "2022-12-26T18:03:40Z")

</div>

Hi! Sorry, newcommer to processing, hoping I don’t mess up the guidelines. The story so far: I have a class called “blocks”. The colour, size and position of that box is defined through the main project in its signatur…

---

## [New Install 4.1.1 - No Modes](https://discourse.processing.org/t/new-install-4-1-1-no-modes/40252)

<div class="topic-metadata">

**Author:** [@rcriley](https://discourse.processing.org/u/rcriley)\
**Replies:** 5\
**Last updated:** [December 22, 2022, 12:49pm UTC](https://discourse.processing.org/t/new-install-4-1-1-no-modes/40252 "2022-12-22T12:49:28Z")

</div>

Hello - I work in the IT Dept at a University. One of our faculty members plans to use Processing in the coming semester. I’m working to install it in a few computer labs for our students. They would also like to use th…

---

## [Help on how to do a text chart: string and buttons (Professor Layton’s game)](https://discourse.processing.org/t/help-on-how-to-do-a-text-chart-string-and-buttons-professor-layton-s-game/40198)

<div class="topic-metadata">

**Author:** [@FaySword](https://discourse.processing.org/u/FaySword)\
**Replies:** 2\
**Last updated:** [December 19, 2022, 6:17pm UTC](https://discourse.processing.org/t/help-on-how-to-do-a-text-chart-string-and-buttons-professor-layton-s-game/40198 "2022-12-19T18:17:26Z")

</div>

Hi, I’m a begginer at processing and I have to do some kind of videogame for university. I wanted to make a text chart, with a rect, and write on it some phrases with String. I wanted to make the phrases change when you …

---

## [Why does Processing take 10 seconds to load and run any sketch?](https://discourse.processing.org/t/why-does-processing-take-10-seconds-to-load-and-run-any-sketch/40169)

<div class="topic-metadata">

**Author:** [@hallow255win](https://discourse.processing.org/u/hallow255win)\
**Replies:** 3\
**Last updated:** [December 17, 2022, 12:40pm UTC](https://discourse.processing.org/t/why-does-processing-take-10-seconds-to-load-and-run-any-sketch/40169 "2022-12-17T12:40:58Z")

</div>

I have Processing 4 on my win 7 PC, every time i click “run” button on the sketch, it takes 8-10 seconds to load and pop up the window of canvas regardless of sketch’s complexity. The drawing process is, on the other ha…

---

## [ERROR: The constructor "......" does not exist](https://discourse.processing.org/t/error-the-constructor-does-not-exist/40116)

<div class="topic-metadata">

**Author:** [@onosecond](https://discourse.processing.org/u/onosecond)\
**Replies:** 3\
**Last updated:** [December 11, 2022, 3:06am UTC](https://discourse.processing.org/t/error-the-constructor-does-not-exist/40116 "2022-12-11T03:06:00Z")

</div>

Question \[\] questions; PImage \[\] bg; int nr\_img=10; int counter=0; void setup(){ size(600,600); String \[\] text=loadStrings("questions.txt");//load the file questions=new Question\[text.length\]; for(int i=0;i\<q…

---

## [Cannot find a class or type named “Enemy” -- How to Initialize an Array of Objects](https://discourse.processing.org/t/cannot-find-a-class-or-type-named-enemy-how-to-initialize-an-array-of-objects/40043)

<div class="topic-metadata">

**Author:** [@C2014](https://discourse.processing.org/u/C2014)\
**Replies:** 3\
**Last updated:** [December 7, 2022, 2:32pm UTC](https://discourse.processing.org/t/cannot-find-a-class-or-type-named-enemy-how-to-initialize-an-array-of-objects/40043 "2022-12-07T14:32:28Z")

</div>

int spawnTime=180; Enemy\[\] zombieArray; int zombiecount; int maxzombie=8; int i; void setup() { maxzombie=8; size(500,300); zombieArray = new Enemy\[maxzombie\]; } void draw(){ background (100); for ( Enemy zomb…

[Previous page](https://discourse.processing.org/c/processing/processing-beginners/14.md?page=6)

[Next page](https://discourse.processing.org/c/processing/processing-beginners/14.md?page=8)
