# Beginners

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

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

**Page:** 38

---

## [Boolean in parameters](https://discourse.processing.org/t/boolean-in-parameters/7853)

<div class="topic-metadata">

**Author:** [@Dinator14](https://discourse.processing.org/u/Dinator14)\
**Replies:** 3\
**Last updated:** [January 26, 2019, 5:54am UTC](https://discourse.processing.org/t/boolean-in-parameters/7853 "2019-01-26T05:54:15Z")

</div>

On the void dead(boolean hit) I get the yellow message saying how the value of the parameter hit is not being used. I’ve realized that putting hit in a conditional statement such as in void show does not bring up this me…

---

## [\[imageLoad()\] disapear when i change size()](https://discourse.processing.org/t/imageload-disapear-when-i-change-size/7702)

<div class="topic-metadata">

**Author:** [@bMan](https://discourse.processing.org/u/bMan)\
**Replies:** 4\
**Last updated:** [January 22, 2019, 12:41am UTC](https://discourse.processing.org/t/imageload-disapear-when-i-change-size/7702 "2019-01-22T00:41:42Z")

</div>

Hi, guys! I’m super new here. I need some help :slight\_smile: I added a image with resolution for example 600x400, and set the size(600,400). Its perfectly works However, When i change size to another value for examp…

---

## [The screen is updating after while loop is completed ? need help](https://discourse.processing.org/t/the-screen-is-updating-after-while-loop-is-completed-need-help/7119)

<div class="topic-metadata">

**Author:** [@liceroy](https://discourse.processing.org/u/liceroy)\
**Replies:** 4\
**Last updated:** [January 20, 2019, 7:36pm UTC](https://discourse.processing.org/t/the-screen-is-updating-after-while-loop-is-completed-need-help/7119 "2019-01-20T19:36:28Z")

</div>

I am using " delay() " inside while loop and making some changes in the screen. I was hoping the changes will be visiable since I am using delay(1000) in every while loop but only the final result is printed on screen …

---

## [Java equivalent of js object\[key\] lookup](https://discourse.processing.org/t/java-equivalent-of-js-object-key-lookup/7345)

<div class="topic-metadata">

**Author:** [@PHuzzeyMusic](https://discourse.processing.org/u/PHuzzeyMusic)\
**Replies:** 1\
**Last updated:** [January 9, 2019, 5:38pm UTC](https://discourse.processing.org/t/java-equivalent-of-js-object-key-lookup/7345 "2019-01-09T17:38:53Z")

</div>

Just started making this Java Swing interface to control lots of parameters in a separate window from my sketch. Is there a way in Java to make references closer to this old jQuery code I made a while ago with ToneJS: t…

---

## ["dvd cannot be resolved to a variable"](https://discourse.processing.org/t/dvd-cannot-be-resolved-to-a-variable/6876)

<div class="topic-metadata">

**Author:** [@C0R4L](https://discourse.processing.org/u/C0R4L)\
**Replies:** 2\
**Last updated:** [January 6, 2019, 10:20pm UTC](https://discourse.processing.org/t/dvd-cannot-be-resolved-to-a-variable/6876 "2019-01-06T22:20:33Z")

</div>

I’ve got a different problem while trying to add a sprite and it says "dvd cannot be resolved to a variable float x = random(200,300); // x location of square float y = random(200,300); // y location of square flo…

---

## [Adding integer to an array (Java)](https://discourse.processing.org/t/adding-integer-to-an-array-java/7247)

<div class="topic-metadata">

**Author:** [@J0R1AN](https://discourse.processing.org/u/J0R1AN)\
**Replies:** 4\
**Last updated:** [January 6, 2019, 5:54pm UTC](https://discourse.processing.org/t/adding-integer-to-an-array-java/7247 "2019-01-06T17:54:16Z")

</div>

Hello everyone, I was experimenting a bit with arrays and integers but I found myself having trouble with adding numbers to an array. I want to create an array, add a number to the array (so the length increases) and pr…

---

## [Is there a way to represent small numbers more precisely than float?](https://discourse.processing.org/t/is-there-a-way-to-represent-small-numbers-more-precisely-than-float/7111)

<div class="topic-metadata">

**Author:** [@Olex](https://discourse.processing.org/u/Olex)\
**Replies:** 3\
**Last updated:** [January 2, 2019, 7:30pm UTC](https://discourse.processing.org/t/is-there-a-way-to-represent-small-numbers-more-precisely-than-float/7111 "2019-01-02T19:30:25Z")

</div>

I need high precision for a project i’m working on and regular floats are not enough. Is there a class or type which has a settable precision?

---

## [Help needed: output window small](https://discourse.processing.org/t/help-needed-output-window-small/6992)

<div class="topic-metadata">

**Author:** [@blkpanther](https://discourse.processing.org/u/blkpanther)\
**Replies:** 4\
**Last updated:** [December 29, 2018, 8:33pm UTC](https://discourse.processing.org/t/help-needed-output-window-small/6992 "2018-12-29T20:33:12Z")

</div>

Hi, sometimes no matter how I set the canvas size, after pressing run, the output is a tiny window. Normally it’s a much bigger canvas. What could be the problem and how to tackle it? Thanks so much.

---

## ["cannot convert float to boolean"](https://discourse.processing.org/t/cannot-convert-float-to-boolean/6822)

<div class="topic-metadata">

**Author:** [@C0R4L](https://discourse.processing.org/u/C0R4L)\
**Replies:** 6\
**Last updated:** [December 24, 2018, 2:30pm UTC](https://discourse.processing.org/t/cannot-convert-float-to-boolean/6822 "2018-12-24T14:30:53Z")

</div>

I was trying to make a DVD screensaver and I’ve come this message “cannot convert float to boolean” I don’t know how to fix it but this is my code to all the geneses on this platform float x = 240; // x location of …

---

## [What is the simplest way to set one array equal to another without linking them](https://discourse.processing.org/t/what-is-the-simplest-way-to-set-one-array-equal-to-another-without-linking-them/6827)

<div class="topic-metadata">

**Author:** [@dragon\_hatcher](https://discourse.processing.org/u/dragon_hatcher)\
**Replies:** 2\
**Last updated:** [December 22, 2018, 6:43pm UTC](https://discourse.processing.org/t/what-is-the-simplest-way-to-set-one-array-equal-to-another-without-linking-them/6827 "2018-12-22T18:43:37Z")

</div>

say I have: int\[\] a = {10, 10}; int\[\] b = {0, 0}; what is the simplest way to set b = a without making the variables linked. (changing a value in a will change a value in b); do I have to use a for loop? p.s. in the…

---

## [Void...question](https://discourse.processing.org/t/void-question/6792)

<div class="topic-metadata">

**Author:** [@IMTDSN](https://discourse.processing.org/u/IMTDSN)\
**Replies:** 5\
**Last updated:** [December 22, 2018, 6:03pm UTC](https://discourse.processing.org/t/void-question/6792 "2018-12-22T18:03:23Z")

</div>

If I create something like this: void setup () { … } void draw () { … if (mousePressed == true) // SCENE is the function that contains the scene number (such as 00, 01, 02, …) SCENE = SCENE + 1; } void scene00 (…

---

## [Creating an array of arrays](https://discourse.processing.org/t/creating-an-array-of-arrays/6826)

<div class="topic-metadata">

**Author:** [@evanmars](https://discourse.processing.org/u/evanmars)\
**Replies:** 4\
**Last updated:** [December 22, 2018, 4:57pm UTC](https://discourse.processing.org/t/creating-an-array-of-arrays/6826 "2018-12-22T16:57:17Z")

</div>

First time using Processing. Trying to make a temporary graphical interface for my Arduino project. Probably super simple question. How do I go about creating an array of arrays, then accessing the individual subeleme…

---

## [Null type with variables](https://discourse.processing.org/t/null-type-with-variables/6782)

<div class="topic-metadata">

**Author:** [@josephh](https://discourse.processing.org/u/josephh)\
**Replies:** 4\
**Last updated:** [December 21, 2018, 5:26pm UTC](https://discourse.processing.org/t/null-type-with-variables/6782 "2018-12-21T17:26:33Z")

</div>

Hello there, I want to do this : I have a variable : color background\_color; and at the beginning, I don’t want to assign it because it’s an object property. Then if I call a fonction setWindowBackground(color c) on…

---

## [Print blendMode in console, possible?](https://discourse.processing.org/t/print-blendmode-in-console-possible/6617)

<div class="topic-metadata">

**Author:** [@hi.ke](https://discourse.processing.org/u/hi.ke)\
**Replies:** 2\
**Last updated:** [December 16, 2018, 5:43pm UTC](https://discourse.processing.org/t/print-blendmode-in-console-possible/6617 "2018-12-16T17:43:53Z")

</div>

Hi, I was wondering if it is possible to show the current blendMode in the console. Unfortunately I couln’t find anything so far. Thank you :blush:

---

## [Unexpected token void, how to fix?](https://discourse.processing.org/t/unexpected-token-void-how-to-fix/6614)

<div class="topic-metadata">

**Author:** [@Mister\_Loinus](https://discourse.processing.org/u/Mister_Loinus)\
**Replies:** 1\
**Last updated:** [December 14, 2018, 8:46pm UTC](https://discourse.processing.org/t/unexpected-token-void-how-to-fix/6614 "2018-12-14T20:46:09Z")

</div>

Idk why it’s giving me this unexpected error, can anyone help? quite new to programming :)) Thanks! int left,right,up,down; boolean goLeft,goRight,goUp,goDown; int dudeX=1800,dudeY=1000, speed=1; int chestX=1800,chestY…

---

## [Problems running Image](https://discourse.processing.org/t/problems-running-image/6576)

<div class="topic-metadata">

**Author:** [@jonzamarripa](https://discourse.processing.org/u/jonzamarripa)\
**Replies:** 2\
**Last updated:** [December 13, 2018, 10:16pm UTC](https://discourse.processing.org/t/problems-running-image/6576 "2018-12-13T22:16:01Z")

</div>

Hey, guys for some reason I have been getting a blank screen when I run my code. I have saved my sketch and gone to Sketch \> add file \> located picture \> and clicked open. I look and open my sketch and a data file is mad…

---

## [What is the keyword "do"](https://discourse.processing.org/t/what-is-the-keyword-do/6433)

<div class="topic-metadata">

**Author:** [@dragon\_hatcher](https://discourse.processing.org/u/dragon_hatcher)\
**Replies:** 7\
**Last updated:** [December 12, 2018, 11:12pm UTC](https://discourse.processing.org/t/what-is-the-keyword-do/6433 "2018-12-12T23:12:21Z")

</div>

I can see that when I type “do” in processing it is highlighted so it is a keyword however I can’t find any reference to in the manual or online. I was wondering what it does.

---

## [Assign a Value to Every Element in an Array?](https://discourse.processing.org/t/assign-a-value-to-every-element-in-an-array/6381)

<div class="topic-metadata">

**Author:** [@Fixinit1](https://discourse.processing.org/u/Fixinit1)\
**Replies:** 3\
**Last updated:** [December 6, 2018, 7:51pm UTC](https://discourse.processing.org/t/assign-a-value-to-every-element-in-an-array/6381 "2018-12-06T19:51:58Z")

</div>

Can someone tell me how I could assign a value to every element in an array with a single line of code? Is it even possible? Right now i have this, yposi\[0\] = 0; yposi\[1\] = 0; yposi\[2\] = 0; yposi\[3\] = 0; yposi\[4\] = …

---

## [Not Understanding This](https://discourse.processing.org/t/not-understanding-this/5826)

<div class="topic-metadata">

**Author:** [@HoboGreed](https://discourse.processing.org/u/HoboGreed)\
**Replies:** 10\
**Last updated:** [November 23, 2018, 1:24am UTC](https://discourse.processing.org/t/not-understanding-this/5826 "2018-11-23T01:24:15Z")

</div>

Why does set(int(X),int(Y),255); work in Setup but not in draw and yet set(int(X),int(Y),0xffffffff); does work in draw ? float X,Y; void setup(){ size(512,512); background(0); X=256;Y=256; //set(int(X),int(Y),…

---

## [Animating simple motion of line with clean fade not overwriting with background(0)](https://discourse.processing.org/t/animating-simple-motion-of-line-with-clean-fade-not-overwriting-with-background-0/5823)

<div class="topic-metadata">

**Author:** [@gabecolors](https://discourse.processing.org/u/gabecolors)\
**Replies:** 13\
**Last updated:** [November 22, 2018, 4:56pm UTC](https://discourse.processing.org/t/animating-simple-motion-of-line-with-clean-fade-not-overwriting-with-background-0/5823 "2018-11-22T16:56:18Z")

</div>

I am a newbie learning nested loops, for, while, if, else, etc. My intention is to create a series of horizontal white lines that are animated moving downwards. The number and distance should be variables I can later ou…

---

## [mousePressed always true](https://discourse.processing.org/t/mousepressed-always-true/5594)

<div class="topic-metadata">

**Author:** [@FerrariLuigi](https://discourse.processing.org/u/FerrariLuigi)\
**Replies:** 2\
**Last updated:** [November 16, 2018, 9:37pm UTC](https://discourse.processing.org/t/mousepressed-always-true/5594 "2018-11-16T21:37:53Z")

</div>

Dear all I developed a Processing sketch that handle mouse and its buttons. It works but, after a while, the mousePressed attribute becomes always true. Did you have any similar problem ? How did you fix it ? Thank …

---

## [Error with semicolon translate in point](https://discourse.processing.org/t/error-with-semicolon-translate-in-point/5371)

<div class="topic-metadata">

**Author:** [@Paco](https://discourse.processing.org/u/Paco)\
**Replies:** 12\
**Last updated:** [November 9, 2018, 7:40pm UTC](https://discourse.processing.org/t/error-with-semicolon-translate-in-point/5371 "2018-11-09T19:40:17Z")

</div>

Hi everyone, I have a big problem with my Processing, when I tap a semicolon on my mac it appear a point in my code and same problem with double point it appear only a point. I already checked on other software to see i…

---

## [How to type OR on keyboard (mac)](https://discourse.processing.org/t/how-to-type-or-on-keyboard-mac/5369)

<div class="topic-metadata">

**Author:** [@anna\_mei](https://discourse.processing.org/u/anna_mei)\
**Replies:** 8\
**Last updated:** [November 9, 2018, 9:29am UTC](https://discourse.processing.org/t/how-to-type-or-on-keyboard-mac/5369 "2018-11-09T09:29:04Z")

</div>

Dear community, I am trying to find the keyboard “shortcut” for this sign (which I now copied from the references page): || It is the sign for “OR”. I am currently using a Mac (High Sierra 10.13.4) with a german keybo…

---

## [Draw image from particular corner](https://discourse.processing.org/t/draw-image-from-particular-corner/5322)

<div class="topic-metadata">

**Author:** [@KeirMeDear](https://discourse.processing.org/u/KeirMeDear)\
**Replies:** 5\
**Last updated:** [November 7, 2018, 4:10pm UTC](https://discourse.processing.org/t/draw-image-from-particular-corner/5322 "2018-11-07T16:10:19Z")

</div>

So I’m aware you can position images in processing using different image modes. I was wondering how using imageMode(CORNERS) I would be able to position images from the bottom left corner. So if the image was drawn this …

---

## [File syntax for subdirectory](https://discourse.processing.org/t/file-syntax-for-subdirectory/5200)

<div class="topic-metadata">

**Author:** [@jeffmarc](https://discourse.processing.org/u/jeffmarc)\
**Replies:** 2\
**Last updated:** [November 5, 2018, 2:15am UTC](https://discourse.processing.org/t/file-syntax-for-subdirectory/5200 "2018-11-05T02:15:41Z")

</div>

I use creatWriter to output to a file. it works for the first level dircetory example: createWriter("c:/main "+string); so i created a c:/main/reports but when i try to output to that sub directory it just writes it …

---

## [How to save Level Progress?](https://discourse.processing.org/t/how-to-save-level-progress/5156)

<div class="topic-metadata">

**Author:** [@Schred](https://discourse.processing.org/u/Schred)\
**Replies:** 13\
**Last updated:** [November 3, 2018, 4:34pm UTC](https://discourse.processing.org/t/how-to-save-level-progress/5156 "2018-11-03T16:34:39Z")

</div>

So I’m trying to make a small adventure mode for my game, and I need to be able to store the information when a level is completed. I am trying to use a PrintWriter, and it actually prints the right result into a text fi…

---

## [Difference between i/10\*10 and i?](https://discourse.processing.org/t/difference-between-i-10-10-and-i/5149)

<div class="topic-metadata">

**Author:** [@Lexyth](https://discourse.processing.org/u/Lexyth)\
**Replies:** 4\
**Last updated:** [November 3, 2018, 7:49am UTC](https://discourse.processing.org/t/difference-between-i-10-10-and-i/5149 "2018-11-03T07:49:37Z")

</div>

These are two codes, that should have the exact same result, but don’t… why? for (int i = 0; i \< vectors.length; i++) { vectors\[i\] = new PVector(i%10\*10 + 50, i/10\*10); } for (int i = 0; i \< vectors.length; i++)…

---

## [TrueType loadFont](https://discourse.processing.org/t/truetype-loadfont/5127)

<div class="topic-metadata">

**Author:** [@FerrariLuigi](https://discourse.processing.org/u/FerrariLuigi)\
**Replies:** 3\
**Last updated:** [November 2, 2018, 9:25pm UTC](https://discourse.processing.org/t/truetype-loadfont/5127 "2018-11-02T21:25:40Z")

</div>

Dear all, according the example ( https://processing.org/reference/textFont\_.html ) on the reference manual I wrote the following sketch: PFont font32; void setup() { font32 = loadFont("steelfish rg.ttf"); size…

---

## [Dimension of the display window](https://discourse.processing.org/t/dimension-of-the-display-window/5063)

<div class="topic-metadata">

**Author:** [@ACT](https://discourse.processing.org/u/ACT)\
**Replies:** 4\
**Last updated:** [November 1, 2018, 1:28am UTC](https://discourse.processing.org/t/dimension-of-the-display-window/5063 "2018-11-01T01:28:18Z")

</div>

What are the sizes of the window display?

---

## [Random variable](https://discourse.processing.org/t/random-variable/4797)

<div class="topic-metadata">

**Author:** [@Lore](https://discourse.processing.org/u/Lore)\
**Replies:** 6\
**Last updated:** [October 30, 2018, 12:17am UTC](https://discourse.processing.org/t/random-variable/4797 "2018-10-30T00:17:17Z")

</div>

Would this produce a 1/10 chance that action A is played? float ran = random(10); if (ran == 2) { //action A } else if (ran != 2) { //action B }

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

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