# Beginners

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

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

**Page:** 10

---

## [Save file with custom file name](https://discourse.processing.org/t/save-file-with-custom-file-name/39271)

<div class="topic-metadata">

**Author:** [@bask185](https://discourse.processing.org/u/bask185)\
**Replies:** 4\
**Last updated:** [October 14, 2022, 9:20pm UTC](https://discourse.processing.org/t/save-file-with-custom-file-name/39271 "2022-10-14T21:20:10Z")

</div>

I have a question. I made a GUI which can store and load a .csv. Currently I can have only one .csv file with a fixed name. I want to work with a folder and several files instead. I know of atleast one way to work with…

---

## [How to use Processing-4 in Visual Studio Code](https://discourse.processing.org/t/how-to-use-processing-4-in-visual-studio-code/37725)

<div class="topic-metadata">

**Author:** [@DrMaC](https://discourse.processing.org/u/DrMaC)\
**Replies:** 2\
**Last updated:** [October 14, 2022, 9:51am UTC](https://discourse.processing.org/t/how-to-use-processing-4-in-visual-studio-code/37725 "2022-10-14T09:51:17Z")

</div>

Hello, On windows 10 I have been trying to run Processing 4 on VSCode for a few days & getting nowhere. Processing-4 app running stand alone works OK on a test.pde file but running the same code in the Processing Langua…

---

## [Test Topic for Spam filter](https://discourse.processing.org/t/test-topic-for-spam-filter/39227)

<div class="topic-metadata">

**Author:** [@mnse](https://discourse.processing.org/u/mnse)\
**Replies:** 0\
**Last updated:** [October 12, 2022, 1:23pm UTC](https://discourse.processing.org/t/test-topic-for-spam-filter/39227 "2022-10-12T13:23:55Z")

</div>

please format code with \</\> button \* homework policy \* asking questions No issue here. Only for testing. Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna …

---

## [Line coming out of semi circle](https://discourse.processing.org/t/line-coming-out-of-semi-circle/39225)

<div class="topic-metadata">

**Author:** [@chaotic.rabbit](https://discourse.processing.org/u/chaotic.rabbit)\
**Replies:** 1\
**Last updated:** [October 12, 2022, 10:03am UTC](https://discourse.processing.org/t/line-coming-out-of-semi-circle/39225 "2022-10-12T10:03:41Z")

</div>

Hi, i would like to have lines coming out the curved part of a semicircle. I already know the x positions that I want but I need to adjust the y of the lines according to the semicircle’s curve. How can I do this please? …

---

## [TextWidth is not the correct width!](https://discourse.processing.org/t/textwidth-is-not-the-correct-width/39158)

<div class="topic-metadata">

**Author:** [@Lissie](https://discourse.processing.org/u/Lissie)\
**Replies:** 6\
**Last updated:** [October 9, 2022, 1:37am UTC](https://discourse.processing.org/t/textwidth-is-not-the-correct-width/39158 "2022-10-09T01:37:41Z")

</div>

If i create a normal line, with “line(startX, startY, startX+textWidth(STRING), startY)” the line is not the correct width. I fixed it by making a “rect()” with the y size on “0.5”!

---

## [Copying and spawning object from an array](https://discourse.processing.org/t/copying-and-spawning-object-from-an-array/39138)

<div class="topic-metadata">

**Author:** [@shon121212](https://discourse.processing.org/u/shon121212)\
**Replies:** 1\
**Last updated:** [October 7, 2022, 5:20pm UTC](https://discourse.processing.org/t/copying-and-spawning-object-from-an-array/39138 "2022-10-07T17:20:48Z")

</div>

so what im trying to do is spawn a ball with some attributes and after 5 seconds i want to create spawn another one of this balls up untill 7 but im not sure how to “add” new ball to the array with the same attributes th…

---

## [Changing which browser PDE users on Run command](https://discourse.processing.org/t/changing-which-browser-pde-users-on-run-command/39107)

<div class="topic-metadata">

**Author:** [@Tatcoddes](https://discourse.processing.org/u/Tatcoddes)\
**Replies:** 3\
**Last updated:** [October 7, 2022, 12:16am UTC](https://discourse.processing.org/t/changing-which-browser-pde-users-on-run-command/39107 "2022-10-07T00:16:43Z")

</div>

Newbie Question When I hit “Run” I would like my sketch to open in Chrome and not Safari, but I need to keep safari as my default browser. I saw another thread where it suggested going into the preferences.txt file and …

---

## [How to copy clipped rect of an image to another filename?](https://discourse.processing.org/t/how-to-copy-clipped-rect-of-an-image-to-another-filename/39054)

<div class="topic-metadata">

**Author:** [@bhaskar1955](https://discourse.processing.org/u/bhaskar1955)\
**Replies:** 8\
**Last updated:** [October 5, 2022, 6:10am UTC](https://discourse.processing.org/t/how-to-copy-clipped-rect-of-an-image-to-another-filename/39054 "2022-10-05T06:10:52Z")

</div>

\</\> button \* homework policy \* asking questions I think the topic name is self-explanatory. Please help me.

---

## [Why my draw() don't drawing continuously?](https://discourse.processing.org/t/why-my-draw-dont-drawing-continuously/39078)

<div class="topic-metadata">

**Author:** [@C2014](https://discourse.processing.org/u/C2014)\
**Replies:** 15\
**Last updated:** [October 4, 2022, 4:21pm UTC](https://discourse.processing.org/t/why-my-draw-dont-drawing-continuously/39078 "2022-10-04T16:21:17Z")

</div>

void setup () { size (842,480);frameRate(20);} float x = random (842); float y = random (480); float r = random (256); float g = random (256); float b = random (256); void draw () {loop ();fill (r,g,b);rect (x,y,x,y);}…

---

## [Why no error on dividing by zero](https://discourse.processing.org/t/why-no-error-on-dividing-by-zero/39065)

<div class="topic-metadata">

**Author:** [@prathmesh](https://discourse.processing.org/u/prathmesh)\
**Replies:** 4\
**Last updated:** [October 4, 2022, 6:43am UTC](https://discourse.processing.org/t/why-no-error-on-dividing-by-zero/39065 "2022-10-04T06:43:01Z")

</div>

Namaste everyone, Why does “int x = 200/0;” gives an error but int x = 200/20\*0; gives the value as 0.? Thanks.

---

## [Colours continuously changing based on array values](https://discourse.processing.org/t/colours-continuously-changing-based-on-array-values/39041)

<div class="topic-metadata">

**Author:** [@Ficus](https://discourse.processing.org/u/Ficus)\
**Replies:** 4\
**Last updated:** [October 2, 2022, 1:29pm UTC](https://discourse.processing.org/t/colours-continuously-changing-based-on-array-values/39041 "2022-10-02T13:29:58Z")

</div>

Hey all, I have a data visualisation task for class and need to show how temperature changes over time. My idea is to have the fill react to the temperature values. So, I have an array of float values (length is 1438) …

---

## [Assign undetermined number of variables in method](https://discourse.processing.org/t/assign-undetermined-number-of-variables-in-method/39046)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 2\
**Last updated:** [October 2, 2022, 12:33pm UTC](https://discourse.processing.org/t/assign-undetermined-number-of-variables-in-method/39046 "2022-10-02T12:33:11Z")

</div>

please format code with \</\> button \* homework policy \* asking questions What is the syntax for adding an undermined amount of variables to a method. ie void method(int a,int b,int c.....){ }

---

## [How do I make my character only stop on whole tiles?](https://discourse.processing.org/t/how-do-i-make-my-character-only-stop-on-whole-tiles/39031)

<div class="topic-metadata">

**Author:** [@Marfmamow](https://discourse.processing.org/u/Marfmamow)\
**Replies:** 7\
**Last updated:** [October 2, 2022, 9:48am UTC](https://discourse.processing.org/t/how-do-i-make-my-character-only-stop-on-whole-tiles/39031 "2022-10-02T09:48:24Z")

</div>

I’ve managed to make my sprite move, and it currently moves 2 positions each press of the arrow key. My map is made up of grids of 20x20 pixels, and I’d like my character to only stop on whole tiles, to prevent any coll…

---

## [Display sprites in sequence](https://discourse.processing.org/t/display-sprites-in-sequence/39016)

<div class="topic-metadata">

**Author:** [@dmlong](https://discourse.processing.org/u/dmlong)\
**Replies:** 7\
**Last updated:** [October 1, 2022, 9:10am UTC](https://discourse.processing.org/t/display-sprites-in-sequence/39016 "2022-10-01T09:10:22Z")

</div>

Hi all, So I have an object in Java with a sprite associated to it. I also have an array of 4 different PImages, and I want to gradually change the sprite of that object into each of the PImages in that array (technical…

---

## [Trying to create a gradient color of orange](https://discourse.processing.org/t/trying-to-create-a-gradient-color-of-orange/38996)

<div class="topic-metadata">

**Author:** [@Shu](https://discourse.processing.org/u/Shu)\
**Replies:** 4\
**Last updated:** [September 28, 2022, 1:04am UTC](https://discourse.processing.org/t/trying-to-create-a-gradient-color-of-orange/38996 "2022-09-28T01:04:52Z")

</div>

color c; void setup() { size(1000, 1000); c = color(237, 115, 12); strokeWeight(4); rectMode(CENTER); noLoop(); } void draw() { background(220); for(int i=0;i\<=20;i++){ circle(500,500,300-i\*15); } f…

---

## [Writing my first Class, and getting in trouble already](https://discourse.processing.org/t/writing-my-first-class-and-getting-in-trouble-already/38844)

<div class="topic-metadata">

**Author:** [@laptophead](https://discourse.processing.org/u/laptophead)\
**Replies:** 10\
**Last updated:** [September 22, 2022, 7:54pm UTC](https://discourse.processing.org/t/writing-my-first-class-and-getting-in-trouble-already/38844 "2022-09-22T19:54:23Z")

</div>

please format code with \</\> button \* homework policy \* asking questions I have a need to make my objects in an array. I am getting Null Pointer already… What am I doing wrong? Thanks Blocks\[\] Bl = new Blocks\[20\];…

---

## [Nomenclature question for finding information about combining classes](https://discourse.processing.org/t/nomenclature-question-for-finding-information-about-combining-classes/38919)

<div class="topic-metadata">

**Author:** [@debxyz](https://discourse.processing.org/u/debxyz)\
**Replies:** 6\
**Last updated:** [September 22, 2022, 4:01am UTC](https://discourse.processing.org/t/nomenclature-question-for-finding-information-about-combining-classes/38919 "2022-09-22T04:01:21Z")

</div>

Hello!! Is this called nested classes? I need to know the correct name for placing a class within a class so I can search for reference materials. For example, if I have 3 separate classes: 1st one = Grid class 2nd …

---

## [Converting from int to long](https://discourse.processing.org/t/converting-from-int-to-long/38923)

<div class="topic-metadata">

**Author:** [@REK166](https://discourse.processing.org/u/REK166)\
**Replies:** 4\
**Last updated:** [September 21, 2022, 7:17pm UTC](https://discourse.processing.org/t/converting-from-int-to-long/38923 "2022-09-21T19:17:53Z")

</div>

how can i convert an int type into a long type value?

---

## [Saving the sketch to a high quality JPG file](https://discourse.processing.org/t/saving-the-sketch-to-a-high-quality-jpg-file/38846)

<div class="topic-metadata">

**Author:** [@Nik](https://discourse.processing.org/u/Nik)\
**Replies:** 2\
**Last updated:** [September 19, 2022, 4:01pm UTC](https://discourse.processing.org/t/saving-the-sketch-to-a-high-quality-jpg-file/38846 "2022-09-19T16:01:45Z")

</div>

Does anyone know how to save processing sketch as a high quality jpg file? When i use save(“\*.jpg”); and even set it to high resolution, the quality for some works is low, the colors of the original work and the saved…

---

## [Looks like you are mixing "active" and "static" modes](https://discourse.processing.org/t/looks-like-you-are-mixing-active-and-static-modes/38833)

<div class="topic-metadata">

**Author:** [@RobM](https://discourse.processing.org/u/RobM)\
**Replies:** 2\
**Last updated:** [September 18, 2022, 10:22am UTC](https://discourse.processing.org/t/looks-like-you-are-mixing-active-and-static-modes/38833 "2022-09-18T10:22:07Z")

</div>

void placeRectangle2() { myRect = loadImage("myRect.jpg"); myRect.loadPixels(); loadPixels(); for(int j=0;j\<height;j++){ for(int i=0;i\<width;i++){ int loc=i+j\*width; pixels\[loc\]=myRect.pixels\[…

---

## [Projection in Processing](https://discourse.processing.org/t/projection-in-processing/38741)

<div class="topic-metadata">

**Author:** [@xfred53](https://discourse.processing.org/u/xfred53)\
**Replies:** 1\
**Last updated:** [September 14, 2022, 3:34pm UTC](https://discourse.processing.org/t/projection-in-processing/38741 "2022-09-14T15:34:11Z")

</div>

Hi, Using P3D, I’m looking for a way to draw projections of a shape on a plane. Are there some libraries that could help me ? Thanks.

---

## [Get coordinates from a rectangle](https://discourse.processing.org/t/get-coordinates-from-a-rectangle/38740)

<div class="topic-metadata">

**Author:** [@xfred53](https://discourse.processing.org/u/xfred53)\
**Replies:** 1\
**Last updated:** [September 13, 2022, 3:55pm UTC](https://discourse.processing.org/t/get-coordinates-from-a-rectangle/38740 "2022-09-13T15:55:02Z")

</div>

Hi, Is it possible to get the coordinates of the angles of a rectangle after some transformations ? See following code : size(200,200,P3D); rectMode(CENTER); pushMatrix(); translate(50,100,0); rotateX(45); rect(50,50,…

---

## [Perlin Noise in Static Sketch Examples](https://discourse.processing.org/t/perlin-noise-in-static-sketch-examples/38711)

<div class="topic-metadata">

**Author:** [@i-draw-monkeys](https://discourse.processing.org/u/i-draw-monkeys)\
**Replies:** 5\
**Last updated:** [September 13, 2022, 2:25pm UTC](https://discourse.processing.org/t/perlin-noise-in-static-sketch-examples/38711 "2022-09-13T14:25:54Z")

</div>

I am learning and using Processing to build files for my pen plotter. I love using the random function and want to start subbing in the noise function and see what happens. However, as it is not a one to one substitution…

---

## [Detect collision side for balls and rectangles](https://discourse.processing.org/t/detect-collision-side-for-balls-and-rectangles/38699)

<div class="topic-metadata">

**Author:** [@turke1034](https://discourse.processing.org/u/turke1034)\
**Replies:** 11\
**Last updated:** [September 12, 2022, 12:55am UTC](https://discourse.processing.org/t/detect-collision-side-for-balls-and-rectangles/38699 "2022-09-12T00:55:18Z")

</div>

I am creating a “physics simulation” with objects that are affected by gravity, friction and wind. The main object is a ball that bounces around the screen, in realistic ways according to the physics modifiers the user c…

---

## [Trying to modifiy a variable in a class and access it from a subclass](https://discourse.processing.org/t/trying-to-modifiy-a-variable-in-a-class-and-access-it-from-a-subclass/38691)

<div class="topic-metadata">

**Author:** [@xfred53](https://discourse.processing.org/u/xfred53)\
**Replies:** 5\
**Last updated:** [September 9, 2022, 1:27pm UTC](https://discourse.processing.org/t/trying-to-modifiy-a-variable-in-a-class-and-access-it-from-a-subclass/38691 "2022-09-09T13:27:36Z")

</div>

Hi, A beginner question for sure but cannot solve it all alone. I have a first class (One) with a single field that is initiated with its constructor. I can access it from method (display) of this class. I then have …

---

## [Get main processing file to have access to other files in other directories](https://discourse.processing.org/t/get-main-processing-file-to-have-access-to-other-files-in-other-directories/38667)

<div class="topic-metadata">

**Author:** [@Theis](https://discourse.processing.org/u/Theis)\
**Replies:** 4\
**Last updated:** [September 7, 2022, 8:41pm UTC](https://discourse.processing.org/t/get-main-processing-file-to-have-access-to-other-files-in-other-directories/38667 "2022-09-07T20:41:23Z")

</div>

Hey, I would like to know if it is possible to have the main processing file be able to read from other processing files in subfolders?

---

## [Beginner question on drawing mulitple random shapes related to each other?](https://discourse.processing.org/t/beginner-question-on-drawing-mulitple-random-shapes-related-to-each-other/38552)

<div class="topic-metadata">

**Author:** [@i-draw-monkeys](https://discourse.processing.org/u/i-draw-monkeys)\
**Replies:** 12\
**Last updated:** [September 5, 2022, 9:54pm UTC](https://discourse.processing.org/t/beginner-question-on-drawing-mulitple-random-shapes-related-to-each-other/38552 "2022-09-05T21:54:41Z")

</div>

I’ve been learning Processing for about a month and have a new idea and am not quite sure how to approach. What would your approach be? Like what do I need to look up and learn to write something where I draw a shape usi…

---

## [Name of variable (file exists)](https://discourse.processing.org/t/name-of-variable-file-exists/38527)

<div class="topic-metadata">

**Author:** [@jensemand](https://discourse.processing.org/u/jensemand)\
**Replies:** 5\
**Last updated:** [August 28, 2022, 6:01pm UTC](https://discourse.processing.org/t/name-of-variable-file-exists/38527 "2022-08-28T18:01:21Z")

</div>

Hi, I need to check if i have a specific file named positions1, positions2, positions3,… I thought I could combine a string with an integer and then write something like File nameofString+number= new File(sketchPath()…

---

## [Set Height and Width of Display Area using Variables?](https://discourse.processing.org/t/set-height-and-width-of-display-area-using-variables/38468)

<div class="topic-metadata">

**Author:** [@digitalArtform](https://discourse.processing.org/u/digitalArtform)\
**Replies:** 1\
**Last updated:** [August 23, 2022, 8:14pm UTC](https://discourse.processing.org/t/set-height-and-width-of-display-area-using-variables/38468 "2022-08-23T20:14:42Z")

</div>

Is it possible to first load an image, and then use the height and width of the loaded image to specify the height and width of the Processing canvas? Every example I see already knows the needed canvas height and width …

---

## [Can someone help draw a robot?](https://discourse.processing.org/t/can-someone-help-draw-a-robot/38461)

<div class="topic-metadata">

**Author:** [@Frost](https://discourse.processing.org/u/Frost)\
**Replies:** 11\
**Last updated:** [August 23, 2022, 12:39pm UTC](https://discourse.processing.org/t/can-someone-help-draw-a-robot/38461 "2022-08-23T12:39:40Z")

</div>

i need to make a target that includes ellipses, triangles, rectangles and lines. so im trying to make a robot but im struggling on drawing the triangles and lines. i was thinking to have two triangles for ears directly a…

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

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