# Coding Questions

**URL:** https://discourse.processing.org/c/processing/processing-questions/15.md?page=144

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

**Page:** 145

---

## [How to locate colored pixel](https://discourse.processing.org/t/how-to-locate-colored-pixel/9902)

<div class="topic-metadata">

**Author:** [@bobson](https://discourse.processing.org/u/bobson)\
**Replies:** 8\
**Last updated:** [April 7, 2019, 8:54pm UTC](https://discourse.processing.org/t/how-to-locate-colored-pixel/9902 "2019-04-07T20:54:52Z")

</div>

Hi, im working with .png types and need help how to find the x,y location of certain colored pixels. my png has two green pixels (0,255,0) that i need to locate, so i can set the connection points for the next png to it…

---

## [Process text as shapes?](https://discourse.processing.org/t/process-text-as-shapes/10006)

<div class="topic-metadata">

**Author:** [@Daniela.gutierrezr](https://discourse.processing.org/u/Daniela.gutierrezr)\
**Replies:** 4\
**Last updated:** [April 7, 2019, 6:26pm UTC](https://discourse.processing.org/t/process-text-as-shapes/10006 "2019-04-07T18:26:30Z")

</div>

Hi guys, Is there a way to code a program that proceses text and displays them as specific shapes in processing? An example of this is the work of Leslie Roberts https://leslierobertsart.com/section/425019-Recent-work…

---

## [How mask SVG in Processing](https://discourse.processing.org/t/how-mask-svg-in-processing/9888)

<div class="topic-metadata">

**Author:** [@Misha](https://discourse.processing.org/u/Misha)\
**Replies:** 3\
**Last updated:** [April 7, 2019, 3:17pm UTC](https://discourse.processing.org/t/how-mask-svg-in-processing/9888 "2019-04-07T15:17:03Z")

</div>

Hi! I’m trying to make a SVG cutter. The goal is to upload SVG, cut it to specific shape and export back. Logic is → upload SVG → convert it → cut it → export it. I’m stuck. I upload SVG, rebuild it with vectors in Pr…

---

## [Pass a non-final like a final arg?](https://discourse.processing.org/t/pass-a-non-final-like-a-final-arg/10029)

<div class="topic-metadata">

**Author:** [@Stanlepunk](https://discourse.processing.org/u/Stanlepunk)\
**Replies:** 6\
**Last updated:** [April 7, 2019, 10:08am UTC](https://discourse.processing.org/t/pass-a-non-final-like-a-final-arg/10029 "2019-04-07T10:08:41Z")

</div>

I try to build a menu where some item can be change during the session or with data from outside unknow before the coding session. So I try to pass a non-final data but that’s don’t work obviously. I try to find a way t…

---

## [\[Project ended\] game problem moving character with mouse, ball going through the character](https://discourse.processing.org/t/project-ended-game-problem-moving-character-with-mouse-ball-going-through-the-character/9808)

<div class="topic-metadata">

**Author:** [@anon26872549](https://discourse.processing.org/u/anon26872549)\
**Replies:** 16\
**Last updated:** [April 7, 2019, 8:52am UTC](https://discourse.processing.org/t/project-ended-game-problem-moving-character-with-mouse-ball-going-through-the-character/9808 "2019-04-07T08:52:24Z")

</div>

//A problem with the character movement as it relied with the mouse. Also trouble with the ball script of which my character meant to bounce back up, as the ball went through the character. float circleX=1; float circle…

---

## [\[Eclipse\] Could not find or load main class at home, but works flawlessly elsewhere](https://discourse.processing.org/t/eclipse-could-not-find-or-load-main-class-at-home-but-works-flawlessly-elsewhere/9909)

<div class="topic-metadata">

**Author:** [@TechEpic](https://discourse.processing.org/u/TechEpic)\
**Replies:** 2\
**Last updated:** [April 6, 2019, 5:24pm UTC](https://discourse.processing.org/t/eclipse-could-not-find-or-load-main-class-at-home-but-works-flawlessly-elsewhere/9909 "2019-04-06T17:24:20Z")

</div>

I’m using Eclipse with the Processing library, I made the project on a different computer and tried to move it to my home computer. When I try to run it, I get the error: Error: Could not find or load main class Contro…

---

## [Subscribe - pvm](https://discourse.processing.org/t/subscribe-pvm/9964)

<div class="topic-metadata">

**Author:** [@Solsticio](https://discourse.processing.org/u/Solsticio)\
**Replies:** 2\
**Last updated:** [April 6, 2019, 5:19pm UTC](https://discourse.processing.org/t/subscribe-pvm/9964 "2019-04-06T17:19:40Z")

</div>

2- void setup(){ size(400,400); frameRate(20); } void draw(){ int i; for(i=0;i\<height;i++){ if(random(0,1)\<0.5) stroke(0); else stroke(255); line(0,i,width,i); } } 3- void desenhaIFSP(float x, f…

---

## [Console-based Input -- Counter Implementation](https://discourse.processing.org/t/console-based-input-counter-implementation/9948)

<div class="topic-metadata">

**Author:** [@clevelandbrowns](https://discourse.processing.org/u/clevelandbrowns)\
**Replies:** 4\
**Last updated:** [April 4, 2019, 12:46pm UTC](https://discourse.processing.org/t/console-based-input-counter-implementation/9948 "2019-04-04T12:46:09Z")

</div>

I’m attempting to write a program in which the user must input three variables. The first is a string which simply stores a name. The second is a string which gets converted to an integer using parseInt. The third is a s…

---

## [Zoom in a specific letter](https://discourse.processing.org/t/zoom-in-a-specific-letter/9835)

<div class="topic-metadata">

**Author:** [@fwtini](https://discourse.processing.org/u/fwtini)\
**Replies:** 7\
**Last updated:** [April 6, 2019, 4:09pm UTC](https://discourse.processing.org/t/zoom-in-a-specific-letter/9835 "2019-04-06T16:09:48Z")

</div>

Hi Guys I want in the following code to zoom in a specific letter “3” and after to return back. Can I do it? int w; PFont myFont; float x = 70; float y = 6; float theta = 0.0; float amplitude = 1000.0; float period =…

---

## [For loop not working](https://discourse.processing.org/t/for-loop-not-working/9935)

<div class="topic-metadata">

**Author:** [@Im\_not\_a\_robot](https://discourse.processing.org/u/Im_not_a_robot)\
**Replies:** 3\
**Last updated:** [April 6, 2019, 9:36am UTC](https://discourse.processing.org/t/for-loop-not-working/9935 "2019-04-06T09:36:07Z")

</div>

Hi! So I have been working on a project that requires me to use a 2D array. I have been trying to loop over this with the for loop, but it doesn’t seem to be working. Here’s my code. //World Variables int seed; // The s…

---

## [Creating Snake Code](https://discourse.processing.org/t/creating-snake-code/9947)

<div class="topic-metadata">

**Author:** [@02chaines](https://discourse.processing.org/u/02chaines)\
**Replies:** 5\
**Last updated:** [April 6, 2019, 9:03am UTC](https://discourse.processing.org/t/creating-snake-code/9947 "2019-04-06T09:03:58Z")

</div>

Hi, I’m new when it comes to processing so I’ve been having quite a hard time with coming up with codes and making them work properly. I’m trying to create a snake(similar to the snake game except there’s no food, scorin…

---

## [Help with text file to single letters needed](https://discourse.processing.org/t/help-with-text-file-to-single-letters-needed/9996)

<div class="topic-metadata">

**Author:** [@tobor](https://discourse.processing.org/u/tobor)\
**Replies:** 7\
**Last updated:** [April 6, 2019, 12:28am UTC](https://discourse.processing.org/t/help-with-text-file-to-single-letters-needed/9996 "2019-04-06T00:28:59Z")

</div>

Hi, I need some help from experienced users… I have 3 txt files: test1.txt, test2.txt and test3.txt every txt file is made of 200 random letters with no spaces like: AAIOEELLEEIIAAOOWECERT etc… I need to chose rando…

---

## [Notes in Tables](https://discourse.processing.org/t/notes-in-tables/9712)

<div class="topic-metadata">

**Author:** [@poppanona](https://discourse.processing.org/u/poppanona)\
**Replies:** 14\
**Last updated:** [April 5, 2019, 11:58pm UTC](https://discourse.processing.org/t/notes-in-tables/9712 "2019-04-05T23:58:41Z")

</div>

I am looking for the best way to format a table that contains general notes on the data as well as the data itself. for example, the data could have typical column headers and each row would have corresponding entries. H…

---

## [Can you manipulate frameRate/Speed of draw()?](https://discourse.processing.org/t/can-you-manipulate-framerate-speed-of-draw/971)

<div class="topic-metadata">

**Author:** [@colleen](https://discourse.processing.org/u/colleen)\
**Replies:** 3\
**Last updated:** [June 14, 2018, 8:45pm UTC](https://discourse.processing.org/t/can-you-manipulate-framerate-speed-of-draw/971 "2018-06-14T20:45:50Z")

</div>

Hello, I am new to Processing (and I learned Java almost 3 years ago so I’m a little rusty). I am trying to make an animation of several bike-riding trips over a 24-hour period. The time lapses at a good speed while the…

---

## [Noob need to record mouse when on another window](https://discourse.processing.org/t/noob-need-to-record-mouse-when-on-another-window/10009)

<div class="topic-metadata">

**Author:** [@Coriandre](https://discourse.processing.org/u/Coriandre)\
**Replies:** 1\
**Last updated:** [April 5, 2019, 7:15pm UTC](https://discourse.processing.org/t/noob-need-to-record-mouse-when-on-another-window/10009 "2019-04-05T19:15:10Z")

</div>

Hi! I would like to record the mouse’s mouvement when working on a software like photoshop. The code below is perfect but how to use it when the mouse is on another window ? void setup() { size(640, 360); backgrou…

---

## [How to double the size of the array](https://discourse.processing.org/t/how-to-double-the-size-of-the-array/9849)

<div class="topic-metadata">

**Author:** [@Aryan\_Pandhare](https://discourse.processing.org/u/Aryan_Pandhare)\
**Replies:** 4\
**Last updated:** [April 5, 2019, 4:43pm UTC](https://discourse.processing.org/t/how-to-double-the-size-of-the-array/9849 "2019-04-05T16:43:24Z")

</div>

I have written the following code for simple drawing program and I need to double the size of the partially filled array when it is full of data. Here is my code… final int START\_POINTS = 5; int\[\] x = new int\[START\_POI…

---

## [Text problem with stroke](https://discourse.processing.org/t/text-problem-with-stroke/9998)

<div class="topic-metadata">

**Author:** [@fwtini](https://discourse.processing.org/u/fwtini)\
**Replies:** 4\
**Last updated:** [April 5, 2019, 3:08pm UTC](https://discourse.processing.org/t/text-problem-with-stroke/9998 "2019-04-05T15:08:58Z")

</div>

Hi Guys can you explain me why the stroke doesn’t work on text? PFont myFont; int x=0; float y; float r =0; String s="test"; float xPosition=500; void setup(){ size(500,500); background(0); myFont=loa…

---

## [Find width and height of the text drawn with text()](https://discourse.processing.org/t/find-width-and-height-of-the-text-drawn-with-text/9804)

<div class="topic-metadata">

**Author:** [@kingblue](https://discourse.processing.org/u/kingblue)\
**Replies:** 3\
**Last updated:** [April 5, 2019, 2:40pm UTC](https://discourse.processing.org/t/find-width-and-height-of-the-text-drawn-with-text/9804 "2019-04-05T14:40:48Z")

</div>

Hi, I was wondering if it was possible to, say, draw a rectangle around the exact width and height of a block of text on screen. Let’s say my text() is like follows: String stringText = "Lorem ipsum dolor sit amet, con…

---

## [Strings! Hi Guys i can't understand why my code doesn't work!](https://discourse.processing.org/t/strings-hi-guys-i-cant-understand-why-my-code-doesnt-work/9961)

<div class="topic-metadata">

**Author:** [@fwtini](https://discourse.processing.org/u/fwtini)\
**Replies:** 7\
**Last updated:** [April 5, 2019, 2:35pm UTC](https://discourse.processing.org/t/strings-hi-guys-i-cant-understand-why-my-code-doesnt-work/9961 "2019-04-05T14:35:04Z")

</div>

Hi guys can you explain me the strings? Why my code doesn’t work? PFont myFont; int x; int y; String s="AVFTA"; void setup(){ size(500,500); background(255); myFont=createFont("SansSerif-48.tff",24); text(s,50,50…

---

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

<div class="topic-metadata">

**Author:** [@Stanlepunk](https://discourse.processing.org/u/Stanlepunk)\
**Replies:** 23\
**Last updated:** [April 5, 2019, 12:28pm UTC](https://discourse.processing.org/t/create-callback/9831 "2019-04-05T12:28:25Z")

</div>

I try to create a method to make a callback, but that’s don’t work. Consol return the error message. I think my problem is from: i pass this and this don’t read my sketch i suppose ? void setup() { select\_callback("my…

---

## [How to make object bounce off another object](https://discourse.processing.org/t/how-to-make-object-bounce-off-another-object/9595)

<div class="topic-metadata">

**Author:** [@Bobby](https://discourse.processing.org/u/Bobby)\
**Replies:** 16\
**Last updated:** [April 4, 2019, 11:54pm UTC](https://discourse.processing.org/t/how-to-make-object-bounce-off-another-object/9595 "2019-04-04T23:54:59Z")

</div>

Have gotten down how to make a ball bounce with gravity. Now I want that ball to hit a moving object and bounce off it. Any help on how to to do that?

---

## [Having trouble declaring a new object](https://discourse.processing.org/t/having-trouble-declaring-a-new-object/9955)

<div class="topic-metadata">

**Author:** [@hasanfarhan33](https://discourse.processing.org/u/hasanfarhan33)\
**Replies:** 1\
**Last updated:** [April 4, 2019, 10:48am UTC](https://discourse.processing.org/t/having-trouble-declaring-a-new-object/9955 "2019-04-04T10:48:33Z")

</div>

Hello guys. I am stuck on my project again. Sorry to disturb you all. I am trying to create a simple game where a particular colored box goes to its location. For example, a red box should cross the red line and a green …

---

## [Import Excel .xlsx to Processing](https://discourse.processing.org/t/import-excel-xlsx-to-processing/9816)

<div class="topic-metadata">

**Author:** [@angel96](https://discourse.processing.org/u/angel96)\
**Replies:** 6\
**Last updated:** [April 3, 2019, 7:58pm UTC](https://discourse.processing.org/t/import-excel-xlsx-to-processing/9816 "2019-04-03T19:58:15Z")

</div>

Hello! I have a problem about importing an excel file into processing. I followed this guide: Private Site but in importExcel(), at this line: Sheet sheet = wb.getSheetAt(0); show me an error: NullPointException. …

---

## [NullPointerException with ArrayList of Objects](https://discourse.processing.org/t/nullpointerexception-with-arraylist-of-objects/9895)

<div class="topic-metadata">

**Author:** [@LordBruce](https://discourse.processing.org/u/LordBruce)\
**Replies:** 1\
**Last updated:** [April 2, 2019, 10:04pm UTC](https://discourse.processing.org/t/nullpointerexception-with-arraylist-of-objects/9895 "2019-04-02T22:04:49Z")

</div>

So I am trying to get a list of objects, that when something is pressed, it will add new objects to the list to be checked. I keep getting NullPointerException and I can’t figure it out. I have tried adding a new item wh…

---

## [Keep P3D running when surface is not visible](https://discourse.processing.org/t/keep-p3d-running-when-surface-is-not-visible/9896)

<div class="topic-metadata">

**Author:** [@clankill3r](https://discourse.processing.org/u/clankill3r)\
**Replies:** 1\
**Last updated:** [April 3, 2019, 2:19am UTC](https://discourse.processing.org/t/keep-p3d-running-when-surface-is-not-visible/9896 "2019-04-03T02:19:34Z")

</div>

Is there a way to keep P3D running when the surface is not visible? void setup() { size(600, 600, P3D); PSurfaceJOGL surface = (PSurfaceJOGL) getSurface(); surface.setVisible(false); } void draw() { println(fr…

---

## [Drew an Unwanted Circle on Screen](https://discourse.processing.org/t/drew-an-unwanted-circle-on-screen/9889)

<div class="topic-metadata">

**Author:** [@kirstee\_baxt](https://discourse.processing.org/u/kirstee_baxt)\
**Replies:** 2\
**Last updated:** [April 2, 2019, 9:45pm UTC](https://discourse.processing.org/t/drew-an-unwanted-circle-on-screen/9889 "2019-04-02T21:45:21Z")

</div>

Hello! Writing some code based here, and for some reason it is generating an outlined coral colored circle. I believe this is coming from the line graph I drew (in the first begin shape) but not sure where in the code I …

---

## [How to use Processing to open a new ped file](https://discourse.processing.org/t/how-to-use-processing-to-open-a-new-ped-file/9829)

<div class="topic-metadata">

**Author:** [@SandCrocus](https://discourse.processing.org/u/SandCrocus)\
**Replies:** 4\
**Last updated:** [April 2, 2019, 5:04pm UTC](https://discourse.processing.org/t/how-to-use-processing-to-open-a-new-ped-file/9829 "2019-04-02T17:04:38Z")

</div>

I want to open a specified pde file when I press the mouse. I have tried the function runtime,getruntime().exec, but it can only open an exe file. How can I open the pde file?

---

## [Accessing nested values in a table](https://discourse.processing.org/t/accessing-nested-values-in-a-table/9761)

<div class="topic-metadata">

**Author:** [@solub](https://discourse.processing.org/u/solub)\
**Replies:** 16\
**Last updated:** [April 2, 2019, 12:31pm UTC](https://discourse.processing.org/t/accessing-nested-values-in-a-table/9761 "2019-04-02T12:31:43Z")

</div>

I have a CSV file with no headers and where each row contains multiple lists of floats. \[(40.65, 20.30, 120.92, 86.12, 99.33), (10.35, 90.10, 10.52, 1.12, 59.3), (10.65, 62.10, 12.12, 96.23, 19.3)\] \[(96.37, 67.13, 312.6…

---

## [Shape intersection (or a way to do raster)](https://discourse.processing.org/t/shape-intersection-or-a-way-to-do-raster/9741)

<div class="topic-metadata">

**Author:** [@igorguerrero](https://discourse.processing.org/u/igorguerrero)\
**Replies:** 2\
**Last updated:** [April 1, 2019, 6:12pm UTC](https://discourse.processing.org/t/shape-intersection-or-a-way-to-do-raster/9741 "2019-04-01T18:12:42Z")

</div>

Hello! I have a set of vectorial shapes (in processing, p5, inkscape…) that combined form a image. All shapes have solid colors and a layer ranking (I know which one is on top). All I want to do is, setting a new (“ran…

---

## [Text covered by an image](https://discourse.processing.org/t/text-covered-by-an-image/9723)

<div class="topic-metadata">

**Author:** [@fwtini](https://discourse.processing.org/u/fwtini)\
**Replies:** 2\
**Last updated:** [April 1, 2019, 3:25pm UTC](https://discourse.processing.org/t/text-covered-by-an-image/9723 "2019-04-01T15:25:11Z")

</div>

Hi guys I have a problem, the letters hide or disappear when I load the image. Maybe can someone help? I am new here so I think it’s very easy! Thank you. String\[\] headlines = { "3 3 3 3 3 3 3 3 3 3…

[Previous page](https://discourse.processing.org/c/processing/processing-questions/15.md?page=143)

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