# Beginners

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

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

**Page:** 15

---

## [Create and objects in ArrayList when mouse is pressed](https://discourse.processing.org/t/create-and-objects-in-arraylist-when-mouse-is-pressed/34887)

<div class="topic-metadata">

**Author:** [@alex119](https://discourse.processing.org/u/alex119)\
**Replies:** 3\
**Last updated:** [January 29, 2022, 6:46pm UTC](https://discourse.processing.org/t/create-and-objects-in-arraylist-when-mouse-is-pressed/34887 "2022-01-29T18:46:19Z")

</div>

Hello, I’m following natureofcode book and I’m trying to make an exercise where some objects are shot out of a cannon. The main issue I’m facing is that when I verify for mousePressed, I add to an ArrayList a new bulle…

---

## [Refresh Run - Key Pressed](https://discourse.processing.org/t/refresh-run-key-pressed/34848)

<div class="topic-metadata">

**Author:** [@Copious-plains](https://discourse.processing.org/u/Copious-plains)\
**Replies:** 1\
**Last updated:** [January 26, 2022, 8:00pm UTC](https://discourse.processing.org/t/refresh-run-key-pressed/34848 "2022-01-26T20:00:05Z")

</div>

Hi, I have a problem. I want to write a code that will refresh an image (refresh the Run) after every key pressed and export/save image as a for example TIFF. or PNG. I’ve got this for now. Do you know how should I do …

---

## [A Processing precision problem?](https://discourse.processing.org/t/a-processing-precision-problem/34693)

<div class="topic-metadata">

**Author:** [@coderambler](https://discourse.processing.org/u/coderambler)\
**Replies:** 2\
**Last updated:** [January 18, 2022, 5:45pm UTC](https://discourse.processing.org/t/a-processing-precision-problem/34693 "2022-01-18T17:45:33Z")

</div>

The code example below inscribes a circle within a square. In the result however, the circle is moved one point up and one point left, relative to the square. Check the picture: The borderless circle is tipping over th…

---

## [selectInput() not opening file dialogue when used as intended](https://discourse.processing.org/t/selectinput-not-opening-file-dialogue-when-used-as-intended/34697)

<div class="topic-metadata">

**Author:** [@Crysp](https://discourse.processing.org/u/Crysp)\
**Replies:** 7\
**Last updated:** [January 18, 2022, 10:07am UTC](https://discourse.processing.org/t/selectinput-not-opening-file-dialogue-when-used-as-intended/34697 "2022-01-18T10:07:43Z")

</div>

Hello. I am on a Macbook running macOS Monterey 12.0.1 and I found an issue (or a mistake I wasn’t able to solve) with selectInput() in Processing. My goal was to use it to pass an image to the program which I then do wh…

---

## [Delete leftmost circle on the canvas](https://discourse.processing.org/t/delete-leftmost-circle-on-the-canvas/34663)

<div class="topic-metadata">

**Author:** [@processingboy1](https://discourse.processing.org/u/processingboy1)\
**Replies:** 2\
**Last updated:** [January 17, 2022, 7:14pm UTC](https://discourse.processing.org/t/delete-leftmost-circle-on-the-canvas/34663 "2022-01-17T19:14:54Z")

</div>

I was able to write a code that draws different circles on a canvas and i need to find a way i could delete the leftmost circle when any key is pressed. i’ve been at this for hours and i feel like i am close to the answe…

---

## [Can I draw a figure every x milliseconds?](https://discourse.processing.org/t/can-i-draw-a-figure-every-x-milliseconds/34611)

<div class="topic-metadata">

**Author:** [@Patriche98](https://discourse.processing.org/u/Patriche98)\
**Replies:** 5\
**Last updated:** [January 14, 2022, 12:02pm UTC](https://discourse.processing.org/t/can-i-draw-a-figure-every-x-milliseconds/34611 "2022-01-14T12:02:36Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hi! I’m new to programming and I’m challenging myself trying to: -Draw a vertical line that moves to the left (or right) of the screen every x …

---

## [Need help making all circles flicker](https://discourse.processing.org/t/need-help-making-all-circles-flicker/34618)

<div class="topic-metadata">

**Author:** [@processingboy1](https://discourse.processing.org/u/processingboy1)\
**Replies:** 1\
**Last updated:** [January 14, 2022, 1:13pm UTC](https://discourse.processing.org/t/need-help-making-all-circles-flicker/34618 "2022-01-14T13:13:15Z")

</div>

Hey! i am trying to make all the circles i draw flicker in my code. i am currently able to make the latest circle that was drawn to flicker but the goal is to make all the circles on the canvas flicker. here is my code…

---

## [Does Processing have default values for certain alphabets?](https://discourse.processing.org/t/does-processing-have-default-values-for-certain-alphabets/34574)

<div class="topic-metadata">

**Author:** [@prathmesh](https://discourse.processing.org/u/prathmesh)\
**Replies:** 2\
**Last updated:** [January 13, 2022, 10:39pm UTC](https://discourse.processing.org/t/does-processing-have-default-values-for-certain-alphabets/34574 "2022-01-13T22:39:51Z")

</div>

Namaste All, So I wrote the following code : void setup(){ } void draw(){ println(X); } This gives me a value of 0. If I do the same thing with Y it gives a value of 1, with Z a value of 2. Doesn’t work with all th…

---

## [Create fireworks](https://discourse.processing.org/t/create-fireworks/34552)

<div class="topic-metadata">

**Author:** [@cimi](https://discourse.processing.org/u/cimi)\
**Replies:** 1\
**Last updated:** [January 12, 2022, 8:55pm UTC](https://discourse.processing.org/t/create-fireworks/34552 "2022-01-12T20:55:33Z")

</div>

Hello everyone, I want to create fireworks, my idea is that when I click a firework is created that moves upwards, and once it exceeds 1/4 of the height of the screen it disappears and instead 10 is created sparks that s…

---

## [Lerp in a Object Class](https://discourse.processing.org/t/lerp-in-a-object-class/34491)

<div class="topic-metadata">

**Author:** [@Noxus010](https://discourse.processing.org/u/Noxus010)\
**Replies:** 0\
**Last updated:** [January 6, 2022, 6:27pm UTC](https://discourse.processing.org/t/lerp-in-a-object-class/34491 "2022-01-06T18:27:10Z")

</div>

Hi people! I just started with processing and I would like to have a class that is loaded before I start the draw function… In this class I wanted to use the lerp function but I get a error “lerp function does not exist”…

---

## [Help changing square colours after time](https://discourse.processing.org/t/help-changing-square-colours-after-time/34467)

<div class="topic-metadata">

**Author:** [@teeny13](https://discourse.processing.org/u/teeny13)\
**Replies:** 15\
**Last updated:** [January 6, 2022, 9:52am UTC](https://discourse.processing.org/t/help-changing-square-colours-after-time/34467 "2022-01-06T09:52:23Z")

</div>

Hey everyone, I’m trying to make the squares I’ve created change their colour randomly. Instead my code is only working on click. The reason I am doing this is so that when a square changes the colour, the person play…

---

## [showMessageDialog() function gives an error](https://discourse.processing.org/t/showmessagedialog-function-gives-an-error/34332)

<div class="topic-metadata">

**Author:** [@BernieLomaxxx](https://discourse.processing.org/u/BernieLomaxxx)\
**Replies:** 3\
**Last updated:** [January 2, 2022, 4:12am UTC](https://discourse.processing.org/t/showmessagedialog-function-gives-an-error/34332 "2022-01-02T04:12:27Z")

</div>

hello very new to processing, this code is from the book Processing: An Introduction to Programming when I use showMessageDialog after using JOptionPane i get an error saying "frame cannot be resolved to a variable" im…

---

## [Method from class does not work](https://discourse.processing.org/t/method-from-class-does-not-work/34354)

<div class="topic-metadata">

**Author:** [@marina\_kdot](https://discourse.processing.org/u/marina_kdot)\
**Replies:** 2\
**Last updated:** [December 29, 2021, 10:45pm UTC](https://discourse.processing.org/t/method-from-class-does-not-work/34354 "2021-12-29T22:45:23Z")

</div>

I try to set up a short array and display four squares with random position and size. But I always get a syntax error. I spend lots of time comparing my code to other examples and they are all running, but mine is not. …

---

## [String contraining HEX color to Color value](https://discourse.processing.org/t/string-contraining-hex-color-to-color-value/34380)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 1\
**Last updated:** [December 30, 2021, 6:00pm UTC](https://discourse.processing.org/t/string-contraining-hex-color-to-color-value/34380 "2021-12-30T18:00:07Z")

</div>

I have a txt file that contains colors in the form of #01abEf and I want to load them and turn into processing color variable type. How can I do this? How can I turn “#FF00FF” to color(255,0,255) ?

---

## [Graphics quality compared to OpenFrameworks](https://discourse.processing.org/t/graphics-quality-compared-to-openframeworks/34308)

<div class="topic-metadata">

**Author:** [@woodwindblues](https://discourse.processing.org/u/woodwindblues)\
**Replies:** 11\
**Last updated:** [December 28, 2021, 9:10am UTC](https://discourse.processing.org/t/graphics-quality-compared-to-openframeworks/34308 "2021-12-28T09:10:28Z")

</div>

I am working on a sketch that is basically a very simple particle system, but the trails are drawn as lines. I wrote one version of the code in processing and one in openFrameworks. The code is nearly identical, but the …

---

## [How to fill indivdual shapes with different colours in a for loop](https://discourse.processing.org/t/how-to-fill-indivdual-shapes-with-different-colours-in-a-for-loop/34271)

<div class="topic-metadata">

**Author:** [@UltimateDoug9](https://discourse.processing.org/u/UltimateDoug9)\
**Replies:** 4\
**Last updated:** [December 26, 2021, 11:12pm UTC](https://discourse.processing.org/t/how-to-fill-indivdual-shapes-with-different-colours-in-a-for-loop/34271 "2021-12-26T23:12:28Z")

</div>

I’m making a drawing program and I want a sidebar that shows the colour options. How would I make each rectangle a different colour if there in a for loop? for (int j = 1; j\<= 3; j++) { for (int i = 1; i\<= 2; i++) { …

---

## [Simulate Mouse movement with Robot](https://discourse.processing.org/t/simulate-mouse-movement-with-robot/34301)

<div class="topic-metadata">

**Author:** [@pml](https://discourse.processing.org/u/pml)\
**Replies:** 0\
**Last updated:** [December 26, 2021, 4:53pm UTC](https://discourse.processing.org/t/simulate-mouse-movement-with-robot/34301 "2021-12-26T16:53:38Z")

</div>

Hello ! I’m attempting to simulate the movement of my mouse with Robot but it does not work : my mouse just jump between the points but the particles don’t follow it. Can you explain me what is wrong with my code ? im…

---

## [Synthetic variable assignment -- this\[String+number\] (IntDict)](https://discourse.processing.org/t/synthetic-variable-assignment-this-string-number-intdict/34267)

<div class="topic-metadata">

**Author:** [@mrbbp](https://discourse.processing.org/u/mrbbp)\
**Replies:** 7\
**Last updated:** [December 23, 2021, 4:09pm UTC](https://discourse.processing.org/t/synthetic-variable-assignment-this-string-number-intdict/34267 "2021-12-23T16:09:33Z")

</div>

Hello, i suppose it’s a newb question and sorry for that. i don’t know how to qualify in english (no more in french)… a composite variable name, a synthetic variable name??? in js your can assign a “synthetic” var na…

---

## [Little stuck on a concept](https://discourse.processing.org/t/little-stuck-on-a-concept/34173)

<div class="topic-metadata">

**Author:** [@Jamii](https://discourse.processing.org/u/Jamii)\
**Replies:** 6\
**Last updated:** [December 20, 2021, 6:28pm UTC](https://discourse.processing.org/t/little-stuck-on-a-concept/34173 "2021-12-20T18:28:14Z")

</div>

I’m really new to processing and I have an idea I want to execute but I’m not too sure where to start in general. I haven’t started just I’m just wondering if anyone has tips on how to do it. I want to create a maze-lik…

---

## [A general question from a code novice](https://discourse.processing.org/t/a-general-question-from-a-code-novice/34163)

<div class="topic-metadata">

**Author:** [@AudioBabble](https://discourse.processing.org/u/AudioBabble)\
**Replies:** 7\
**Last updated:** [December 17, 2021, 4:16pm UTC](https://discourse.processing.org/t/a-general-question-from-a-code-novice/34163 "2021-12-17T16:16:04Z")

</div>

hey all, this is not specifically a processing question, but I have found folks here to be very helpful in the past so would like to see if anyone can help me out… I’m wondering where would be a good place to ask total …

---

## [Split-Screen Mouse click Interaction](https://discourse.processing.org/t/split-screen-mouse-click-interaction/34124)

<div class="topic-metadata">

**Author:** [@JayT808s](https://discourse.processing.org/u/JayT808s)\
**Replies:** 2\
**Last updated:** [December 17, 2021, 12:39am UTC](https://discourse.processing.org/t/split-screen-mouse-click-interaction/34124 "2021-12-17T00:39:59Z")

</div>

Hi, I’m super new to programming and I’ve just been stuck on the same problem for the past few days and I couldn’t find anything on the forums that could help me out. I’m trying to split the screen in two, so that when y…

---

## [I need help with Processing (objects are cut off the screen)](https://discourse.processing.org/t/i-need-help-with-processing-objects-are-cut-off-the-screen/34128)

<div class="topic-metadata">

**Author:** [@rwong5102](https://discourse.processing.org/u/rwong5102)\
**Replies:** 4\
**Last updated:** [December 16, 2021, 3:58am UTC](https://discourse.processing.org/t/i-need-help-with-processing-objects-are-cut-off-the-screen/34128 "2021-12-16T03:58:15Z")

</div>

\[Hello! I am new to processing and this forum, srry if I’m messing up the format. I am trying to have an array of 100 random objects on my canvas but I don’t want the objects to be cut off the screen. Can someone help me…

---

## [Help! I'm trying to tessellate a shape with random vertices](https://discourse.processing.org/t/help-im-trying-to-tessellate-a-shape-with-random-vertices/34093)

<div class="topic-metadata">

**Author:** [@mrgrassoxen](https://discourse.processing.org/u/mrgrassoxen)\
**Replies:** 0\
**Last updated:** [December 13, 2021, 8:19am UTC](https://discourse.processing.org/t/help-im-trying-to-tessellate-a-shape-with-random-vertices/34093 "2021-12-13T08:19:32Z")

</div>

I am able to create a shape and tesselate it (using a for loop) when I have a FIXED number of vertices on the top/bottom and sides. However when I try using a random number of vertices for top/bottom and sides, when I g…

---

## [Slit scan with picture](https://discourse.processing.org/t/slit-scan-with-picture/34073)

<div class="topic-metadata">

**Author:** [@bopbopbop114](https://discourse.processing.org/u/bopbopbop114)\
**Replies:** 2\
**Last updated:** [December 13, 2021, 12:04am UTC](https://discourse.processing.org/t/slit-scan-with-picture/34073 "2021-12-13T00:04:10Z")

</div>

Hi everybody, i want to ask if processing can do slit scan with pictures thank you

---

## [Create random curve from X points](https://discourse.processing.org/t/create-random-curve-from-x-points/31218)

<div class="topic-metadata">

**Author:** [@yalaniv](https://discourse.processing.org/u/yalaniv)\
**Replies:** 4\
**Last updated:** [December 12, 2021, 1:13pm UTC](https://discourse.processing.org/t/create-random-curve-from-x-points/31218 "2021-12-12T13:13:09Z")

</div>

I want to draw curve from X points, random points. I try to read about the bezierPoint() but not understood completely

---

## [TextToPoints in Processing](https://discourse.processing.org/t/texttopoints-in-processing/34057)

<div class="topic-metadata">

**Author:** [@Omri](https://discourse.processing.org/u/Omri)\
**Replies:** 1\
**Last updated:** [December 11, 2021, 8:17pm UTC](https://discourse.processing.org/t/texttopoints-in-processing/34057 "2021-12-11T20:17:03Z")

</div>

Hey, whats is the equivalent to the function TextToPoints (P5) in Processing? thanks :slight\_smile:

---

## [Why doesn't FOR-EACH give every output a different VALUE from ARRAY?](https://discourse.processing.org/t/why-doesnt-for-each-give-every-output-a-different-value-from-array/33987)

<div class="topic-metadata">

**Author:** [@badbatman](https://discourse.processing.org/u/badbatman)\
**Replies:** 2\
**Last updated:** [December 8, 2021, 8:17pm UTC](https://discourse.processing.org/t/why-doesnt-for-each-give-every-output-a-different-value-from-array/33987 "2021-12-08T20:17:08Z")

</div>

I made an array that I output in a loop. But every item I assign the array it keep giving the same value while I’ve put 4 values into the array. I’ve tried everything but it keeps giving the same value (330). I have also…

---

## [How do I calculate the cube root?](https://discourse.processing.org/t/how-do-i-calculate-the-cube-root/33988)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 14\
**Last updated:** [December 8, 2021, 11:05am UTC](https://discourse.processing.org/t/how-do-i-calculate-the-cube-root/33988 "2021-12-08T11:05:42Z")

</div>

I am trying to find all numbers with an integer cube root, but it hasn’t worked because appareantly cbrt() isn’t a processing supported function. how do I do this? this is my code: int x= 1; if(cbrt(x)==int(cbrt(x)){ …

---

## [Counting clicks on images](https://discourse.processing.org/t/counting-clicks-on-images/33972)

<div class="topic-metadata">

**Author:** [@tlinston](https://discourse.processing.org/u/tlinston)\
**Replies:** 1\
**Last updated:** [December 7, 2021, 4:21am UTC](https://discourse.processing.org/t/counting-clicks-on-images/33972 "2021-12-07T04:21:08Z")

</div>

I’m making a game where there needs to be a counter for every time I click on a certain image. I’ve loaded in the image and set up the counter but I’m not sure how to go about putting details in the void mouseClicked ar…

---

## [How to divide a image/video into multiple pieces?](https://discourse.processing.org/t/how-to-divide-a-image-video-into-multiple-pieces/33965)

<div class="topic-metadata">

**Author:** [@badbatman](https://discourse.processing.org/u/badbatman)\
**Replies:** 1\
**Last updated:** [December 6, 2021, 7:54pm UTC](https://discourse.processing.org/t/how-to-divide-a-image-video-into-multiple-pieces/33965 "2021-12-06T19:54:06Z")

</div>

How can I break a image of video into multiple pieces? I want to do this with camera capture in the end. Any advice is welcome. Thank you. So something like this:

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

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