# Processing

**URL:** https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=167

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

**Page:** 168

---

## [How do i add colour to each one of the 10 boxes i made](https://discourse.processing.org/t/how-do-i-add-colour-to-each-one-of-the-10-boxes-i-made/25739)

<div class="topic-metadata">

**Author:** [@DijaAngel](https://discourse.processing.org/u/DijaAngel)\
**Replies:** 3\
**Last updated:** [November 27, 2020, 2:25pm UTC](https://discourse.processing.org/t/how-do-i-add-colour-to-each-one-of-the-10-boxes-i-made/25739 "2020-11-27T14:25:27Z")

</div>

please format code with \</\> button \* homework policy \* asking questions void setup(){ size(500,500); } void draw(){ for(int i=0;i\<=450;i+=50){ rect(0,i,50,50); } }

---

## [Connecting Supercollider to Processing via QjackCtl](https://discourse.processing.org/t/connecting-supercollider-to-processing-via-qjackctl/25753)

<div class="topic-metadata">

**Author:** [@guillaumeazer](https://discourse.processing.org/u/guillaumeazer)\
**Replies:** 1\
**Last updated:** [November 27, 2020, 12:08pm UTC](https://discourse.processing.org/t/connecting-supercollider-to-processing-via-qjackctl/25753 "2020-11-27T12:08:09Z")

</div>

Hey everyone, I’m new to processing and I have a question for you. I added the processing.sound library because I want to create a real time spectrogram. My plan is to connect supercollider to processing via QjackCtl…

---

## [I have a rectangle that will bounce but i want it to change colour whenever it hits a side](https://discourse.processing.org/t/i-have-a-rectangle-that-will-bounce-but-i-want-it-to-change-colour-whenever-it-hits-a-side/25745)

<div class="topic-metadata">

**Author:** [@0w3n928](https://discourse.processing.org/u/0w3n928)\
**Replies:** 2\
**Last updated:** [November 27, 2020, 6:45am UTC](https://discourse.processing.org/t/i-have-a-rectangle-that-will-bounce-but-i-want-it-to-change-colour-whenever-it-hits-a-side/25745 "2020-11-27T06:45:31Z")

</div>

I cant seem to make this work but it changes colour but breaks the thing float rectx,recty,xspeed=7,yspeed=7; color bg = color(random(255),random(255),random(255)); void setup() { fullScreen(); } void draw() { bac…

---

## [I want to make a rectangle that will spawn when mouseclicked and bounce back and collide with another rectangle](https://discourse.processing.org/t/i-want-to-make-a-rectangle-that-will-spawn-when-mouseclicked-and-bounce-back-and-collide-with-another-rectangle/25743)

<div class="topic-metadata">

**Author:** [@0w3n928](https://discourse.processing.org/u/0w3n928)\
**Replies:** 0\
**Last updated:** [November 27, 2020, 1:02am UTC](https://discourse.processing.org/t/i-want-to-make-a-rectangle-that-will-spawn-when-mouseclicked-and-bounce-back-and-collide-with-another-rectangle/25743 "2020-11-27T01:02:43Z")

</div>

I’m trying to make another rectangle spawn when mouse is clicked once and it will collide to my first bouncing rectangle and I can add however many i want but my code doesn’t even need me to click and it doesn’t really w…

---

## [A game where there are circles and you press on them and they dissapear in processing](https://discourse.processing.org/t/a-game-where-there-are-circles-and-you-press-on-them-and-they-dissapear-in-processing/25729)

<div class="topic-metadata">

**Author:** [@JakeTheFake](https://discourse.processing.org/u/JakeTheFake)\
**Replies:** 6\
**Last updated:** [November 26, 2020, 7:11pm UTC](https://discourse.processing.org/t/a-game-where-there-are-circles-and-you-press-on-them-and-they-dissapear-in-processing/25729 "2020-11-26T19:11:38Z")

</div>

I need help, could someone give me code for processing not j5.js for a game that has circles where you press on them and they dissapear please. I really need an example asap and it would be amazing if you could give me o…

---

## [Wrapping classes - overlapping method](https://discourse.processing.org/t/wrapping-classes-overlapping-method/25733)

<div class="topic-metadata">

**Author:** [@Ellie98](https://discourse.processing.org/u/Ellie98)\
**Replies:** 1\
**Last updated:** [November 26, 2020, 6:21pm UTC](https://discourse.processing.org/t/wrapping-classes-overlapping-method/25733 "2020-11-26T18:21:29Z")

</div>

Hello, i’m stuck with my assignment. I’m not getting the result. I’m getting “Infinity” instead and the point numbers are turning in whole numbers. But I used float though. Am I doing the overlapping wrongly? Thanks in…

---

## [Making a Loto game (Lotto, Bingo)](https://discourse.processing.org/t/making-a-loto-game-lotto-bingo/25706)

<div class="topic-metadata">

**Author:** [@Marius](https://discourse.processing.org/u/Marius)\
**Replies:** 2\
**Last updated:** [November 25, 2020, 11:16pm UTC](https://discourse.processing.org/t/making-a-loto-game-lotto-bingo/25706 "2020-11-25T23:16:25Z")

</div>

Hello, I need for a school project to do a loto application in andoid. It is possible to do something like in the pictures below in processing ? Can anyone help me with some examples/ideas please ? Thank you.

---

## [Beginning (3D) superprogrammer (57 years)](https://discourse.processing.org/t/beginning-3d-superprogrammer-57-years/24565)

<div class="topic-metadata">

**Author:** [@flounder](https://discourse.processing.org/u/flounder)\
**Replies:** 2\
**Last updated:** [November 26, 2020, 11:34am UTC](https://discourse.processing.org/t/beginning-3d-superprogrammer-57-years/24565 "2020-11-26T11:34:30Z")

</div>

I have been a programmer for 57 years. Therefore, I find the introductory tutorials uninteresting. I have a very focused set of questions. I need to draw lines in 3D space. Just lines. No extrusions. Practically …

---

## [Drawing a second instance of a ball class in a game](https://discourse.processing.org/t/drawing-a-second-instance-of-a-ball-class-in-a-game/25713)

<div class="topic-metadata">

**Author:** [@Manoplo](https://discourse.processing.org/u/Manoplo)\
**Replies:** 8\
**Last updated:** [November 26, 2020, 11:27am UTC](https://discourse.processing.org/t/drawing-a-second-instance-of-a-ball-class-in-a-game/25713 "2020-11-26T11:27:52Z")

</div>

Hello everyone! Pretty new into processing and into programming as well! So first of all, I´d like to apologize if the format is wrong or if my doubt has been solved before (I´ve been trying to find a solution for two d…

---

## [Acerca de la licencia comercial de processing java](https://discourse.processing.org/t/acerca-de-la-licencia-comercial-de-processing-java/25711)

<div class="topic-metadata">

**Author:** [@datacolor](https://discourse.processing.org/u/datacolor)\
**Replies:** 3\
**Last updated:** [November 26, 2020, 2:14am UTC](https://discourse.processing.org/t/acerca-de-la-licencia-comercial-de-processing-java/25711 "2020-11-26T02:14:21Z")

</div>

Hola alguien puede explicarme lo siguiente,si yo hago un sketch que no usa ninguna libreria (excepto las del core de processing unicamente!),y hago una aplicacion exportando el sketch a aplicacion.exe…es posible comercia…

---

## [Modbus RTU Library for Processing](https://discourse.processing.org/t/modbus-rtu-library-for-processing/25704)

<div class="topic-metadata">

**Author:** [@Samsanit](https://discourse.processing.org/u/Samsanit)\
**Replies:** 2\
**Last updated:** [November 26, 2020, 1:19am UTC](https://discourse.processing.org/t/modbus-rtu-library-for-processing/25704 "2020-11-26T01:19:40Z")

</div>

Hi All, Is there a library out there that can be used for sending serial modbus communications that hooks to processing? I have a pump which uses Modbus RTU in order to control the pump, as well as receive information …

---

## [Lambert conformal conic projection map coordinates](https://discourse.processing.org/t/lambert-conformal-conic-projection-map-coordinates/25665)

<div class="topic-metadata">

**Author:** [@CAVUCO](https://discourse.processing.org/u/CAVUCO)\
**Replies:** 4\
**Last updated:** [November 26, 2020, 12:32am UTC](https://discourse.processing.org/t/lambert-conformal-conic-projection-map-coordinates/25665 "2020-11-26T00:32:36Z")

</div>

I have a database of locations by lat/long. Trying to overlay on a background image that is a map using the Lambert conformal conic projection. I have the following specs on the map Map\_Projection: Map\_Projection\_Nam…

---

## [Help to make a radio button class](https://discourse.processing.org/t/help-to-make-a-radio-button-class/25716)

<div class="topic-metadata">

**Author:** [@datacolor](https://discourse.processing.org/u/datacolor)\
**Replies:** 3\
**Last updated:** [November 25, 2020, 11:38pm UTC](https://discourse.processing.org/t/help-to-make-a-radio-button-class/25716 "2020-11-25T23:38:09Z")

</div>

I found the code for a button class and I managed to make a sketch that makes a check button, but now I need help to make a sketch of several option or radio buttons using this button class, since the controlP5 library i…

---

## [Why can't we pass PVector to translate?](https://discourse.processing.org/t/why-cant-we-pass-pvector-to-translate/7888)

<div class="topic-metadata">

**Author:** [@Geeky](https://discourse.processing.org/u/Geeky)\
**Replies:** 6\
**Last updated:** [November 25, 2020, 11:07pm UTC](https://discourse.processing.org/t/why-cant-we-pass-pvector-to-translate/7888 "2020-11-25T23:07:15Z")

</div>

I’ve just started using P3D and while translating a cube I wonder that why can’t we pass a variable of type PVector to translate method. I think that functionality wise it should work. Correct me if I am wrong.

---

## [Solar system with multiple planets](https://discourse.processing.org/t/solar-system-with-multiple-planets/25671)

<div class="topic-metadata">

**Author:** [@N\_G](https://discourse.processing.org/u/N_G)\
**Replies:** 2\
**Last updated:** [November 25, 2020, 8:21pm UTC](https://discourse.processing.org/t/solar-system-with-multiple-planets/25671 "2020-11-25T20:21:33Z")

</div>

Hi, I’m just starting out with processing and I’m trying to build a little solar system. My problem is that I don’t know how to add another planet (like mars or venus). Because if I just ad the planet to my code it wil…

---

## [Need help making background transparent](https://discourse.processing.org/t/need-help-making-background-transparent/25700)

<div class="topic-metadata">

**Author:** [@Sijht](https://discourse.processing.org/u/Sijht)\
**Replies:** 2\
**Last updated:** [November 25, 2020, 4:51pm UTC](https://discourse.processing.org/t/need-help-making-background-transparent/25700 "2020-11-25T16:51:49Z")

</div>

I tried a lot of methods i saw, but none of them seem to work. I am trying to take an image, save it and when I paste it into my canvas turn the white pixels into transparent. here is some code that I have written so f…

---

## ["For" loop not stopping when I want](https://discourse.processing.org/t/for-loop-not-stopping-when-i-want/25701)

<div class="topic-metadata">

**Author:** [@Spomch](https://discourse.processing.org/u/Spomch)\
**Replies:** 1\
**Last updated:** [November 25, 2020, 4:26pm UTC](https://discourse.processing.org/t/for-loop-not-stopping-when-i-want/25701 "2020-11-25T16:26:13Z")

</div>

Hi everyone, I’m posting here because I’m facing a problem with a “for” loop. Here is the code that I am working on : import processing.sound.\*; SoundFile Son; PImage portrait; PImage portrait\_deux; PImage telephone; …

---

## [How does the red() function work](https://discourse.processing.org/t/how-does-the-red-function-work/25687)

<div class="topic-metadata">

**Author:** [@PyroDeathAdder](https://discourse.processing.org/u/PyroDeathAdder)\
**Replies:** 2\
**Last updated:** [November 25, 2020, 2:05pm UTC](https://discourse.processing.org/t/how-does-the-red-function-work/25687 "2020-11-25T14:05:05Z")

</div>

i was just wondering what processing does so it can do red(colorObject) and return the red value of that color

---

## [Colour Change Of Ellipse](https://discourse.processing.org/t/colour-change-of-ellipse/25697)

<div class="topic-metadata">

**Author:** [@Tyler](https://discourse.processing.org/u/Tyler)\
**Replies:** 1\
**Last updated:** [November 25, 2020, 1:11pm UTC](https://discourse.processing.org/t/colour-change-of-ellipse/25697 "2020-11-25T13:11:01Z")

</div>

I’ve been trying to make a code where if I press a specific box it will change the colour of the pen (that I’m using ellipse to make). I was able to make it change to red when I press a certain box but I can’t make it do…

---

## [Closest point on SVG path](https://discourse.processing.org/t/closest-point-on-svg-path/25592)

<div class="topic-metadata">

**Author:** [@sixfeet](https://discourse.processing.org/u/sixfeet)\
**Replies:** 16\
**Last updated:** [November 25, 2020, 8:36am UTC](https://discourse.processing.org/t/closest-point-on-svg-path/25592 "2020-11-25T08:36:11Z")

</div>

Instead of looking for the closest point to the mouse from all the points of the svg, how do I limit to finding just the closest point on a specific path? For example If I keyPressed 3, it would just look for the closes…

---

## [Turning audio into a pattern](https://discourse.processing.org/t/turning-audio-into-a-pattern/25694)

<div class="topic-metadata">

**Author:** [@scooijmans](https://discourse.processing.org/u/scooijmans)\
**Replies:** 1\
**Last updated:** [November 25, 2020, 11:34am UTC](https://discourse.processing.org/t/turning-audio-into-a-pattern/25694 "2020-11-25T11:34:33Z")

</div>

Hi, I’m a beginner in programming and got this code, it draws a line of the audio input as time goes by. Is it possible that when the line is formed till the end of the screen it stays still and then starts again underne…

---

## [Counter that increases with mouse click](https://discourse.processing.org/t/counter-that-increases-with-mouse-click/25342)

<div class="topic-metadata">

**Author:** [@thedarklord](https://discourse.processing.org/u/thedarklord)\
**Replies:** 9\
**Last updated:** [November 25, 2020, 10:41am UTC](https://discourse.processing.org/t/counter-that-increases-with-mouse-click/25342 "2020-11-25T10:41:53Z")

</div>

I’m making a simple game in which I want a counter which invreases every time an object is clicked.

---

## [URGENT: How to repeat an image movement per second](https://discourse.processing.org/t/urgent-how-to-repeat-an-image-movement-per-second/25683)

<div class="topic-metadata">

**Author:** [@tank](https://discourse.processing.org/u/tank)\
**Replies:** 16\
**Last updated:** [November 25, 2020, 10:24am UTC](https://discourse.processing.org/t/urgent-how-to-repeat-an-image-movement-per-second/25683 "2020-11-25T10:24:00Z")

</div>

I would like drop either 2 imageA or 1 imageB from the y = 0 border / upper border by using a coin to decide which to fall. I am using Processing 2.2.1. if (millis() - startTime \>= 1000) { float coin = random(1, 100…

---

## [ArrayList - having different images when moving using arrow keys](https://discourse.processing.org/t/arraylist-having-different-images-when-moving-using-arrow-keys/25669)

<div class="topic-metadata">

**Author:** [@TheGullible1](https://discourse.processing.org/u/TheGullible1)\
**Replies:** 15\
**Last updated:** [November 24, 2020, 8:59pm UTC](https://discourse.processing.org/t/arraylist-having-different-images-when-moving-using-arrow-keys/25669 "2020-11-24T20:59:47Z")

</div>

Hi, I’m using ArrayList to store the multiple amounts of images I have. i want to do is if I move left by using arrow keys, the images that pointing towards left move etc. this goes for up, down and right as well. code …

---

## [2D, Changing sprite set based on direction of movement](https://discourse.processing.org/t/2d-changing-sprite-set-based-on-direction-of-movement/25672)

<div class="topic-metadata">

**Author:** [@Myth](https://discourse.processing.org/u/Myth)\
**Replies:** 3\
**Last updated:** [November 24, 2020, 8:28pm UTC](https://discourse.processing.org/t/2d-changing-sprite-set-based-on-direction-of-movement/25672 "2020-11-24T20:28:19Z")

</div>

Hello everybody. I’m trying to make a simple “game” if it could even be called that, in which i have a character moving in the 4 main directions (up/down/left/right) with the WASD keys, using the following code void mo…

---

## [Remove the first character from a string when keyPressed is equal to the character](https://discourse.processing.org/t/remove-the-first-character-from-a-string-when-keypressed-is-equal-to-the-character/25598)

<div class="topic-metadata">

**Author:** [@vestergaard12](https://discourse.processing.org/u/vestergaard12)\
**Replies:** 3\
**Last updated:** [November 24, 2020, 6:31pm UTC](https://discourse.processing.org/t/remove-the-first-character-from-a-string-when-keypressed-is-equal-to-the-character/25598 "2020-11-24T18:31:56Z")

</div>

Hello processing foundation. I want to remove the first character from a string when the key pressed is equal to the first character. For example if the string word is “hello”, when I want the “h” in the word to be remo…

---

## [Remove Trail, can't figure out how (bot follows a random walker)](https://discourse.processing.org/t/remove-trail-cant-figure-out-how-bot-follows-a-random-walker/25616)

<div class="topic-metadata">

**Author:** [@noobcoder](https://discourse.processing.org/u/noobcoder)\
**Replies:** 6\
**Last updated:** [November 24, 2020, 3:42pm UTC](https://discourse.processing.org/t/remove-trail-cant-figure-out-how-bot-follows-a-random-walker/25616 "2020-11-24T15:42:27Z")

</div>

Hello, I have two random walkers. One of them(AntC) leaves a trail and the other one(AntD) is suppose to pick it up. How can i do this. AntC \[\] armyC = new AntC\[1\]; AntD \[\] armyD = new AntD\[1\]; void setup() { size(90…

---

## [Sound cuts off, then plays again](https://discourse.processing.org/t/sound-cuts-off-then-plays-again/25641)

<div class="topic-metadata">

**Author:** [@AlexW](https://discourse.processing.org/u/AlexW)\
**Replies:** 1\
**Last updated:** [November 23, 2020, 8:59pm UTC](https://discourse.processing.org/t/sound-cuts-off-then-plays-again/25641 "2020-11-23T20:59:34Z")

</div>

Hello, I’ve just about got my project for a class finished. Unfortunately I’ve run into a problem with sound. When I press a button to start the thing, it plays the start of calmsound, then stops completely. When I pre…

---

## [Blending two PGraphics - how would this work? - what is the syntax?](https://discourse.processing.org/t/blending-two-pgraphics-how-would-this-work-what-is-the-syntax/25630)

<div class="topic-metadata">

**Author:** [@MuddyGardener](https://discourse.processing.org/u/MuddyGardener)\
**Replies:** 6\
**Last updated:** [November 24, 2020, 12:16pm UTC](https://discourse.processing.org/t/blending-two-pgraphics-how-would-this-work-what-is-the-syntax/25630 "2020-11-24T12:16:00Z")

</div>

The Processing reference for blend suggests there is flexibility of specifying the destination image as well as the source image. \> Blends a region of pixels from one image into another (or in itself again) with full al…

---

## [Create automatic pdf at certain point](https://discourse.processing.org/t/create-automatic-pdf-at-certain-point/25602)

<div class="topic-metadata">

**Author:** [@scooijmans](https://discourse.processing.org/u/scooijmans)\
**Replies:** 3\
**Last updated:** [November 24, 2020, 12:13pm UTC](https://discourse.processing.org/t/create-automatic-pdf-at-certain-point/25602 "2020-11-24T12:13:43Z")

</div>

Hi, I’m a beginner in programming and got this code, it draws a line of the audio input as time goes by. What I need is when the line hits the end of the screen it needs to take an automatic screenshot/pdf of this is aro…

[Previous page](https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=166)

[Next page](https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=168)
