# Beginners

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

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

**Page:** 37

---

## [Rotating rects around a circle perimeter pointing to the center](https://discourse.processing.org/t/rotating-rects-around-a-circle-perimeter-pointing-to-the-center/9868)

<div class="topic-metadata">

**Author:** [@Michalis](https://discourse.processing.org/u/Michalis)\
**Replies:** 7\
**Last updated:** [April 2, 2019, 3:13pm UTC](https://discourse.processing.org/t/rotating-rects-around-a-circle-perimeter-pointing-to-the-center/9868 "2019-04-02T15:13:09Z")

</div>

Hello, I want to achieve something like this but I have no idea how. I checked almost every example, on the application and on the website, checked libraries, googled, but still, I didn’t manage to find a solution (sorr…

---

## [displayWidth: deprecation?](https://discourse.processing.org/t/displaywidth-deprecation/9760)

<div class="topic-metadata">

**Author:** [@Eamoex](https://discourse.processing.org/u/Eamoex)\
**Replies:** 6\
**Last updated:** [April 1, 2019, 8:32am UTC](https://discourse.processing.org/t/displaywidth-deprecation/9760 "2019-04-01T08:32:50Z")

</div>

Hello All, coming back to Processing after a while. Actually I haven’t dealt much with 3.0 (it was already out when I still had my hands in 2.0, but all my sketches were 2.0 and I stuck there, being too lazy for rewrite…

---

## [What is the use of int()?](https://discourse.processing.org/t/what-is-the-use-of-int/9628)

<div class="topic-metadata">

**Author:** [@L.L](https://discourse.processing.org/u/L.L)\
**Replies:** 8\
**Last updated:** [March 27, 2019, 12:24am UTC](https://discourse.processing.org/t/what-is-the-use-of-int/9628 "2019-03-27T00:24:30Z")

</div>

Hello guys. I just started to learn to code in Processing. Though I’m finding it hard to understand the code int() (yes the one with the parenthesis). What it is for? Why do we need to use this code? And in what situatio…

---

## [Interesting(?) type coercion](https://discourse.processing.org/t/interesting-type-coercion/9248)

<div class="topic-metadata">

**Author:** [@saintrain](https://discourse.processing.org/u/saintrain)\
**Replies:** 4\
**Last updated:** [March 14, 2019, 11:58pm UTC](https://discourse.processing.org/t/interesting-type-coercion/9248 "2019-03-14T23:58:53Z")

</div>

Hi! Starting with int framePer = floor(1000./frameRate), bgTO = 1000; // \<- this is not interesting This is ok: int dClr = floor(255\*framePer/bgTO); // \<- expected This fails with a ‘can’t f…

---

## [How to check if an Array was defined?](https://discourse.processing.org/t/how-to-check-if-an-array-was-defined/9297)

<div class="topic-metadata">

**Author:** [@Schred](https://discourse.processing.org/u/Schred)\
**Replies:** 2\
**Last updated:** [March 14, 2019, 4:48pm UTC](https://discourse.processing.org/t/how-to-check-if-an-array-was-defined/9297 "2019-03-14T16:48:24Z")

</div>

Hi! So I have this String Array in my little programm called allData and it is defined by allData = saveStrings(URL);. But what if there’s no wifi connection on the device? The programm will crash instantly, because I u…

---

## [What is the radii argument for rectangles?](https://discourse.processing.org/t/what-is-the-radii-argument-for-rectangles/9129)

<div class="topic-metadata">

**Author:** [@kkxxbdm](https://discourse.processing.org/u/kkxxbdm)\
**Replies:** 2\
**Last updated:** [March 9, 2019, 9:09am UTC](https://discourse.processing.org/t/what-is-the-radii-argument-for-rectangles/9129 "2019-03-09T09:09:34Z")

</div>

rectMode(CENTER); rect(0, 0, s\*xscale, s\*yscale, 7); /// 0: x-coordinate, 0: y-coordinate, s\*xscale: width, s\*yscale: height, 7: the radii for all four corner How to understand that 7 is the radii for all four corners …

---

## [Key == someVariable does not work](https://discourse.processing.org/t/key-somevariable-does-not-work/9130)

<div class="topic-metadata">

**Author:** [@jetjaguar](https://discourse.processing.org/u/jetjaguar)\
**Replies:** 1\
**Last updated:** [March 9, 2019, 12:22am UTC](https://discourse.processing.org/t/key-somevariable-does-not-work/9130 "2019-03-09T00:22:00Z")

</div>

I’d like to use a variable (int) with the key function, but it doesn’t work with or without single quotes. What can I do? if(key == someVariable){ … } Thank you!

---

## [How does map.draw() function in Unfolding Map work?](https://discourse.processing.org/t/how-does-map-draw-function-in-unfolding-map-work/9125)

<div class="topic-metadata">

**Author:** [@kkxxbdm](https://discourse.processing.org/u/kkxxbdm)\
**Replies:** 1\
**Last updated:** [March 9, 2019, 12:09am UTC](https://discourse.processing.org/t/how-does-map-draw-function-in-unfolding-map-work/9125 "2019-03-09T00:09:14Z")

</div>

Hi, I was trying to search information about this map.draw() function, but I did not find anything about this at all. Could anyone kindly let me know the purpose of this function or point to some links/references? The f…

---

## [Cannot be resolved or is not a field error](https://discourse.processing.org/t/cannot-be-resolved-or-is-not-a-field-error/9001)

<div class="topic-metadata">

**Author:** [@kennyd](https://discourse.processing.org/u/kennyd)\
**Replies:** 1\
**Last updated:** [March 8, 2019, 11:39pm UTC](https://discourse.processing.org/t/cannot-be-resolved-or-is-not-a-field-error/9001 "2019-03-08T23:39:56Z")

</div>

Good morning, I’m fairly new to processing, and ran into some trouble with my code regarding an error “body cannot be resolved or is not a field”. Processing also tells me that the global variable body does not exist, d…

---

## [Newbie - trying to change colors](https://discourse.processing.org/t/newbie-trying-to-change-colors/8870)

<div class="topic-metadata">

**Author:** [@BBG](https://discourse.processing.org/u/BBG)\
**Replies:** 2\
**Last updated:** [March 3, 2019, 7:37am UTC](https://discourse.processing.org/t/newbie-trying-to-change-colors/8870 "2019-03-03T07:37:08Z")

</div>

So what I want is to change the color of the background of this processing project. I keep being told that a } bracket is missing and an expecting EOF (not sure what that means). Can anyone point out what it is that I …

---

## [mousePressed not updating in while loop](https://discourse.processing.org/t/mousepressed-not-updating-in-while-loop/8793)

<div class="topic-metadata">

**Author:** [@Wangmaster](https://discourse.processing.org/u/Wangmaster)\
**Replies:** 6\
**Last updated:** [March 3, 2019, 1:13am UTC](https://discourse.processing.org/t/mousepressed-not-updating-in-while-loop/8793 "2019-03-03T01:13:06Z")

</div>

Sorry if this questions is a little basic, but I’m tearing my hair out trying to get my code to work. After some troubleshooting i narrowed the offending section to the following snippet: void setup(){ size(400,400); …

---

## [\[\]\[\] ,What does that symbol mean?](https://discourse.processing.org/t/what-does-that-symbol-mean/8860)

<div class="topic-metadata">

**Author:** [@ximi](https://discourse.processing.org/u/ximi)\
**Replies:** 2\
**Last updated:** [March 2, 2019, 2:18pm UTC](https://discourse.processing.org/t/what-does-that-symbol-mean/8860 "2019-03-02T14:18:11Z")

</div>

if (m\[x/sTile\]\[y/sTile\] == 0) fill(c0); in the code above,\[\]\[\] means m\[\]\*m\[\] ?

---

## [How to take frame not from all window](https://discourse.processing.org/t/how-to-take-frame-not-from-all-window/8683)

<div class="topic-metadata">

**Author:** [@Grisha](https://discourse.processing.org/u/Grisha)\
**Replies:** 2\
**Last updated:** [February 26, 2019, 8:48am UTC](https://discourse.processing.org/t/how-to-take-frame-not-from-all-window/8683 "2019-02-26T08:48:45Z")

</div>

How to take frame not from all window? I need to save only one part of my window .

---

## [While loop question](https://discourse.processing.org/t/while-loop-question/1230)

<div class="topic-metadata">

**Author:** [@Parastoo](https://discourse.processing.org/u/Parastoo)\
**Replies:** 7\
**Last updated:** [February 23, 2019, 9:20am UTC](https://discourse.processing.org/t/while-loop-question/1230 "2019-02-23T09:20:13Z")

</div>

I was watching The Coding Train’s While Loop tutorial (lesson 6.1-see link below). I had a really hard time digesting it and still don’t quite understand one thing. Why does it matter to reset x=0? I mean if you put “x=…

---

## [Enun memory size](https://discourse.processing.org/t/enun-memory-size/8418)

<div class="topic-metadata">

**Author:** [@FurryNightShade](https://discourse.processing.org/u/FurryNightShade)\
**Replies:** 3\
**Last updated:** [February 21, 2019, 12:58pm UTC](https://discourse.processing.org/t/enun-memory-size/8418 "2019-02-21T12:58:05Z")

</div>

Hello, just a quick question, how much memory does an enum value need? How about this example: enum Figure{ EMPTY, WHITE\_PAWN, BLACK\_PAWN, WHITE\_QUEEN, BLACK\_QUEEN }

---

## [\[SOLVED\] A good way to compress nested "if else" statements?](https://discourse.processing.org/t/solved-a-good-way-to-compress-nested-if-else-statements/8419)

<div class="topic-metadata">

**Author:** [@kandles11](https://discourse.processing.org/u/kandles11)\
**Replies:** 8\
**Last updated:** [February 21, 2019, 4:36am UTC](https://discourse.processing.org/t/solved-a-good-way-to-compress-nested-if-else-statements/8419 "2019-02-21T04:36:36Z")

</div>

hey yall, i have a long script that lets a user choose a team once they enter a set of characters. it goes through a long list of if else statements in order to choose it. are there any other commands that would be more …

---

## [Beginner's Bad Luck](https://discourse.processing.org/t/beginners-bad-luck/8542)

<div class="topic-metadata">

**Author:** [@stevenoneilsteven](https://discourse.processing.org/u/stevenoneilsteven)\
**Replies:** 3\
**Last updated:** [February 20, 2019, 9:06am UTC](https://discourse.processing.org/t/beginners-bad-luck/8542 "2019-02-20T09:06:55Z")

</div>

Hello, I have been playing with Processing for the first time and have reached an obstacle. void setup () { size(1920,1080); background(0); } void draw () { if (mousePressed) { fill(0); ellipse(mou…

---

## [Moving an image with key presses](https://discourse.processing.org/t/moving-an-image-with-key-presses/8432)

<div class="topic-metadata">

**Author:** [@Supergreek72](https://discourse.processing.org/u/Supergreek72)\
**Replies:** 4\
**Last updated:** [February 16, 2019, 3:26am UTC](https://discourse.processing.org/t/moving-an-image-with-key-presses/8432 "2019-02-16T03:26:24Z")

</div>

so I am trying to do movement of a image with the arrow buttons and it says “the operator == is undefined for the argument type(s) Boolean, int” (i have no clue how to fix this and i don’t understand why it is happeni…

---

## [Creating an Array](https://discourse.processing.org/t/creating-an-array/8334)

<div class="topic-metadata">

**Author:** [@Awal](https://discourse.processing.org/u/Awal)\
**Replies:** 8\
**Last updated:** [February 13, 2019, 5:04pm UTC](https://discourse.processing.org/t/creating-an-array/8334 "2019-02-13T17:04:06Z")

</div>

Hi, I am working on a class assignment but I am stuck. The assignment is Create an int array called salesFigure that will hold 5 elements. Use a for loop to print all the elements. (They should all be 0 since no info…

---

## [\[SOLVED\] Combined Strings not == single string](https://discourse.processing.org/t/solved-combined-strings-not-single-string/8310)

<div class="topic-metadata">

**Author:** [@kandles11](https://discourse.processing.org/u/kandles11)\
**Replies:** 2\
**Last updated:** [February 12, 2019, 3:57am UTC](https://discourse.processing.org/t/solved-combined-strings-not-single-string/8310 "2019-02-12T03:57:18Z")

</div>

Hello, I am having some troubles merging two strings to equal one. I want the two strings, once added together, to be able to == another string. I tried it, but its not printing the line. Any help would be appreciated :s…

---

## [Why does obXX\[0\] below in openprocessing not cause an error?](https://discourse.processing.org/t/why-does-obxx-0-below-in-openprocessing-not-cause-an-error/8197)

<div class="topic-metadata">

**Author:** [@chrisjj](https://discourse.processing.org/u/chrisjj)\
**Replies:** 1\
**Last updated:** [February 9, 2019, 10:53pm UTC](https://discourse.processing.org/t/why-does-obxx-0-below-in-openprocessing-not-cause-an-error/8197 "2019-02-09T22:53:48Z")

</div>

Run this void setup(){ all = new obXX\[0\]; } here in Chrome. Expected: Error. Observed: No error. Why? PS all = new obXX; gives a ReferenceError as expected.

---

## [Color in constructor](https://discourse.processing.org/t/color-in-constructor/8254)

<div class="topic-metadata">

**Author:** [@ZAF](https://discourse.processing.org/u/ZAF)\
**Replies:** 6\
**Last updated:** [February 9, 2019, 8:39pm UTC](https://discourse.processing.org/t/color-in-constructor/8254 "2019-02-09T20:39:30Z")

</div>

Hello there. New to programming here, starting off with processing. How do i assign color to a constructor? I tried with a local variable and did not work out well when initializing it in set up with a color code (whet…

---

## [Problem with frameRate](https://discourse.processing.org/t/problem-with-framerate/8151)

<div class="topic-metadata">

**Author:** [@jensemand](https://discourse.processing.org/u/jensemand)\
**Replies:** 4\
**Last updated:** [February 6, 2019, 11:02am UTC](https://discourse.processing.org/t/problem-with-framerate/8151 "2019-02-06T11:02:55Z")

</div>

Hi i am making a game where the framerate has to be 60. However when i write frameRate(60); in void setup and println(frameCount) in draw it seems the frameCount is around 20. It Would be nice to know if there’s anythi…

---

## [saveFrame location options processing](https://discourse.processing.org/t/saveframe-location-options-processing/8136)

<div class="topic-metadata">

**Author:** [@juriaan](https://discourse.processing.org/u/juriaan)\
**Replies:** 11\
**Last updated:** [February 6, 2019, 3:36am UTC](https://discourse.processing.org/t/saveframe-location-options-processing/8136 "2019-02-06T03:36:09Z")

</div>

Hey couldn’t find this anywhere online but is it possible to save a image from a specific location on my canvas. my canvas is 1400 x 800. but I want the image of only the right 600 x 800. Thanks This is what I have: i…

---

## [Print class variables](https://discourse.processing.org/t/print-class-variables/8142)

<div class="topic-metadata">

**Author:** [@f42ter](https://discourse.processing.org/u/f42ter)\
**Replies:** 1\
**Last updated:** [February 5, 2019, 9:01pm UTC](https://discourse.processing.org/t/print-class-variables/8142 "2019-02-05T21:01:55Z")

</div>

Sorry to bother you again but I’m working on a class with a large number of variables (in C I would implement this as a struct). For debugging purposes I want to print (loop) over all variables inside this class. Unfortu…

---

## [PImage pixel array is an array of ints](https://discourse.processing.org/t/pimage-pixel-array-is-an-array-of-ints/8064)

<div class="topic-metadata">

**Author:** [@mchangxe](https://discourse.processing.org/u/mchangxe)\
**Replies:** 1\
**Last updated:** [February 3, 2019, 8:37am UTC](https://discourse.processing.org/t/pimage-pixel-array-is-an-array-of-ints/8064 "2019-02-03T08:37:28Z")

</div>

im loading a jpg image and displaying the underlying pixel array. The picture has the same amount of pixels as the canvas, which is 438 x 1200. However when printing out the contents of the canvas’ pixel variable and t…

---

## [Save and load string from text file](https://discourse.processing.org/t/save-and-load-string-from-text-file/7994)

<div class="topic-metadata">

**Author:** [@Banansplitt](https://discourse.processing.org/u/Banansplitt)\
**Replies:** 16\
**Last updated:** [February 2, 2019, 7:23pm UTC](https://discourse.processing.org/t/save-and-load-string-from-text-file/7994 "2019-02-02T19:23:36Z")

</div>

I’m trying to use loadString() and saveString() and convert the string to int and the other way around. But I get the errors "Type mismatch, “java.lang.String” does not match with “java.lang.String” on String loadHig…

---

## [Functions that don't have to be called](https://discourse.processing.org/t/functions-that-dont-have-to-be-called/7829)

<div class="topic-metadata">

**Author:** [@germaine](https://discourse.processing.org/u/germaine)\
**Replies:** 4\
**Last updated:** [January 28, 2019, 4:14am UTC](https://discourse.processing.org/t/functions-that-dont-have-to-be-called/7829 "2019-01-28T04:14:24Z")

</div>

I’m used to writing functions and then calling them in draw() or setup(), but in other people’s sketches, I’ve found functions that clearly run but don’t seem to be called or referenced anywhere else in the code. Am I ju…

---

## [Function to return int( from beginner) stuck](https://discourse.processing.org/t/function-to-return-int-from-beginner-stuck/7871)

<div class="topic-metadata">

**Author:** [@angelman](https://discourse.processing.org/u/angelman)\
**Replies:** 4\
**Last updated:** [January 27, 2019, 11:58am UTC](https://discourse.processing.org/t/function-to-return-int-from-beginner-stuck/7871 "2019-01-27T11:58:41Z")

</div>

This is my code. so it prints out the random numbers. But what I want is; like rate1 = first call to RateChoose(); rate2 = second call to RateChoose(); rate3 = third call void RateChoose(){int rate0 = 0; for (int…

---

## [Two syntax questions about arrays and classes](https://discourse.processing.org/t/two-syntax-questions-about-arrays-and-classes/7869)

<div class="topic-metadata">

**Author:** [@femke.blanco](https://discourse.processing.org/u/femke.blanco)\
**Replies:** 2\
**Last updated:** [January 27, 2019, 12:40am UTC](https://discourse.processing.org/t/two-syntax-questions-about-arrays-and-classes/7869 "2019-01-27T00:40:53Z")

</div>

Hi Apologies if these are newbie questions. I have just begun processing. (The full code is at the end of the post.) Question 1: When initialising an array with a “for” loop, why do I have to do so within void setup…

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

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