# Processing

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

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

**Page:** 123

---

## [A little help is needed !?](https://discourse.processing.org/t/a-little-help-is-needed/31268)

<div class="topic-metadata">

**Author:** [@Peace](https://discourse.processing.org/u/Peace)\
**Replies:** 1\
**Last updated:** [July 15, 2021, 2:01pm UTC](https://discourse.processing.org/t/a-little-help-is-needed/31268 "2021-07-15T14:01:28Z")

</div>

Can anybody pls educate me how did the writer measure the following two rect () to produce (1,2, 4,3) ( I understood only 1,2 touching the coordinate 1 (x), 2 (y) part ). Rect () (3,2,4,2). I understood only (3,2) coord…

---

## [How can I stretch individual letters?](https://discourse.processing.org/t/how-can-i-stretch-individual-letters/31239)

<div class="topic-metadata">

**Author:** [@tommyba](https://discourse.processing.org/u/tommyba)\
**Replies:** 1\
**Last updated:** [July 15, 2021, 8:40am UTC](https://discourse.processing.org/t/how-can-i-stretch-individual-letters/31239 "2021-07-15T08:40:53Z")

</div>

i have this code and i want to, for example, stretch the A to the right and and the rest of the letters get really little like they are being pushed, or stretch the C to both left and right and push the A B to the left a…

---

## [Hi Guys! I just need help figuring out how to change the color of the bouncing ball every time the player circle collides with it](https://discourse.processing.org/t/hi-guys-i-just-need-help-figuring-out-how-to-change-the-color-of-the-bouncing-ball-every-time-the-player-circle-collides-with-it/31250)

<div class="topic-metadata">

**Author:** [@bopStu77](https://discourse.processing.org/u/bopStu77)\
**Replies:** 4\
**Last updated:** [July 14, 2021, 3:41pm UTC](https://discourse.processing.org/t/hi-guys-i-just-need-help-figuring-out-how-to-change-the-color-of-the-bouncing-ball-every-time-the-player-circle-collides-with-it/31250 "2021-07-14T15:41:26Z")

</div>

This is the code I was given to start with; int rad = 60; // Width of the shape float xpos, ypos; // Starting position of shape float xspeed = 2.8; // Speed of the shape float yspeed = 2.2; // Speed of th…

---

## [Not sure why my array is not allowed to use a function (OOP)](https://discourse.processing.org/t/not-sure-why-my-array-is-not-allowed-to-use-a-function-oop/31232)

<div class="topic-metadata">

**Author:** [@LuckyDots](https://discourse.processing.org/u/LuckyDots)\
**Replies:** 21\
**Last updated:** [July 14, 2021, 12:13pm UTC](https://discourse.processing.org/t/not-sure-why-my-array-is-not-allowed-to-use-a-function-oop/31232 "2021-07-14T12:13:35Z")

</div>

hello again, my problem is as follows. I am have tried and somewhat suceeded in creating a function which creates a fade from black to white after a random amount of time and then resets itself. i am trying to fill the…

---

## [Serial.write() blocks receive when written inside draw() function](https://discourse.processing.org/t/serial-write-blocks-receive-when-written-inside-draw-function/31203)

<div class="topic-metadata">

**Author:** [@mohitSingh](https://discourse.processing.org/u/mohitSingh)\
**Replies:** 2\
**Last updated:** [July 14, 2021, 11:02am UTC](https://discourse.processing.org/t/serial-write-blocks-receive-when-written-inside-draw-function/31203 "2021-07-14T11:02:22Z")

</div>

import processing.serial.\*; //\<\>// //\<\>// //import static javax.swing.JOptionPane.\*; import controlP5.\*; import java.util.\*; import javax.swing.JOptionPane; Serial myPort; // The serial port which will be opene…

---

## [Creating a shield for an enemy class](https://discourse.processing.org/t/creating-a-shield-for-an-enemy-class/31242)

<div class="topic-metadata">

**Author:** [@Gyrosis](https://discourse.processing.org/u/Gyrosis)\
**Replies:** 1\
**Last updated:** [July 14, 2021, 7:08am UTC](https://discourse.processing.org/t/creating-a-shield-for-an-enemy-class/31242 "2021-07-14T07:08:24Z")

</div>

So say if I want to create a shield so that you would have to take down the shield before killing the enemy. How would I code that?

---

## [Tips for Sharing My Work on Different Machines](https://discourse.processing.org/t/tips-for-sharing-my-work-on-different-machines/31241)

<div class="topic-metadata">

**Author:** [@dtools22](https://discourse.processing.org/u/dtools22)\
**Replies:** 2\
**Last updated:** [July 13, 2021, 10:09pm UTC](https://discourse.processing.org/t/tips-for-sharing-my-work-on-different-machines/31241 "2021-07-13T22:09:50Z")

</div>

Hello Everyone, I have been working on a project for the past several months and I am ready to show this version of it beyond just immediate friends and family. I don’t need coding help, I’m looking for people to actua…

---

## [Check if variable is a prime](https://discourse.processing.org/t/check-if-variable-is-a-prime/31216)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 24\
**Last updated:** [July 13, 2021, 7:47pm UTC](https://discourse.processing.org/t/check-if-variable-is-a-prime/31216 "2021-07-13T19:47:01Z")

</div>

how to check if x is a prime?

---

## [Allow User to Resize the Window](https://discourse.processing.org/t/allow-user-to-resize-the-window/31212)

<div class="topic-metadata">

**Author:** [@dtools22](https://discourse.processing.org/u/dtools22)\
**Replies:** 2\
**Last updated:** [July 13, 2021, 5:41pm UTC](https://discourse.processing.org/t/allow-user-to-resize-the-window/31212 "2021-07-13T17:41:17Z")

</div>

Hello All, I’m creating a program and I would like the user to be able to resize the screen at their convenience. I understand the basics of how to do this with objects and their positioning on the screen but I’m a litt…

---

## [A quick question about the 1st chapter of Processing](https://discourse.processing.org/t/a-quick-question-about-the-1st-chapter-of-processing/31230)

<div class="topic-metadata">

**Author:** [@Peace](https://discourse.processing.org/u/Peace)\
**Replies:** 5\
**Last updated:** [July 13, 2021, 2:49pm UTC](https://discourse.processing.org/t/a-quick-question-about-the-1st-chapter-of-processing/31230 "2021-07-13T14:49:01Z")

</div>

Can anybody also please help me with my following query ? In the page 6 of the Processing textbook, a line has been drawn ( as can be seen in the attached picture Figure 1-6) on a graph paper and I can’t understand how t…

---

## [I am beginner of Processing software and need help! (mouse example issue)](https://discourse.processing.org/t/i-am-beginner-of-processing-software-and-need-help-mouse-example-issue/31228)

<div class="topic-metadata">

**Author:** [@Peace](https://discourse.processing.org/u/Peace)\
**Replies:** 3\
**Last updated:** [July 13, 2021, 10:35am UTC](https://discourse.processing.org/t/i-am-beginner-of-processing-software-and-need-help-mouse-example-issue/31228 "2021-07-13T10:35:43Z")

</div>

Hi there, I have installed a software from Processing.org and it is responding the way as described in the text book. After installing the software, click on the File button, then Examples then Drawing then double click …

---

## [Where can I find thousands of sudokus of varying difficulty?](https://discourse.processing.org/t/where-can-i-find-thousands-of-sudokus-of-varying-difficulty/31229)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 0\
**Last updated:** [July 13, 2021, 10:41am UTC](https://discourse.processing.org/t/where-can-i-find-thousands-of-sudokus-of-varying-difficulty/31229 "2021-07-13T10:41:43Z")

</div>

Hi! I recently made a sudoku program. I need as many sudoku templates as possible (unsolved, no need for solution). It would be preferable for it to be written in a .txt file with a clear and simple format. Do any of you…

---

## [X and y don't even out](https://discourse.processing.org/t/x-and-y-dont-even-out/31214)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 3\
**Last updated:** [July 12, 2021, 8:32pm UTC](https://discourse.processing.org/t/x-and-y-dont-even-out/31214 "2021-07-12T20:32:32Z")

</div>

i wrote a code that should, generate a random x, from 1-10 and then make a y the number that it needs to complete 10. it then should try to devide it by something it can be devided by. then it shows a visual for me to s…

---

## [How to read multiple sensors in Processing using Arduino I2C](https://discourse.processing.org/t/how-to-read-multiple-sensors-in-processing-using-arduino-i2c/30799)

<div class="topic-metadata">

**Author:** [@Halfrican911](https://discourse.processing.org/u/Halfrican911)\
**Replies:** 27\
**Last updated:** [July 12, 2021, 6:05pm UTC](https://discourse.processing.org/t/how-to-read-multiple-sensors-in-processing-using-arduino-i2c/30799 "2021-07-12T18:05:26Z")

</div>

hello everyone ive got 2 angle sensors that read accel gyro and mag o have all the code work done on arduino and i have both sensors working and feeding data to the serial monitor so i want to get 2 seperate tracking blo…

---

## [How to use auto complete?](https://discourse.processing.org/t/how-to-use-auto-complete/31169)

<div class="topic-metadata">

**Author:** [@Hapiel](https://discourse.processing.org/u/Hapiel)\
**Replies:** 6\
**Last updated:** [July 12, 2021, 10:27am UTC](https://discourse.processing.org/t/how-to-use-auto-complete/31169 "2021-07-12T10:27:25Z")

</div>

Hi, I’ve never been able to use auto complete in processing. I had this issue with 3.5.4 and just now I tried 4.0a6 and still can’t get it working. I have autocomplete enabled in preferences, but whatever I type, it ne…

---

## [How can i animate the D so instead of having the D stretched i see how it stretches? (this is the code i have)](https://discourse.processing.org/t/how-can-i-animate-the-d-so-instead-of-having-the-d-stretched-i-see-how-it-stretches-this-is-the-code-i-have/31186)

<div class="topic-metadata">

**Author:** [@tommyba](https://discourse.processing.org/u/tommyba)\
**Replies:** 1\
**Last updated:** [July 12, 2021, 8:16am UTC](https://discourse.processing.org/t/how-can-i-animate-the-d-so-instead-of-having-the-d-stretched-i-see-how-it-stretches-this-is-the-code-i-have/31186 "2021-07-12T08:16:33Z")

</div>

PFont myFont; void setup() { size(1200, 1200); // Uncomment the following two lines to see the available fonts //String\[\] fontList = PFont.list(); //printArray(fontList); myFont = createFont(".SFNS-Bold", 125); fr…

---

## [How do i add characters in a string, i have 11 digits in my string and i am supposed to add the odd number positions](https://discourse.processing.org/t/how-do-i-add-characters-in-a-string-i-have-11-digits-in-my-string-and-i-am-supposed-to-add-the-odd-number-positions/31174)

<div class="topic-metadata">

**Author:** [@Tay](https://discourse.processing.org/u/Tay)\
**Replies:** 10\
**Last updated:** [July 12, 2021, 4:00am UTC](https://discourse.processing.org/t/how-do-i-add-characters-in-a-string-i-have-11-digits-in-my-string-and-i-am-supposed-to-add-the-odd-number-positions/31174 "2021-07-12T04:00:14Z")

</div>

please format code with \</\> button \* homework policy \* asking questions How do i add characters in a string, i have 11 digits in my string and i am supposed to add the odd number positions

---

## [Help with for(SOLVED)](https://discourse.processing.org/t/help-with-for-solved/31184)

<div class="topic-metadata">

**Author:** [@ultimakey](https://discourse.processing.org/u/ultimakey)\
**Replies:** 5\
**Last updated:** [July 11, 2021, 10:54pm UTC](https://discourse.processing.org/t/help-with-for-solved/31184 "2021-07-11T22:54:06Z")

</div>

thank you TfGuy44 for helping me out!! (SOLVED)

---

## [How to say: if the result is zero then the digit is zero otherwise it is 600](https://discourse.processing.org/t/how-to-say-if-the-result-is-zero-then-the-digit-is-zero-otherwise-it-is-600/31180)

<div class="topic-metadata">

**Author:** [@Tay](https://discourse.processing.org/u/Tay)\
**Replies:** 4\
**Last updated:** [July 11, 2021, 8:53pm UTC](https://discourse.processing.org/t/how-to-say-if-the-result-is-zero-then-the-digit-is-zero-otherwise-it-is-600/31180 "2021-07-11T20:53:38Z")

</div>

I am trying to use the if function to say if the result is zero then the digit is equals to zero otherwise it is 600 but its giving me a boolean error no matter what I try. This is my code so far int result= mult%10;…

---

## [Drawing chains using loops](https://discourse.processing.org/t/drawing-chains-using-loops/31182)

<div class="topic-metadata">

**Author:** [@matto](https://discourse.processing.org/u/matto)\
**Replies:** 3\
**Last updated:** [July 11, 2021, 8:43pm UTC](https://discourse.processing.org/t/drawing-chains-using-loops/31182 "2021-07-11T20:43:52Z")

</div>

Am working on a code using loops, basically what I want to do is draw a chain of circles that stretches from the center of the screen to the mouse position. but I can’t make the chain follow the mouse this is my code so…

---

## [loadStrings function not as reference?](https://discourse.processing.org/t/loadstrings-function-not-as-reference/31149)

<div class="topic-metadata">

**Author:** [@RichardDL](https://discourse.processing.org/u/RichardDL)\
**Replies:** 6\
**Last updated:** [July 11, 2021, 1:54pm UTC](https://discourse.processing.org/t/loadstrings-function-not-as-reference/31149 "2021-07-11T13:54:05Z")

</div>

I’ve just tried the first example on the \[loadStrings reference\](file:///C:/Programs/Processing/modes/java/reference/loadStrings\_.html) page. It works perfectly loading list.txt from the sketch’s folder, but not from th…

---

## [Spin rectangles in place](https://discourse.processing.org/t/spin-rectangles-in-place/31145)

<div class="topic-metadata">

**Author:** [@seldomcoder](https://discourse.processing.org/u/seldomcoder)\
**Replies:** 5\
**Last updated:** [July 10, 2021, 7:46pm UTC](https://discourse.processing.org/t/spin-rectangles-in-place/31145 "2021-07-10T19:46:50Z")

</div>

I have created a spiral of rectangles. Now, I want those rectangles to spin in their respective places. How do I go about it? I have attached the code here: \< // import the library import com.hamoid.\*; // create a new…

---

## [Rotating 3D-objects in PGraphics for hires output](https://discourse.processing.org/t/rotating-3d-objects-in-pgraphics-for-hires-output/31155)

<div class="topic-metadata">

**Author:** [@ArjanBytez](https://discourse.processing.org/u/ArjanBytez)\
**Replies:** 2\
**Last updated:** [July 10, 2021, 7:02pm UTC](https://discourse.processing.org/t/rotating-3d-objects-in-pgraphics-for-hires-output/31155 "2021-07-10T19:02:37Z")

</div>

I’m trying to achieve something which should be fairly easy, but after checking the forums I still can’t get it to work: making 3D-objects to rotate in hires imagery in Processing (v3 in this case, v4 doesn’t seem to wor…

---

## [Pre-3.0 Releases Work, but 3.0+ Crashes on Startup With No Error](https://discourse.processing.org/t/pre-3-0-releases-work-but-3-0-crashes-on-startup-with-no-error/31115)

<div class="topic-metadata">

**Author:** [@krakuu42](https://discourse.processing.org/u/krakuu42)\
**Replies:** 6\
**Last updated:** [July 10, 2021, 3:51pm UTC](https://discourse.processing.org/t/pre-3-0-releases-work-but-3-0-crashes-on-startup-with-no-error/31115 "2021-07-10T15:51:40Z")

</div>

Hey everyone, I used to have Processing a couple of years ago, and just wanted to get back into. Before I get into it, I should start by saying I have been scouring the forum and github looking at similar issues and tryi…

---

## [What does the % mean in the following code below](https://discourse.processing.org/t/what-does-the-mean-in-the-following-code-below/31143)

<div class="topic-metadata">

**Author:** [@bopStu77](https://discourse.processing.org/u/bopStu77)\
**Replies:** 9\
**Last updated:** [July 10, 2021, 12:55pm UTC](https://discourse.processing.org/t/what-does-the-mean-in-the-following-code-below/31143 "2021-07-10T12:55:41Z")

</div>

int x = 35; int cols, rows; void setup() { size(280,280); strokeWeight(2); cols = width/x; rows = height/x; } void draw() { for (int m = 0; m \< cols; m++) { for (int n = 0; n \< rows; n++) { \*\*\*if ((m % 2 == …

---

## [Single rectangle button](https://discourse.processing.org/t/single-rectangle-button/30948)

<div class="topic-metadata">

**Author:** [@PARINAZ129](https://discourse.processing.org/u/PARINAZ129)\
**Replies:** 4\
**Last updated:** [July 10, 2021, 11:30am UTC](https://discourse.processing.org/t/single-rectangle-button/30948 "2021-07-10T11:30:36Z")

</div>

Dear As you or your co-workers suggested to me,I tried to change my code.at this time I want to make a single rect button that has been filled with multiple colors as it being pressed however it doesn’t work. may I ask …

---

## [Parabolic Curve](https://discourse.processing.org/t/parabolic-curve/31122)

<div class="topic-metadata">

**Author:** [@bopStu77](https://discourse.processing.org/u/bopStu77)\
**Replies:** 10\
**Last updated:** [July 10, 2021, 2:37am UTC](https://discourse.processing.org/t/parabolic-curve/31122 "2021-07-10T02:37:06Z")

</div>

I’m new to coding and processing. I have no idea how to begin this code, I wonder how I should start? This what I need to get below. please format code with \</\> button \* homework policy \* asking questions

---

## [2 random points on the circumference of a circle](https://discourse.processing.org/t/2-random-points-on-the-circumference-of-a-circle/31129)

<div class="topic-metadata">

**Author:** [@gentle\_ben](https://discourse.processing.org/u/gentle_ben)\
**Replies:** 4\
**Last updated:** [July 9, 2021, 1:09pm UTC](https://discourse.processing.org/t/2-random-points-on-the-circumference-of-a-circle/31129 "2021-07-09T13:09:21Z")

</div>

Hi, hope you can help me. I’m sure this is simple. I’ve found many references to getting random point on the edge of circle using (cos(angle)\*radius, sin(angle)\*radius) but what i have come up with generates points that…

---

## [Updating packages inside VisualStudio editor](https://discourse.processing.org/t/updating-packages-inside-visualstudio-editor/31102)

<div class="topic-metadata">

**Author:** [@WhiteSte](https://discourse.processing.org/u/WhiteSte)\
**Replies:** 1\
**Last updated:** [July 9, 2021, 12:05pm UTC](https://discourse.processing.org/t/updating-packages-inside-visualstudio-editor/31102 "2021-07-09T12:05:10Z")

</div>

Hi i’m trying to execute a code but i’m incurring into some problems. The first problem is the rendering execution of the GUI’s text (controlP5) of my big program. To fix that, i’m trying to execute a little code, but it…

---

## [I'm trying to make an Agar.io copy](https://discourse.processing.org/t/im-trying-to-make-an-agar-io-copy/7327)

<div class="topic-metadata">

**Author:** [@Krokido](https://discourse.processing.org/u/Krokido)\
**Replies:** 7\
**Last updated:** [January 9, 2019, 9:37am UTC](https://discourse.processing.org/t/im-trying-to-make-an-agar-io-copy/7327 "2019-01-09T09:37:08Z")

</div>

I am new in programming and I wanted to try to make Agar.io copy, but I do not know how to create food. My code

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

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