# Coding Questions

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

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

**Page:** 184

---

## [Trying to make a nested list for pixel storage](https://discourse.processing.org/t/trying-to-make-a-nested-list-for-pixel-storage/1536)

<div class="topic-metadata">

**Author:** [@CottonSquab](https://discourse.processing.org/u/CottonSquab)\
**Replies:** 3\
**Last updated:** [July 6, 2018, 12:20pm UTC](https://discourse.processing.org/t/trying-to-make-a-nested-list-for-pixel-storage/1536 "2018-07-06T12:20:00Z")

</div>

I’m trying to make a program that finds the average pixel color of pixel clusters of an image. I’m having trouble making a list to store those averages ((int red, int green, int blue), (int red, int green, int blue), etc…

---

## [Problem with random](https://discourse.processing.org/t/problem-with-random/1541)

<div class="topic-metadata">

**Author:** [@vajo](https://discourse.processing.org/u/vajo)\
**Replies:** 3\
**Last updated:** [July 6, 2018, 9:34am UTC](https://discourse.processing.org/t/problem-with-random/1541 "2018-07-06T09:34:16Z")

</div>

Hey i want to create a Game in Processing and i need a random command wich Pics a random Numbers of 1 to 5 … If i use the normal random Code then IT could happened that a number bigger than 5 … I need a special command…

---

## [Help with Spacewar Assignment](https://discourse.processing.org/t/help-with-spacewar-assignment/1418)

<div class="topic-metadata">

**Author:** [@Chrisatsinnoh](https://discourse.processing.org/u/Chrisatsinnoh)\
**Replies:** 18\
**Last updated:** [July 6, 2018, 4:12am UTC](https://discourse.processing.org/t/help-with-spacewar-assignment/1418 "2018-07-06T04:12:12Z")

</div>

Greetings, Proceessing community. I’m working on a Spacewar iteration assignment for my university which is due in 5 days by now. I ran into a problem where I’m attempting to declare a scoring system (in which for each …

---

## [Button on a touchscreen](https://discourse.processing.org/t/button-on-a-touchscreen/1505)

<div class="topic-metadata">

**Author:** [@AidanLand](https://discourse.processing.org/u/AidanLand)\
**Replies:** 2\
**Last updated:** [July 5, 2018, 11:24pm UTC](https://discourse.processing.org/t/button-on-a-touchscreen/1505 "2018-07-05T23:24:49Z")

</div>

Hi, I’m trying to create a drawing program that will work with a touch screen. Right now I can draw on the screen with a pen, but if I try to click a button on the screen my program won’t respond. I have to either swipe,…

---

## [Java: create objects and call their methods in loops](https://discourse.processing.org/t/java-create-objects-and-call-their-methods-in-loops/1515)

<div class="topic-metadata">

**Author:** [@Brian](https://discourse.processing.org/u/Brian)\
**Replies:** 7\
**Last updated:** [July 5, 2018, 6:09pm UTC](https://discourse.processing.org/t/java-create-objects-and-call-their-methods-in-loops/1515 "2018-07-05T18:09:17Z")

</div>

I’m trying to use a loop to create 10 objects at a time then use another loop in Draw() method to call the objects’ render() methods. At first I tried creating and calling objects method manually and it worked. Now I wa…

---

## [Help: Make particlesystem bounce off edges](https://discourse.processing.org/t/help-make-particlesystem-bounce-off-edges/1311)

<div class="topic-metadata">

**Author:** [@ElegyforFedora](https://discourse.processing.org/u/ElegyforFedora)\
**Replies:** 7\
**Last updated:** [July 4, 2018, 6:06pm UTC](https://discourse.processing.org/t/help-make-particlesystem-bounce-off-edges/1311 "2018-07-04T18:06:49Z")

</div>

Hi all! I’m fairly new to coding and all new to this forum. I have a small problem with some code which I would like a bit of guidance on. The code is supposed to model a fire/flame moving around the screen. The problem …

---

## [Key value disappears after holding two keys](https://discourse.processing.org/t/key-value-disappears-after-holding-two-keys/1497)

<div class="topic-metadata">

**Author:** [@Richard122](https://discourse.processing.org/u/Richard122)\
**Replies:** 1\
**Last updated:** [July 4, 2018, 5:43pm UTC](https://discourse.processing.org/t/key-value-disappears-after-holding-two-keys/1497 "2018-07-04T17:43:56Z")

</div>

Hi there, I am new to Processing and I came up with the idea to make a version of Space Invaders to get acquainted with it. After encountering a lot of trouble with processing simultaneous key inputs I properly took care…

---

## [Regex \\w and \\\\w is not working](https://discourse.processing.org/t/regex-w-and-w-is-not-working/1478)

<div class="topic-metadata">

**Author:** [@tomte55](https://discourse.processing.org/u/tomte55)\
**Replies:** 1\
**Last updated:** [July 3, 2018, 11:36pm UTC](https://discourse.processing.org/t/regex-w-and-w-is-not-working/1478 "2018-07-03T23:36:40Z")

</div>

I’m making a rename function where you input a filepath then a name. Then the function is going to find the last entry in the filepath and replace it with the inputted name, And the filepath input is something like thi…

---

## [How to separate the first letter of each word in a string](https://discourse.processing.org/t/how-to-separate-the-first-letter-of-each-word-in-a-string/1449)

<div class="topic-metadata">

**Author:** [@nerdboybi](https://discourse.processing.org/u/nerdboybi)\
**Replies:** 6\
**Last updated:** [July 3, 2018, 3:11am UTC](https://discourse.processing.org/t/how-to-separate-the-first-letter-of-each-word-in-a-string/1449 "2018-07-03T03:11:32Z")

</div>

Hello, I want to separate the first letters of each word in the string: String animals=(“ant, bat, cat”);

---

## [Final array is being changed](https://discourse.processing.org/t/final-array-is-being-changed/1447)

<div class="topic-metadata">

**Author:** [@thesuperdaine](https://discourse.processing.org/u/thesuperdaine)\
**Replies:** 7\
**Last updated:** [July 3, 2018, 1:57am UTC](https://discourse.processing.org/t/final-array-is-being-changed/1447 "2018-07-03T01:57:42Z")

</div>

I’m making a platforming game that uses arrays to store the 32x32 tile playfield. There are three arrays that are used in this process. When I construct a Level class object, a specific array is put in that constructor. …

---

## [Trying to toggle multiple layers' visibility - New to Processing/Java,](https://discourse.processing.org/t/trying-to-toggle-multiple-layers-visibility-new-to-processing-java/1443)

<div class="topic-metadata">

**Author:** [@PerryJohnson](https://discourse.processing.org/u/PerryJohnson)\
**Replies:** 3\
**Last updated:** [July 2, 2018, 10:03pm UTC](https://discourse.processing.org/t/trying-to-toggle-multiple-layers-visibility-new-to-processing-java/1443 "2018-07-02T22:03:54Z")

</div>

Some experience in PHP but new to Java. I have a working layer visibility toggle but I’d like to make my toggleVis function able to handle more layers by passing a parameter. Any help out there, please? Here’s my code. P…

---

## [Camera only shows black screen. How to fix?](https://discourse.processing.org/t/camera-only-shows-black-screen-how-to-fix/1395)

<div class="topic-metadata">

**Author:** [@WindJammer](https://discourse.processing.org/u/WindJammer)\
**Replies:** 5\
**Last updated:** [July 2, 2018, 8:36pm UTC](https://discourse.processing.org/t/camera-only-shows-black-screen-how-to-fix/1395 "2018-07-02T20:36:02Z")

</div>

It’s a weird thing and only occurs in this sketch i’m working on. So it can’t be a problem with my (laptop) webcam. https://drive.google.com/drive/folders/1Vu4FjusiwR7pa1BzRV1mA\_I5yCBbbgT2?usp=sharing My sketch has 3 s…

---

## [Question About Rotating Quad](https://discourse.processing.org/t/question-about-rotating-quad/1423)

<div class="topic-metadata">

**Author:** [@QuazArxx](https://discourse.processing.org/u/QuazArxx)\
**Replies:** 5\
**Last updated:** [July 2, 2018, 1:15pm UTC](https://discourse.processing.org/t/question-about-rotating-quad/1423 "2018-07-02T13:15:51Z")

</div>

So the title may not be clear enough but i’m trying to make the Galactic Empire emblem from Star Wars. in the very middle circle there are trapezoids coming out. I made the first top one but is there a formula or a funct…

---

## [Transparent/translucent window (drawing graphics on desktop). How to capture mouse and keyboard?](https://discourse.processing.org/t/transparent-translucent-window-drawing-graphics-on-desktop-how-to-capture-mouse-and-keyboard/1390)

<div class="topic-metadata">

**Author:** [@rsb](https://discourse.processing.org/u/rsb)\
**Replies:** 3\
**Last updated:** [July 2, 2018, 12:09am UTC](https://discourse.processing.org/t/transparent-translucent-window-drawing-graphics-on-desktop-how-to-capture-mouse-and-keyboard/1390 "2018-07-02T00:09:23Z")

</div>

Hello forum :slight\_smile: I found a fairly simple way to use processing to draw graphics directly to your screen, to make it seem like your window is transparent or translucent, or that your graphics background has ful…

---

## [How to pass node script into processing](https://discourse.processing.org/t/how-to-pass-node-script-into-processing/1272)

<div class="topic-metadata">

**Author:** [@sujithsa007](https://discourse.processing.org/u/sujithsa007)\
**Replies:** 3\
**Last updated:** [July 1, 2018, 1:23am UTC](https://discourse.processing.org/t/how-to-pass-node-script-into-processing/1272 "2018-07-01T01:23:37Z")

</div>

I have a node script which sends a value to Samsung Artik Cloud. Also have an Arduino project which send data through the serial port into processing, which I am able to store as an int variable. Question is how can I …

---

## [How to check pixels color](https://discourse.processing.org/t/how-to-check-pixels-color/1316)

<div class="topic-metadata">

**Author:** [@albertohilal](https://discourse.processing.org/u/albertohilal)\
**Replies:** 2\
**Last updated:** [June 30, 2018, 6:45pm UTC](https://discourse.processing.org/t/how-to-check-pixels-color/1316 "2018-06-30T18:45:02Z")

</div>

How to check pixels colors if the rectangle it only has white return “Incompleto !!” has white and yellow return “Incompleto !!” only has yellow return “Amarillos!!” color a = color(255,255,0); color b = color(255,2…

---

## [Databending images through processing](https://discourse.processing.org/t/databending-images-through-processing/1364)

<div class="topic-metadata">

**Author:** [@komats](https://discourse.processing.org/u/komats)\
**Replies:** 2\
**Last updated:** [June 30, 2018, 4:41pm UTC](https://discourse.processing.org/t/databending-images-through-processing/1364 "2018-06-30T16:41:25Z")

</div>

I wonder if there are some scripts for glitching images. Are there some examples that actually work. I tried from this webpage https://steemit.com/art/@granturismo89/how-to-make-amazing-glitch-art-with-processing-and-asd…

---

## [Stuck working with classes not updating](https://discourse.processing.org/t/stuck-working-with-classes-not-updating/1359)

<div class="topic-metadata">

**Author:** [@wontner](https://discourse.processing.org/u/wontner)\
**Replies:** 3\
**Last updated:** [June 29, 2018, 12:26pm UTC](https://discourse.processing.org/t/stuck-working-with-classes-not-updating/1359 "2018-06-29T12:26:43Z")

</div>

Hello, I’m stuck, I’m trying to create a class with ellipse that will go from one place to another, with the help of sinus and cosinus curves. but when I wrote the class and the method and then call it in draw. it doesn’…

---

## [Program is very slow after export from MAC to Window](https://discourse.processing.org/t/program-is-very-slow-after-export-from-mac-to-window/1331)

<div class="topic-metadata">

**Author:** [@Mmminh](https://discourse.processing.org/u/Mmminh)\
**Replies:** 1\
**Last updated:** [June 29, 2018, 5:30am UTC](https://discourse.processing.org/t/program-is-very-slow-after-export-from-mac-to-window/1331 "2018-06-29T05:30:41Z")

</div>

when I run my program on MAC it’s work very well but when I export it to Window, It’s run very slow Is there some thing to do with RAM?? please help thanks

---

## [Match 3 remove from arraylist](https://discourse.processing.org/t/match-3-remove-from-arraylist/1167)

<div class="topic-metadata">

**Author:** [@ctrembla](https://discourse.processing.org/u/ctrembla)\
**Replies:** 8\
**Last updated:** [June 28, 2018, 6:35pm UTC](https://discourse.processing.org/t/match-3-remove-from-arraylist/1167 "2018-06-28T18:35:29Z")

</div>

I’m trying to create a match 3 & made a check function that works & tell me when there are 3 in a row. I tried giving each one a float but when I go to remove the letters assign to each i that met nothing happened. Can a…

---

## [Start sketch with hidden window](https://discourse.processing.org/t/start-sketch-with-hidden-window/1263)

<div class="topic-metadata">

**Author:** [@cuI6QV0SphbBeN9E](https://discourse.processing.org/u/cuI6QV0SphbBeN9E)\
**Replies:** 5\
**Last updated:** [June 28, 2018, 2:52am UTC](https://discourse.processing.org/t/start-sketch-with-hidden-window/1263 "2018-06-28T02:52:24Z")

</div>

void setup() { surface.setVisible(false); } If we run the above code, the window itself gets hidden but with a sudden flicker — we can see it get created and then hidden. Is it possible to start with a truly hidden wi…

---

## [Out of memory problem](https://discourse.processing.org/t/out-of-memory-problem/1300)

<div class="topic-metadata">

**Author:** [@Mmminh](https://discourse.processing.org/u/Mmminh)\
**Replies:** 9\
**Last updated:** [June 28, 2018, 1:53am UTC](https://discourse.processing.org/t/out-of-memory-problem/1300 "2018-06-28T01:53:54Z")

</div>

when I run the program for 20 minute it will get slower and then stop and say it out of memory I think problem is at code below if (port.available()\>0){ String val=port.readString(); String list=split(val,‘,’); pre…

---

## [how to Make sound wave change color according to sound frequency from mic input ](https://discourse.processing.org/t/how-to-make-sound-wave-change-color-according-to-sound-frequency-from-mic-input/385)

<div class="topic-metadata">

**Author:** [@harmony](https://discourse.processing.org/u/harmony)\
**Replies:** 3\
**Last updated:** [June 28, 2018, 1:41am UTC](https://discourse.processing.org/t/how-to-make-sound-wave-change-color-according-to-sound-frequency-from-mic-input/385 "2018-06-28T01:41:13Z")

</div>

hello, i have a Mic input from minim library, i want to know the value of the sound frequency and make the sound wave change color according to sound input. i know about fft but all the examples I’ve seen had uploaded …

---

## [How to instantiate class from with class.forName()](https://discourse.processing.org/t/how-to-instantiate-class-from-with-class-forname/957)

<div class="topic-metadata">

**Author:** [@Stanlepunk](https://discourse.processing.org/u/Stanlepunk)\
**Replies:** 2\
**Last updated:** [June 27, 2018, 9:47pm UTC](https://discourse.processing.org/t/how-to-instantiate-class-from-with-class-forname/957 "2018-06-27T21:47:35Z")

</div>

I try to instantiate class from a class name but I fail. My first state it’s find a good class, I manage this part but after I find no possibility to instantiate from the class name. I need to do that because all my meth…

---

## [dataPath("") only works in "data" folder](https://discourse.processing.org/t/datapath-only-works-in-data-folder/1310)

<div class="topic-metadata">

**Author:** [@grumo](https://discourse.processing.org/u/grumo)\
**Replies:** 5\
**Last updated:** [June 27, 2018, 6:13pm UTC](https://discourse.processing.org/t/datapath-only-works-in-data-folder/1310 "2018-06-27T18:13:14Z")

</div>

I use this script for reading and filtering files by extension in a folder. The thing is that it only works when reading “/data” if I do “/data/something” or “/something” it won’t work. Is driving me crazy. I’m working i…

---

## [Using args\[\] for opening files](https://discourse.processing.org/t/using-args-for-opening-files/942)

<div class="topic-metadata">

**Author:** [@madscientist](https://discourse.processing.org/u/madscientist)\
**Replies:** 14\
**Last updated:** [June 27, 2018, 12:34am UTC](https://discourse.processing.org/t/using-args-for-opening-files/942 "2018-06-27T00:34:00Z")

</div>

I am working on a program that I want to be able to open files with by double-clicking on the file and choosing “open with…” - name of exported sketch. I know the program can open the files because it opens them just fi…

---

## [Geolocation and Osc Message](https://discourse.processing.org/t/geolocation-and-osc-message/1117)

<div class="topic-metadata">

**Author:** [@netphysicist](https://discourse.processing.org/u/netphysicist)\
**Replies:** 7\
**Last updated:** [June 27, 2018, 2:14pm UTC](https://discourse.processing.org/t/geolocation-and-osc-message/1117 "2018-06-27T14:14:12Z")

</div>

Hello, i try to create a programm in Java which sends geolocation( longitude, latitude) from Android to PC via oscP5 library. Based on AccelerometerData example i made this code but my problem is that when i run the co…

---

## [Help with calling the parent file](https://discourse.processing.org/t/help-with-calling-the-parent-file/1202)

<div class="topic-metadata">

**Author:** [@helplouis](https://discourse.processing.org/u/helplouis)\
**Replies:** 1\
**Last updated:** [June 27, 2018, 12:02am UTC](https://discourse.processing.org/t/help-with-calling-the-parent-file/1202 "2018-06-27T00:02:18Z")

</div>

Hi, currently trying to make meme soundboard, and I’m trying to create a array of the sound classes whilst using the processing sound library. So my question for any good samaritan willing to plead for my cause is how ca…

---

## [Detect Motion - Moving object with camera input](https://discourse.processing.org/t/detect-motion-moving-object-with-camera-input/1182)

<div class="topic-metadata">

**Author:** [@brunofontainha](https://discourse.processing.org/u/brunofontainha)\
**Replies:** 2\
**Last updated:** [June 26, 2018, 1:44pm UTC](https://discourse.processing.org/t/detect-motion-moving-object-with-camera-input/1182 "2018-06-26T13:44:43Z")

</div>

Hi, i would like to have the camera position at one corner and moving an object from left-right and right-left in the middle of the screen. However i struggling to manage not having at the top a full line with the came…

---

## [Help with code project](https://discourse.processing.org/t/help-with-code-project/1219)

<div class="topic-metadata">

**Author:** [@Jewlz0205](https://discourse.processing.org/u/Jewlz0205)\
**Replies:** 4\
**Last updated:** [June 26, 2018, 9:03am UTC](https://discourse.processing.org/t/help-with-code-project/1219 "2018-06-26T09:03:19Z")

</div>

Hello! My teacher asked us to do a simple wind chill calculation and have our code run to the display window along with a string of text. I feel like all of my calculations are correct, however, I could really use some t…

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

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