# Beginners

**URL:** https://discourse.processing.org/c/processing/processing-beginners/14.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

---

## [Check key for Pos1, End, Ctrl-1, Ctrl-Pos1, Ctrl-End](https://discourse.processing.org/t/check-key-for-pos1-end-ctrl-1-ctrl-pos1-ctrl-end/38413)

<div class="topic-metadata">

**Author:** [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Replies:** 10\
**Last updated:** [August 21, 2022, 11:52am UTC](https://discourse.processing.org/t/check-key-for-pos1-end-ctrl-1-ctrl-pos1-ctrl-end/38413 "2022-08-21T11:52:28Z")

</div>

Hello all, how can I check the aforementioned keys please? Cheers! Chrisir

---

## [Random position ellipse smear/freeze](https://discourse.processing.org/t/random-position-ellipse-smear-freeze/38300)

<div class="topic-metadata">

**Author:** [@Tilman](https://discourse.processing.org/u/Tilman)\
**Replies:** 5\
**Last updated:** [August 12, 2022, 2:24am UTC](https://discourse.processing.org/t/random-position-ellipse-smear-freeze/38300 "2022-08-12T02:24:44Z")

</div>

Hi I am doing chapter 7-10 in learning processing. And want to do a jiggeling UFO. Somehow in my code it makes the graphic not update correctly. It smears freezes (paints over one an other) Hope someone can help me what…

---

## [How to go from plane to 3D](https://discourse.processing.org/t/how-to-go-from-plane-to-3d/38263)

<div class="topic-metadata">

**Author:** [@Karrajo](https://discourse.processing.org/u/Karrajo)\
**Replies:** 2\
**Last updated:** [August 7, 2022, 4:32pm UTC](https://discourse.processing.org/t/how-to-go-from-plane-to-3d/38263 "2022-08-07T16:32:30Z")

</div>

float t=1; void setup() { size(800, 800); } void draw() { background(0); noStroke(); fill(255); translate(width/2, height/2); for (int i = 0; i \< 100; i++) { float x = width/4 \* sin(t\*i\*PI\*2); …

---

## [Detect Right and left mouse click](https://discourse.processing.org/t/detect-right-and-left-mouse-click/38239)

<div class="topic-metadata">

**Author:** [@jensemand](https://discourse.processing.org/u/jensemand)\
**Replies:** 3\
**Last updated:** [August 5, 2022, 6:12pm UTC](https://discourse.processing.org/t/detect-right-and-left-mouse-click/38239 "2022-08-05T18:12:12Z")

</div>

Hi, I’ve got the problem that I want to detect via a boolean when I press either my left or my right mouse bottom, however, it seems I can’t do it with keyCode. It would really help a lot if someone could make a small p…

---

## [Programmatically step through every permutation of a 4x4 black and white grid](https://discourse.processing.org/t/programmatically-step-through-every-permutation-of-a-4x4-black-and-white-grid/38133)

<div class="topic-metadata">

**Author:** [@heyneff](https://discourse.processing.org/u/heyneff)\
**Replies:** 8\
**Last updated:** [August 2, 2022, 8:41am UTC](https://discourse.processing.org/t/programmatically-step-through-every-permutation-of-a-4x4-black-and-white-grid/38133 "2022-08-02T08:41:21Z")

</div>

I’ve been getting refamiliarized with processing after a long stint away and have hit the limits of combining tutorials and my foggy memory. My goal is: 1) create a 4 x 4 grid 2) Programmatically step through all 16k+ b…

---

## [Problem with lines/curves in P3D](https://discourse.processing.org/t/problem-with-lines-curves-in-p3d/38151)

<div class="topic-metadata">

**Author:** [@arTwirr](https://discourse.processing.org/u/arTwirr)\
**Replies:** 5\
**Last updated:** [August 4, 2022, 2:58pm UTC](https://discourse.processing.org/t/problem-with-lines-curves-in-p3d/38151 "2022-08-04T14:58:32Z")

</div>

Hi, I started using processing a few days ago and encountered a problem. In order to use Spout, I had to change renderer to P3D, but P3D lines/curves work a bit differently than in default renderer. There happens a bug …

---

## [Change shape when changing directions](https://discourse.processing.org/t/change-shape-when-changing-directions/34315)

<div class="topic-metadata">

**Author:** [@marina\_kdot](https://discourse.processing.org/u/marina_kdot)\
**Replies:** 7\
**Last updated:** [August 4, 2022, 8:27am UTC](https://discourse.processing.org/t/change-shape-when-changing-directions/34315 "2022-08-04T08:27:24Z")

</div>

I am working through “Coding Art” and there is an extra task I am not able to solve until now. I am really a beginner and this task seems quite hard without coding experience at all. I have Particles moving in a circle …

---

## [How can I change Image background with mouse click?](https://discourse.processing.org/t/how-can-i-change-image-background-with-mouse-click/38189)

<div class="topic-metadata">

**Author:** [@steven](https://discourse.processing.org/u/steven)\
**Replies:** 6\
**Last updated:** [August 2, 2022, 1:04pm UTC](https://discourse.processing.org/t/how-can-i-change-image-background-with-mouse-click/38189 "2022-08-02T13:04:33Z")

</div>

I just want to make a 2D rpg games with the background of the game can change in different stages of the game. Please send help:((

---

## [Changing image background with given specific time](https://discourse.processing.org/t/changing-image-background-with-given-specific-time/38186)

<div class="topic-metadata">

**Author:** [@steven](https://discourse.processing.org/u/steven)\
**Replies:** 2\
**Last updated:** [August 1, 2022, 2:51pm UTC](https://discourse.processing.org/t/changing-image-background-with-given-specific-time/38186 "2022-08-01T14:51:56Z")

</div>

I’m 3rd year college student and I need a help about changing the image background with given specific time.

---

## [For Loop in Processing (snake game)](https://discourse.processing.org/t/for-loop-in-processing-snake-game/38059)

<div class="topic-metadata">

**Author:** [@ikay](https://discourse.processing.org/u/ikay)\
**Replies:** 6\
**Last updated:** [July 28, 2022, 6:55am UTC](https://discourse.processing.org/t/for-loop-in-processing-snake-game/38059 "2022-07-28T06:55:43Z")

</div>

hey i have a code and i’m trying to create a loop to draw 3 ellipses int SNAKE\_SIZE =20,SNAKE\_LENGTH=4; void setup(){ size(500,500); } //ellipse(250,250,SNAKE\_SIZE,SNAKE\_SIZE); //ellipse(250,270,SNAKE\_SIZE,SNAKE\_SI…

---

## [How to move an object created on a loop](https://discourse.processing.org/t/how-to-move-an-object-created-on-a-loop/38034)

<div class="topic-metadata">

**Author:** [@Ghost2](https://discourse.processing.org/u/Ghost2)\
**Replies:** 7\
**Last updated:** [July 25, 2022, 4:40pm UTC](https://discourse.processing.org/t/how-to-move-an-object-created-on-a-loop/38034 "2022-07-25T16:40:49Z")

</div>

I have this piece of code where i am trying to move an object i.e three dots created by a for loop and i want to move the dots when mouse is pressed eg. Move the dots like dot++.If anyone can help me it would be great\\ …

---

## [Disable Blue Console Warnings](https://discourse.processing.org/t/disable-blue-console-warnings/38056)

<div class="topic-metadata">

**Author:** [@megrimm](https://discourse.processing.org/u/megrimm)\
**Replies:** 2\
**Last updated:** [July 22, 2022, 9:12pm UTC](https://discourse.processing.org/t/disable-blue-console-warnings/38056 "2022-07-22T21:12:33Z")

</div>

Hello, How can I disable the blue console warning that show up when I am missing a file? For example I do a check to see if an image/file exists before loading like so: if ((img = loadImage("file.jpg")) != null)…

---

## [Extracting pixels values from an alpha/greyscale PImage?](https://discourse.processing.org/t/extracting-pixels-values-from-an-alpha-greyscale-pimage/38038)

<div class="topic-metadata">

**Author:** [@amundsen](https://discourse.processing.org/u/amundsen)\
**Replies:** 5\
**Last updated:** [July 21, 2022, 9:13am UTC](https://discourse.processing.org/t/extracting-pixels-values-from-an-alpha-greyscale-pimage/38038 "2022-07-21T09:13:39Z")

</div>

Hello. When using a PImage in alpha/greyscale format, how can I extract individual values from pixels? Should I use alpha(myImage.pixels\[pos\])? Or red(myImage.pixels\[pos\])? Thank you in advance.

---

## [Save and recall variable in a file](https://discourse.processing.org/t/save-and-recall-variable-in-a-file/37968)

<div class="topic-metadata">

**Author:** [@leuwenn](https://discourse.processing.org/u/leuwenn)\
**Replies:** 4\
**Last updated:** [July 16, 2022, 5:50pm UTC](https://discourse.processing.org/t/save-and-recall-variable-in-a-file/37968 "2022-07-16T17:50:08Z")

</div>

Hi, I’m trying to save several variables to a file so I can reload them when the program opens. I manage to create a JSON file but I have to manually add the code, I would like to automate this by adding in an Array, th…

---

## [Change Background Color on Key Press](https://discourse.processing.org/t/change-background-color-on-key-press/37970)

<div class="topic-metadata">

**Author:** [@roaringcrex](https://discourse.processing.org/u/roaringcrex)\
**Replies:** 3\
**Last updated:** [July 16, 2022, 1:55pm UTC](https://discourse.processing.org/t/change-background-color-on-key-press/37970 "2022-07-16T13:55:00Z")

</div>

Hey, I’d like to change the background Color and it should stay the same after choosing one, but I can’t wrap my head around how that should be possible… Can someone please help me out on this? I’ve tried to google my w…

---

## [DALLE 2 - Transparent background and load image](https://discourse.processing.org/t/dalle-2-transparent-background-and-load-image/37973)

<div class="topic-metadata">

**Author:** [@Scaprendering](https://discourse.processing.org/u/Scaprendering)\
**Replies:** 4\
**Last updated:** [July 15, 2022, 9:03pm UTC](https://discourse.processing.org/t/dalle-2-transparent-background-and-load-image/37973 "2022-07-15T21:03:04Z")

</div>

Hi brains ! I’ll be honest, first day into processing today. I’ve done what I needed, basically crop and reposition images but I still have an issue about how to set the gray background to transparent. Here’s the c…

---

## [Moving 'backwards through time' of animation frame by frame?](https://discourse.processing.org/t/moving-backwards-through-time-of-animation-frame-by-frame/37657)

<div class="topic-metadata">

**Author:** [@CamSos](https://discourse.processing.org/u/CamSos)\
**Replies:** 11\
**Last updated:** [July 15, 2022, 5:03pm UTC](https://discourse.processing.org/t/moving-backwards-through-time-of-animation-frame-by-frame/37657 "2022-07-15T17:03:21Z")

</div>

I’m trying to tab through the ‘frames’ of my animation, as it is useful for troubleshooting. Stepping forward in time, one frame at a time, is easy enough: void keyPressed() { if (key == CODED) { if (keyCode == R…

---

## [I want to create random circle walking how would I do this?](https://discourse.processing.org/t/i-want-to-create-random-circle-walking-how-would-i-do-this/37937)

<div class="topic-metadata">

**Author:** [@anche-jpg](https://discourse.processing.org/u/anche-jpg)\
**Replies:** 8\
**Last updated:** [July 13, 2022, 10:28am UTC](https://discourse.processing.org/t/i-want-to-create-random-circle-walking-how-would-i-do-this/37937 "2022-07-13T10:28:28Z")

</div>

Hello Processing People, I am having some trouble doing a basic thing. I would like to have circle walking like this on screen. If you look at the link, he has written code for the art which I am using but it is someho…

---

## [How do I use a method from a Processing project in other Processing projects?](https://discourse.processing.org/t/how-do-i-use-a-method-from-a-processing-project-in-other-processing-projects/37926)

<div class="topic-metadata">

**Author:** [@Random\_Ghost](https://discourse.processing.org/u/Random_Ghost)\
**Replies:** 1\
**Last updated:** [July 11, 2022, 8:26pm UTC](https://discourse.processing.org/t/how-do-i-use-a-method-from-a-processing-project-in-other-processing-projects/37926 "2022-07-11T20:26:17Z")

</div>

I have written a method in a processing projects and I’m going to use it in other unrelated projects. Is there a way to use the method without having to copy it every time?

---

## [How change icon to title bar](https://discourse.processing.org/t/how-change-icon-to-title-bar/37903)

<div class="topic-metadata">

**Author:** [@Andry](https://discourse.processing.org/u/Andry)\
**Replies:** 4\
**Last updated:** [July 10, 2022, 2:37pm UTC](https://discourse.processing.org/t/how-change-icon-to-title-bar/37903 "2022-07-10T14:37:29Z")

</div>

i tried with this code, but it gives me error ImageIcon icon = new ImageIcon(“icona.ico”); import javax.swing.\*; JFrame jf; jf.setIconImage(icon);

---

## [Defining JSONArray with name but without array](https://discourse.processing.org/t/defining-jsonarray-with-name-but-without-array/37822)

<div class="topic-metadata">

**Author:** [@Ruchi](https://discourse.processing.org/u/Ruchi)\
**Replies:** 1\
**Last updated:** [July 4, 2022, 8:47am UTC](https://discourse.processing.org/t/defining-jsonarray-with-name-but-without-array/37822 "2022-07-04T08:47:22Z")

</div>

I am trying to define a JSONArray within a JSON object but I will be adding objects in array later. So when declaring it , I cannot use setJSONArray function. How can I retrieve it by getJSONArray function if I have no…

---

## [Very basic file reading question - where is the data directory?](https://discourse.processing.org/t/very-basic-file-reading-question-where-is-the-data-directory/25119)

<div class="topic-metadata">

**Author:** [@MuddyGardener](https://discourse.processing.org/u/MuddyGardener)\
**Replies:** 11\
**Last updated:** [June 30, 2022, 11:12pm UTC](https://discourse.processing.org/t/very-basic-file-reading-question-where-is-the-data-directory/25119 "2022-06-30T23:12:22Z")

</div>

I am trying to figure out how to access files. All the documentation I’ve seen says that loadImage() etc will only work on files in the data directory. (It seems very strange, that I can’t give an absolute pathname… …

---

## [Circles drawing differently in active and static modes](https://discourse.processing.org/t/circles-drawing-differently-in-active-and-static-modes/37735)

<div class="topic-metadata">

**Author:** [@Nicholas](https://discourse.processing.org/u/Nicholas)\
**Replies:** 4\
**Last updated:** [June 29, 2022, 12:42pm UTC](https://discourse.processing.org/t/circles-drawing-differently-in-active-and-static-modes/37735 "2022-06-29T12:42:17Z")

</div>

Hello all I’ve just installed Processing 4, and when I run the following in static mode I get a smooth circle: size(500,500); noStroke(); circle(width/2,height/2,20); But when I run the same code in active mode it …

---

## [Sin()-function and radians()-function implemented in processing.1.4.16.js?](https://discourse.processing.org/t/sin-function-and-radians-function-implemented-in-processing-1-4-16-js/37729)

<div class="topic-metadata">

**Author:** [@anrui71](https://discourse.processing.org/u/anrui71)\
**Replies:** 5\
**Last updated:** [June 29, 2022, 6:12am UTC](https://discourse.processing.org/t/sin-function-and-radians-function-implemented-in-processing-1-4-16-js/37729 "2022-06-29T06:12:58Z")

</div>

Hello to all, I read a bit about the potential difficulties to work with processing.js but so far luckily did not encounter any problem. Only just now it occurs that the sin()-function, probabily also the radians()-func…

---

## [Fill() can only be called between beginShape() and endShape()](https://discourse.processing.org/t/fill-can-only-be-called-between-beginshape-and-endshape/37738)

<div class="topic-metadata">

**Author:** [@bcabc](https://discourse.processing.org/u/bcabc)\
**Replies:** 1\
**Last updated:** [June 27, 2022, 7:19pm UTC](https://discourse.processing.org/t/fill-can-only-be-called-between-beginshape-and-endshape/37738 "2022-06-27T19:19:42Z")

</div>

Hi - I’m working through the PShape example and running into a bit of a problem with the following code. I can’t seem to color fill the shape. Any suggestions? PShape square; void setup() { size(400, 400); squar…

---

## [rectMode for only 1 rect](https://discourse.processing.org/t/rectmode-for-only-1-rect/37737)

<div class="topic-metadata">

**Author:** [@Sander](https://discourse.processing.org/u/Sander)\
**Replies:** 3\
**Last updated:** [June 27, 2022, 8:53pm UTC](https://discourse.processing.org/t/rectmode-for-only-1-rect/37737 "2022-06-27T20:53:11Z")

</div>

Hey, i am new in Processing and i have a question… i want to center 1 rect but the function rectMode centers all rects how can i change this?

---

## [Static reference to the non-static method](https://discourse.processing.org/t/static-reference-to-the-non-static-method/37711)

<div class="topic-metadata">

**Author:** [@PixelMx](https://discourse.processing.org/u/PixelMx)\
**Replies:** 2\
**Last updated:** [June 25, 2022, 2:32pm UTC](https://discourse.processing.org/t/static-reference-to-the-non-static-method/37711 "2022-06-25T14:32:49Z")

</div>

Hi, I’ve been reading about The Salesman Problem and I’ve seen TSP art, which I’m interested in creating. I found an existing sketch in gihub and I’m trying to adapt it to randomly read pixels from a black and white ima…

---

## [Implicit super constructor classes.Mover() is undefined. Must explicitly invoke another constructor](https://discourse.processing.org/t/implicit-super-constructor-classes-mover-is-undefined-must-explicitly-invoke-another-constructor/37683)

<div class="topic-metadata">

**Author:** [@BeshooD](https://discourse.processing.org/u/BeshooD)\
**Replies:** 11\
**Last updated:** [June 23, 2022, 5:15am UTC](https://discourse.processing.org/t/implicit-super-constructor-classes-mover-is-undefined-must-explicitly-invoke-another-constructor/37683 "2022-06-23T05:15:29Z")

</div>

Not sure what this message means, can I get some help?

---

## [Math.Sqrt(x); not working?](https://discourse.processing.org/t/math-sqrt-x-not-working/37681)

<div class="topic-metadata">

**Author:** [@neon124](https://discourse.processing.org/u/neon124)\
**Replies:** 2\
**Last updated:** [June 22, 2022, 9:36am UTC](https://discourse.processing.org/t/math-sqrt-x-not-working/37681 "2022-06-22T09:36:57Z")

</div>

I’m making a calculator and when trying to make the square root function, it outputs the number you put in, not the square root. Here’s the bit of code that applies to the square root function. SquareRoot = (Button)find…

---

## [Multiple variables in one for loop?](https://discourse.processing.org/t/multiple-variables-in-one-for-loop/37635)

<div class="topic-metadata">

**Author:** [@sleepycode](https://discourse.processing.org/u/sleepycode)\
**Replies:** 7\
**Last updated:** [June 22, 2022, 2:24am UTC](https://discourse.processing.org/t/multiple-variables-in-one-for-loop/37635 "2022-06-22T02:24:04Z")

</div>

Is it possible to use two variables in a single for loop? Here’s my non-working code: void sqrNew() { for (float x = random(295,300),float y = random(355,360); x \< 700 && y \< 700; x = x + 55, y = y + 55) { …

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

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