# Processing

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

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

**Page:** 159

---

## [How to sort an Array ArrayList?](https://discourse.processing.org/t/how-to-sort-an-array-arraylist/26809)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 8\
**Last updated:** [January 6, 2021, 6:45am UTC](https://discourse.processing.org/t/how-to-sort-an-array-arraylist/26809 "2021-01-06T06:45:32Z")

</div>

Hi! I am working on a sorting algorithm but I am still having some trouble. I have an array list ArrayList\<ArrayList\<Float\>\> segs = new ArrayList\<ArrayList\<Float\>\>(); and I want to sort() (width the default function)…

---

## [I cant play 2 videos idk why AND PLEASE STOP SAY DONT CALL SETUP :)](https://discourse.processing.org/t/i-cant-play-2-videos-idk-why-and-please-stop-say-dont-call-setup/26601)

<div class="topic-metadata">

**Author:** [@clay21](https://discourse.processing.org/u/clay21)\
**Replies:** 6\
**Last updated:** [January 6, 2021, 3:47am UTC](https://discourse.processing.org/t/i-cant-play-2-videos-idk-why-and-please-stop-say-dont-call-setup/26601 "2021-01-06T03:47:32Z")

</div>

import processing.video.\*; int puan=0; int timer; int page=0; boolean pressed=false; Movie mov,mov2; PImage foto1, foto2, foto3, foto4, foto5, foto6, foto7,foto8,foto9,foto10,foto11,bg; void setup() { size(860, 6…

---

## [Galaga projectile motion](https://discourse.processing.org/t/galaga-projectile-motion/26757)

<div class="topic-metadata">

**Author:** [@lionR](https://discourse.processing.org/u/lionR)\
**Replies:** 12\
**Last updated:** [January 5, 2021, 9:40pm UTC](https://discourse.processing.org/t/galaga-projectile-motion/26757 "2021-01-05T21:40:27Z")

</div>

//Global Variables PImage player, enemy, rocket; int playerX; int rocketX; int rocketY; //Following variables from funprogramming.org float\[\] x = new float\[250\];// creates x values for 250 stars float\[\] y = new float…

---

## [PLEASE DELETE THIS POST: Problems with constructor of Class](https://discourse.processing.org/t/please-delete-this-post-problems-with-constructor-of-class/26796)

<div class="topic-metadata">

**Author:** [@Beto](https://discourse.processing.org/u/Beto)\
**Replies:** 4\
**Last updated:** [January 5, 2021, 5:05pm UTC](https://discourse.processing.org/t/please-delete-this-post-problems-with-constructor-of-class/26796 "2021-01-05T17:05:21Z")

</div>

My code will be uploaded later in a new topic. If an admin comes across this topic, please delete.

---

## [【Processing】Shooting Star 3](https://discourse.processing.org/t/processing-shooting-star-3/26710)

<div class="topic-metadata">

**Author:** [@Rafael1004](https://discourse.processing.org/u/Rafael1004)\
**Replies:** 6\
**Last updated:** [January 5, 2021, 10:55am UTC](https://discourse.processing.org/t/processing-shooting-star-3/26710 "2021-01-05T10:55:53Z")

</div>

Can someone help me and can explan me how to do something like this? Thanks :slight\_smile:

---

## [Portable version of Processing](https://discourse.processing.org/t/portable-version-of-processing/26775)

<div class="topic-metadata">

**Author:** [@Bird](https://discourse.processing.org/u/Bird)\
**Replies:** 2\
**Last updated:** [January 5, 2021, 2:22am UTC](https://discourse.processing.org/t/portable-version-of-processing/26775 "2021-01-05T02:22:00Z")

</div>

I would like to find a way to make Processing portable. I understand that you can run it from a USB, but this do not make it portable. Currently, it will write preferences to AppData (on Windows) and it will create a Pro…

---

## [Print to console not working?](https://discourse.processing.org/t/print-to-console-not-working/26772)

<div class="topic-metadata">

**Author:** [@Kris1](https://discourse.processing.org/u/Kris1)\
**Replies:** 3\
**Last updated:** [January 4, 2021, 6:30pm UTC](https://discourse.processing.org/t/print-to-console-not-working/26772 "2021-01-04T18:30:54Z")

</div>

Hi folks, I have a strange problem. The print to console does not seem to work on new sketches. I have printed to console many times, and it is not that I do not understand how to do it- it is that it does not work. I…

---

## [Array of Images Error (loading of images)](https://discourse.processing.org/t/array-of-images-error-loading-of-images/26725)

<div class="topic-metadata">

**Author:** [@ELaN](https://discourse.processing.org/u/ELaN)\
**Replies:** 23\
**Last updated:** [January 4, 2021, 4:28pm UTC](https://discourse.processing.org/t/array-of-images-error-loading-of-images/26725 "2021-01-04T16:28:36Z")

</div>

Whenever I write this code: PImage\[\] flowers=new PImage\[3\]; Bubble\[\] bubbles=new Bubble\[5\]; void setup() { size(640, 360); for(int i=0; i\<flowers.length; i++){ flowers\[i\]=loadImage(“flower”+i+".jpg"); } for(int i…

---

## [Azure Kinect library for processing](https://discourse.processing.org/t/azure-kinect-library-for-processing/15420)

<div class="topic-metadata">

**Author:** [@tepat](https://discourse.processing.org/u/tepat)\
**Replies:** 5\
**Last updated:** [January 4, 2021, 3:49pm UTC](https://discourse.processing.org/t/azure-kinect-library-for-processing/15420 "2021-01-04T15:49:51Z")

</div>

Is there anyone already try to use kinect azure with processing ? How do you think is the best way ? because there is still no a good library like the kinectPV2 to use with :slight\_smile: do you think it’s possible…

---

## [I need your help please (image on/off)](https://discourse.processing.org/t/i-need-your-help-please-image-on-off/26755)

<div class="topic-metadata">

**Author:** [@PIlw](https://discourse.processing.org/u/PIlw)\
**Replies:** 3\
**Last updated:** [January 4, 2021, 12:40pm UTC](https://discourse.processing.org/t/i-need-your-help-please-image-on-off/26755 "2021-01-04T12:40:21Z")

</div>

Hello guys, I need help please, The thing would be, when I press a key an image appears and when I press it again it disappears. i’ve made it into my code and the image doesn’t shows up I put my code here and if someo…

---

## [How convert the Traveling Salesperson JS to Object-oriented Programming style Java Processing](https://discourse.processing.org/t/how-convert-the-traveling-salesperson-js-to-object-oriented-programming-style-java-processing/26691)

<div class="topic-metadata">

**Author:** [@psamead](https://discourse.processing.org/u/psamead)\
**Replies:** 9\
**Last updated:** [January 4, 2021, 11:47am UTC](https://discourse.processing.org/t/how-convert-the-traveling-salesperson-js-to-object-oriented-programming-style-java-processing/26691 "2021-01-04T11:47:56Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Dear friends, I am learning the Processing and trying to convert Daniel’s ‘Traveling Sales Person’ JavaScript to the Java Processing in the Obj…

---

## [I need your help please (image on / off)](https://discourse.processing.org/t/i-need-your-help-please-image-on-off/26741)

<div class="topic-metadata">

**Author:** [@PIlw](https://discourse.processing.org/u/PIlw)\
**Replies:** 3\
**Last updated:** [January 4, 2021, 11:41am UTC](https://discourse.processing.org/t/i-need-your-help-please-image-on-off/26741 "2021-01-04T11:41:05Z")

</div>

Hello guys, I would like to do something but I don’t know how : The thing would be, when I press a key an image appears and when I press it again it disappears. I know that it must be something whit keyPressed, but i …

---

## [Grayscaling a given image](https://discourse.processing.org/t/grayscaling-a-given-image/26768)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 1\
**Last updated:** [January 4, 2021, 11:28am UTC](https://discourse.processing.org/t/grayscaling-a-given-image/26768 "2021-01-04T11:28:57Z")

</div>

PImage org = loadImage("data/99484011-ead8-482a-a169-820c7981896f.jpg"), gray = org; void settings() { size(org.width\*2,org.height); gray.filter(GRAY); } void draw() { image(org,0,0); filter(GRAY); image(gray…

---

## [Dynamic PVector arraylist drawing a smooth line](https://discourse.processing.org/t/dynamic-pvector-arraylist-drawing-a-smooth-line/26762)

<div class="topic-metadata">

**Author:** [@dimpapadop](https://discourse.processing.org/u/dimpapadop)\
**Replies:** 5\
**Last updated:** [January 4, 2021, 9:56am UTC](https://discourse.processing.org/t/dynamic-pvector-arraylist-drawing-a-smooth-line/26762 "2021-01-04T09:56:01Z")

</div>

Hallo. I have a sketch with 2 applets, the first is creating an Arraylist of Pvectors points for example when mouse Dragged adds points.add(new PVector(mouseX, mouseY));, and the second draws the line that passes the p…

---

## [Darken the background of my animation with mouse](https://discourse.processing.org/t/darken-the-background-of-my-animation-with-mouse/26749)

<div class="topic-metadata">

**Author:** [@elifworks](https://discourse.processing.org/u/elifworks)\
**Replies:** 6\
**Last updated:** [January 4, 2021, 9:30am UTC](https://discourse.processing.org/t/darken-the-background-of-my-animation-with-mouse/26749 "2021-01-04T09:30:08Z")

</div>

Hello there At the end of this work, which interacts with sound and visual, I want to add one more thing: darkening the background color with mouse movement as I pinch the sound effect. How can I do that? PImage img; …

---

## [Quick code question about Serial ports](https://discourse.processing.org/t/quick-code-question-about-serial-ports/26764)

<div class="topic-metadata">

**Author:** [@jimlee](https://discourse.processing.org/u/jimlee)\
**Replies:** 2\
**Last updated:** [January 4, 2021, 8:55am UTC](https://discourse.processing.org/t/quick-code-question-about-serial-ports/26764 "2021-01-04T08:55:45Z")

</div>

I have a GDropList that I populate with the serial ports on my machine so I can select one. Here’s the code to set up the list… // Method to setup the port listing popup selctor thing. public void setupPortList(GDropLis…

---

## [Can someone create two loops out of this code?](https://discourse.processing.org/t/can-someone-create-two-loops-out-of-this-code/26760)

<div class="topic-metadata">

**Author:** [@popin](https://discourse.processing.org/u/popin)\
**Replies:** 1\
**Last updated:** [January 4, 2021, 6:50am UTC](https://discourse.processing.org/t/can-someone-create-two-loops-out-of-this-code/26760 "2021-01-04T06:50:06Z")

</div>

Hey guys, is it possible to create two loops out of this code? thank you! color\[\] colors = { #654321, #A0522D, #000000, #8B4513, #64190D, #00FF00 }; int circleX, circleY; int circle1X, circle1Y; int circle2X,…

---

## [Processing Download Issue MacOS](https://discourse.processing.org/t/processing-download-issue-macos/26735)

<div class="topic-metadata">

**Author:** [@kefournier1](https://discourse.processing.org/u/kefournier1)\
**Replies:** 2\
**Last updated:** [January 4, 2021, 2:22am UTC](https://discourse.processing.org/t/processing-download-issue-macos/26735 "2021-01-04T02:22:17Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hi everyone - I am a high school teacher in the midst of some lesson planning that uses Processing and suddenly I am no longer able to open the …

---

## [My sketch is smooth until i zoom in (drop to 15fps)](https://discourse.processing.org/t/my-sketch-is-smooth-until-i-zoom-in-drop-to-15fps/26714)

<div class="topic-metadata">

**Author:** [@WillG](https://discourse.processing.org/u/WillG)\
**Replies:** 3\
**Last updated:** [January 3, 2021, 11:38pm UTC](https://discourse.processing.org/t/my-sketch-is-smooth-until-i-zoom-in-drop-to-15fps/26714 "2021-01-03T23:38:03Z")

</div>

Hello there, for a school project, i’ve created a map with bus point and density at these bus point. Everything works fine except the frame rate when i zoom in with the slider. But i can’t remove it cause the teacher wa…

---

## [Can someone comment this code?](https://discourse.processing.org/t/can-someone-comment-this-code/26716)

<div class="topic-metadata">

**Author:** [@popin](https://discourse.processing.org/u/popin)\
**Replies:** 14\
**Last updated:** [January 3, 2021, 10:17pm UTC](https://discourse.processing.org/t/can-someone-comment-this-code/26716 "2021-01-03T22:17:22Z")

</div>

Hey can you comment this code? i dont understand please void draw () { pushMatrix(); fill(0); translate(130, 40); //adjust position for (int k = 0; k \< myLetters.length; ++k) { for (int i = 0; i \< 4; i++) {//clarte…

---

## [Draw code frame by frame](https://discourse.processing.org/t/draw-code-frame-by-frame/26687)

<div class="topic-metadata">

**Author:** [@Sophie](https://discourse.processing.org/u/Sophie)\
**Replies:** 7\
**Last updated:** [January 3, 2021, 6:39pm UTC](https://discourse.processing.org/t/draw-code-frame-by-frame/26687 "2021-01-03T18:39:12Z")

</div>

Hello, I am new to Processing and need help with a problem. I need the code in draw not to be played completely over and over again, but frame by frame. The background should change his color according to the first char…

---

## [GUI builder will close because the GUI found was created with an earlier version, Help, I don't want to build again](https://discourse.processing.org/t/gui-builder-will-close-because-the-gui-found-was-created-with-an-earlier-version-help-i-dont-want-to-build-again/26711)

<div class="topic-metadata">

**Author:** [@laptophead](https://discourse.processing.org/u/laptophead)\
**Replies:** 1\
**Last updated:** [January 3, 2021, 3:56pm UTC](https://discourse.processing.org/t/gui-builder-will-close-because-the-gui-found-was-created-with-an-earlier-version-help-i-dont-want-to-build-again/26711 "2021-01-03T15:56:33Z")

</div>

Peter, I have this sketch that I didn’t touch in an year, and now it won’t let me edit. Please tell me I don’t have to make it again… over 20 buttons and data… Thanks Mitch I am running the 4.4.1 now. Don’t know …

---

## [Geologic cross section with a rule](https://discourse.processing.org/t/geologic-cross-section-with-a-rule/26679)

<div class="topic-metadata">

**Author:** [@Huno](https://discourse.processing.org/u/Huno)\
**Replies:** 1\
**Last updated:** [January 2, 2021, 11:24pm UTC](https://discourse.processing.org/t/geologic-cross-section-with-a-rule/26679 "2021-01-02T23:24:48Z")

</div>

Hello! I’ve trying to make a geologic cross section for a while but I have not even had any idea on how to start. My goal is to do this 2d random graphic based on a simple rule. the idea is to: Draw a line Divide tha…

---

## [Help me. Please. (Image and color)](https://discourse.processing.org/t/help-me-please-image-and-color/26674)

<div class="topic-metadata">

**Author:** [@salvofx](https://discourse.processing.org/u/salvofx)\
**Replies:** 4\
**Last updated:** [January 2, 2021, 10:23pm UTC](https://discourse.processing.org/t/help-me-please-image-and-color/26674 "2021-01-02T22:23:26Z")

</div>

Hello everyone, I am a newbie in Processing! I have to submit a project very soon for the final exam at university but i don’t know how i can do this. Could someone help me? Taking any image, I should be able to creat…

---

## [Help with mousePressed or keyPressed](https://discourse.processing.org/t/help-with-mousepressed-or-keypressed/26689)

<div class="topic-metadata">

**Author:** [@PIlw](https://discourse.processing.org/u/PIlw)\
**Replies:** 3\
**Last updated:** [January 2, 2021, 4:43pm UTC](https://discourse.processing.org/t/help-with-mousepressed-or-keypressed/26689 "2021-01-02T16:43:34Z")

</div>

Hello guys, I need help to make this code into mouse pressed or keypressed so I want that the code appears only if I press the mouse or a key as you want but if someone could help me it would be amazing ! class bug { …

---

## [Combine 2 codes](https://discourse.processing.org/t/combine-2-codes/26671)

<div class="topic-metadata">

**Author:** [@PIlw](https://discourse.processing.org/u/PIlw)\
**Replies:** 4\
**Last updated:** [January 2, 2021, 3:34pm UTC](https://discourse.processing.org/t/combine-2-codes/26671 "2021-01-02T15:34:35Z")

</div>

Hello guys, I’ve a question : The thing is that I have 2 codes and I want to combine them like this ; the basic code would be the image of DVD mooving across the screen and then put a mousePressed line so when we press …

---

## [How to access variables from PApplet (2nd window) in default window?](https://discourse.processing.org/t/how-to-access-variables-from-papplet-2nd-window-in-default-window/26670)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 2\
**Last updated:** [January 2, 2021, 10:44am UTC](https://discourse.processing.org/t/how-to-access-variables-from-papplet-2nd-window-in-default-window/26670 "2021-01-02T10:44:21Z")

</div>

Hi! I recently saw someone’s code which allowed for 2 windows. I tried to adapt one of my programs to it but it didn’t work too well. I know I can just declare them at the beginning and be done with it, but is there a w…

---

## [Finding vector pointing "down" on 2d plane](https://discourse.processing.org/t/finding-vector-pointing-down-on-2d-plane/26567)

<div class="topic-metadata">

**Author:** [@arcadeperfect](https://discourse.processing.org/u/arcadeperfect)\
**Replies:** 2\
**Last updated:** [January 2, 2021, 3:23am UTC](https://discourse.processing.org/t/finding-vector-pointing-down-on-2d-plane/26567 "2021-01-02T03:23:26Z")

</div>

I guess this is more math than Processing per se but here goes… The 2D plane exists in 3D space and can rotate in any direction about the origin (from gyro data). How can I find the vector shown in blue that always poi…

---

## [Convert from HSB to RGB](https://discourse.processing.org/t/convert-from-hsb-to-rgb/26672)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 4\
**Last updated:** [January 1, 2021, 7:40pm UTC](https://discourse.processing.org/t/convert-from-hsb-to-rgb/26672 "2021-01-01T19:40:48Z")

</div>

Hi! Can someone send me a function that converts HSB input into RGB? (color formats, RGB = red, green, blue, HSB = hue, saturation, brightness (or Value if it is HSV)) preferred format: color toRGB(int h, int s, int b…

---

## [2 for loops inside a String function](https://discourse.processing.org/t/2-for-loops-inside-a-string-function/26669)

<div class="topic-metadata">

**Author:** [@JoLi](https://discourse.processing.org/u/JoLi)\
**Replies:** 4\
**Last updated:** [January 1, 2021, 4:54pm UTC](https://discourse.processing.org/t/2-for-loops-inside-a-string-function/26669 "2021-01-01T16:54:57Z")

</div>

why is this not working? yea, I know I dont need that boolean finished in the beginning

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

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