# Coding Questions

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

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

**Page:** 109

---

## [Problem with making Window loading](https://discourse.processing.org/t/problem-with-making-window-loading/17843)

<div class="topic-metadata">

**Author:** [@NumericPrime](https://discourse.processing.org/u/NumericPrime)\
**Replies:** 4\
**Last updated:** [February 16, 2020, 2:02pm UTC](https://discourse.processing.org/t/problem-with-making-window-loading/17843 "2020-02-16T14:02:36Z")

</div>

As I was using the javax.swing library I made a Window, that should paint something if the correct button is pressed. The problem is that it is only painted if I close the window I made. How can I Prevent the program fro…

---

## [Perhaps another way to shuffle lerped colors in an array?](https://discourse.processing.org/t/perhaps-another-way-to-shuffle-lerped-colors-in-an-array/17597)

<div class="topic-metadata">

**Author:** [@debxyz](https://discourse.processing.org/u/debxyz)\
**Replies:** 38\
**Last updated:** [February 15, 2020, 11:40am UTC](https://discourse.processing.org/t/perhaps-another-way-to-shuffle-lerped-colors-in-an-array/17597 "2020-02-15T11:40:59Z")

</div>

Watching a D Shiffman tutorial on probability prompted me to try this. I want to shuffle a colorList array of lerped colors. Search turned up to use IntList and shuffle. But in setup for loop I thought to replace k++; …

---

## [Help with crash detection](https://discourse.processing.org/t/help-with-crash-detection/17595)

<div class="topic-metadata">

**Author:** [@zoobs](https://discourse.processing.org/u/zoobs)\
**Replies:** 2\
**Last updated:** [February 15, 2020, 5:12am UTC](https://discourse.processing.org/t/help-with-crash-detection/17595 "2020-02-15T05:12:25Z")

</div>

So i have a game i have a defender and aliens who are moving towards the defender and the defender is the user who avoids the alien. I need to add a collision detection so when the alien collides with the defender the ga…

---

## [Low Res Images get Blured when Scaled Up](https://discourse.processing.org/t/low-res-images-get-blured-when-scaled-up/17764)

<div class="topic-metadata">

**Author:** [@KevinWho](https://discourse.processing.org/u/KevinWho)\
**Replies:** 2\
**Last updated:** [February 13, 2020, 5:17am UTC](https://discourse.processing.org/t/low-res-images-get-blured-when-scaled-up/17764 "2020-02-13T05:17:43Z")

</div>

This happens when I try to use PImage.resize(w,h); The closest thing to working is image(PImage, x,y,w,h);. I found that adding the width and height parameters to this would slow down the framerate significantly. I wa…

---

## [Keypressed(): Can this even be done?](https://discourse.processing.org/t/keypressed-can-this-even-be-done/17808)

<div class="topic-metadata">

**Author:** [@rorange](https://discourse.processing.org/u/rorange)\
**Replies:** 3\
**Last updated:** [February 14, 2020, 2:57am UTC](https://discourse.processing.org/t/keypressed-can-this-even-be-done/17808 "2020-02-14T02:57:25Z")

</div>

Hi all, I’ve been working on a project for a few days where I’m meant to use keypressed to do a number of things. First thing I’m struggling with: “Make a keyPressed function with the following behavior: • The first …

---

## [Line between balls](https://discourse.processing.org/t/line-between-balls/17606)

<div class="topic-metadata">

**Author:** [@l3ehfar](https://discourse.processing.org/u/l3ehfar)\
**Replies:** 5\
**Last updated:** [February 13, 2020, 2:38pm UTC](https://discourse.processing.org/t/line-between-balls/17606 "2020-02-13T14:38:31Z")

</div>

Hi I remember I watched a tutorial of coding train channel a year ago that implement a line between balls in a particular distance as above: class Ball { PVector org, location; float a = 10; float theta, radius, …

---

## [Rectangle Collision in ArrayList](https://discourse.processing.org/t/rectangle-collision-in-arraylist/17770)

<div class="topic-metadata">

**Author:** [@StadiumDelirium](https://discourse.processing.org/u/StadiumDelirium)\
**Replies:** 4\
**Last updated:** [February 13, 2020, 12:15pm UTC](https://discourse.processing.org/t/rectangle-collision-in-arraylist/17770 "2020-02-13T12:15:13Z")

</div>

Hi everybody, this is my first post. I am new to Processing and therefor having some trouble with a game that I am supposed to code in college. Also, please excuse my bad English, I am from Germany :wink: In my coding…

---

## [Input/ouput file dialog appears behind window/s](https://discourse.processing.org/t/input-ouput-file-dialog-appears-behind-window-s/17146)

<div class="topic-metadata">

**Author:** [@mala](https://discourse.processing.org/u/mala)\
**Replies:** 3\
**Last updated:** [February 13, 2020, 11:23am UTC](https://discourse.processing.org/t/input-ouput-file-dialog-appears-behind-window-s/17146 "2020-02-13T11:23:03Z")

</div>

On windows, when using selectInput() or selectOutput() the file dialog popup is always behind the main sketch/app and also any other file browser windows you may have open. From memory this problem has been around for s…

---

## [Table removeColumn(index) not working correctly?](https://discourse.processing.org/t/table-removecolumn-index-not-working-correctly/17585)

<div class="topic-metadata">

**Author:** [@plux](https://discourse.processing.org/u/plux)\
**Replies:** 3\
**Last updated:** [February 12, 2020, 6:47pm UTC](https://discourse.processing.org/t/table-removecolumn-index-not-working-correctly/17585 "2020-02-12T18:47:49Z")

</div>

Hello, as followup to this post. I’m now trying to remove some columns but I’m having strange issue. Basically this: table.removeColumn(0); table.removeColumn(1); table.removeColumn(2); will remove column…

---

## [Feedback on Button maker](https://discourse.processing.org/t/feedback-on-button-maker/17768)

<div class="topic-metadata">

**Author:** [@SWijnen](https://discourse.processing.org/u/SWijnen)\
**Replies:** 5\
**Last updated:** [February 12, 2020, 6:44pm UTC](https://discourse.processing.org/t/feedback-on-button-maker/17768 "2020-02-12T18:44:23Z")

</div>

Hello everyone, I tried to create a button class and now I am wondering what I can improve upon this code. I am also wondering how I would be able to only have the upper button working when the buttons overlap each oth…

---

## [Beginner: new pages (state)](https://discourse.processing.org/t/beginner-new-pages-state/17774)

<div class="topic-metadata">

**Author:** [@amprocessing](https://discourse.processing.org/u/amprocessing)\
**Replies:** 3\
**Last updated:** [February 12, 2020, 6:21pm UTC](https://discourse.processing.org/t/beginner-new-pages-state/17774 "2020-02-12T18:21:10Z")

</div>

HI, I am trying to figure out how to create a number of pages in my sketch. I don’t want to just reset the background. I know that you may need to use the switch case function, but I don’t understand how it works. Can so…

---

## [Zoom on clicked area then click again to zoom back out](https://discourse.processing.org/t/zoom-on-clicked-area-then-click-again-to-zoom-back-out/17675)

<div class="topic-metadata">

**Author:** [@afleetw](https://discourse.processing.org/u/afleetw)\
**Replies:** 2\
**Last updated:** [February 12, 2020, 5:45pm UTC](https://discourse.processing.org/t/zoom-on-clicked-area-then-click-again-to-zoom-back-out/17675 "2020-02-12T17:45:28Z")

</div>

I uploaded an image then created a flashlight type of light that only showcases part of the image that are hovered over. That part of the code worked but now I want to use if/else statements to zoom in on a clicked area …

---

## [Creating a count function](https://discourse.processing.org/t/creating-a-count-function/17771)

<div class="topic-metadata">

**Author:** [@amprocessing](https://discourse.processing.org/u/amprocessing)\
**Replies:** 2\
**Last updated:** [February 12, 2020, 4:18pm UTC](https://discourse.processing.org/t/creating-a-count-function/17771 "2020-02-12T16:18:09Z")

</div>

Im new to processing so im still a beginner. So, I have added code below that displays a simple maze. This code allows the users to move the ball around the maze, and to collect the small dots. I want to add a funtion th…

---

## [How I save an image with SVG](https://discourse.processing.org/t/how-i-save-an-image-with-svg/17646)

<div class="topic-metadata">

**Author:** [@christiank79](https://discourse.processing.org/u/christiank79)\
**Replies:** 4\
**Last updated:** [February 12, 2020, 12:25am UTC](https://discourse.processing.org/t/how-i-save-an-image-with-svg/17646 "2020-02-12T00:25:11Z")

</div>

I have a coding about Floyd-Steinberg dithering and I want to save an image in SVG format. This is coding: color\[\] colorPalette = new color\[\] { color(0, 0, 0), color(0, 0, 255), color(0, 255, 0), color(0, 25…

---

## [lerpColor not working on Processing but working on CodePen](https://discourse.processing.org/t/lerpcolor-not-working-on-processing-but-working-on-codepen/17729)

<div class="topic-metadata">

**Author:** [@Pandoma](https://discourse.processing.org/u/Pandoma)\
**Replies:** 4\
**Last updated:** [February 11, 2020, 11:49pm UTC](https://discourse.processing.org/t/lerpcolor-not-working-on-processing-but-working-on-codepen/17729 "2020-02-11T23:49:27Z")

</div>

I have tried the following code on Processing 3.5.3 and CodePen (https://codepen.io/KevinWorkman/pen/vXZmvB?editors=1000 - paste code within it.) Problem - Apparently the lerpColor does not work with Processing but work…

---

## [Open file in folder and subfolders](https://discourse.processing.org/t/open-file-in-folder-and-subfolders/17552)

<div class="topic-metadata">

**Author:** [@plux](https://discourse.processing.org/u/plux)\
**Replies:** 6\
**Last updated:** [February 11, 2020, 2:12pm UTC](https://discourse.processing.org/t/open-file-in-folder-and-subfolders/17552 "2020-02-11T14:12:19Z")

</div>

Hello, I had this code working at some point. However I’m not sure what I’ve changed and now it’s broken. The method should open every file in a folder and in each subfolders (recursively) to check which one has less l…

---

## [Processing Project: falling circles](https://discourse.processing.org/t/processing-project-falling-circles/17712)

<div class="topic-metadata">

**Author:** [@kandrews](https://discourse.processing.org/u/kandrews)\
**Replies:** 1\
**Last updated:** [February 11, 2020, 10:12am UTC](https://discourse.processing.org/t/processing-project-falling-circles/17712 "2020-02-11T10:12:08Z")

</div>

so I’m working on code and I’ve created a falling circle code. right now the circle have random diameter, speed, color, and etc. I’m trying to make the circles interact for a project. every time the circles overlap they …

---

## [Making 3D walls visible](https://discourse.processing.org/t/making-3d-walls-visible/17708)

<div class="topic-metadata">

**Author:** [@Camalf](https://discourse.processing.org/u/Camalf)\
**Replies:** 3\
**Last updated:** [February 11, 2020, 9:34am UTC](https://discourse.processing.org/t/making-3d-walls-visible/17708 "2020-02-11T09:34:31Z")

</div>

I have a 3d box bouncing sim, with a camera around the mouse. anyways i want to make the walls different colors so u can tell its 3d, heres my code. float x; float y; int xa; int xb; int xdirection = 1; int ydirect…

---

## [Handle (and consume) mouse events in classes](https://discourse.processing.org/t/handle-and-consume-mouse-events-in-classes/17689)

<div class="topic-metadata">

**Author:** [@Alex\_Pr](https://discourse.processing.org/u/Alex_Pr)\
**Replies:** 3\
**Last updated:** [February 11, 2020, 1:30am UTC](https://discourse.processing.org/t/handle-and-consume-mouse-events-in-classes/17689 "2020-02-11T01:30:23Z")

</div>

Is there a way to handle (and consume) mouse events within classes, hierarchically, instead of having to call the handlers from, say, the mousePressed() method? Registering the class methods works for handling the event…

---

## [Use javax.swing](https://discourse.processing.org/t/use-javax-swing/17669)

<div class="topic-metadata">

**Author:** [@creepercrack](https://discourse.processing.org/u/creepercrack)\
**Replies:** 2\
**Last updated:** [February 9, 2020, 6:45pm UTC](https://discourse.processing.org/t/use-javax-swing/17669 "2020-02-09T18:45:13Z")

</div>

Hi Just some questions regarding using swing: I want to make a sketch that uses javax.swing for the ui buttons and stuff: Does processing have a default JFrame tha I should use (the one I’m interested in)? I have to …

---

## [How to change vertical stripes to angled stripes?](https://discourse.processing.org/t/how-to-change-vertical-stripes-to-angled-stripes/17690)

<div class="topic-metadata">

**Author:** [@ottenm](https://discourse.processing.org/u/ottenm)\
**Replies:** 2\
**Last updated:** [February 10, 2020, 4:52pm UTC](https://discourse.processing.org/t/how-to-change-vertical-stripes-to-angled-stripes/17690 "2020-02-10T16:52:17Z")

</div>

I have a sketch that divides the screen into a bunch of vertical stripes, with each stripe drawn in a distinct color. I have the colors stored in an ArrayList and I use lerpColor() to gradually fade each stripe into the…

---

## [2D Perlin noise function](https://discourse.processing.org/t/2d-perlin-noise-function/17602)

<div class="topic-metadata">

**Author:** [@Dangeroustuber](https://discourse.processing.org/u/Dangeroustuber)\
**Replies:** 3\
**Last updated:** [February 10, 2020, 2:09pm UTC](https://discourse.processing.org/t/2d-perlin-noise-function/17602 "2020-02-10T14:09:20Z")

</div>

I will keep this brief, im trying to implement my own perlin noise function. It does not work, why does it not work? How can i make it work? I also want to add the fact that i have been programming in proccessing for …

---

## [Help! making a game project](https://discourse.processing.org/t/help-making-a-game-project/17681)

<div class="topic-metadata">

**Author:** [@Thaunagamer](https://discourse.processing.org/u/Thaunagamer)\
**Replies:** 1\
**Last updated:** [February 10, 2020, 12:57pm UTC](https://discourse.processing.org/t/help-making-a-game-project/17681 "2020-02-10T12:57:34Z")

</div>

Back again. This portion is part of one of my levels where i have 5 levels with platforms the “player” (shape) is suppose to navigate through with out touching. on my previous level i was able to make to 2 levels with p…

---

## [Problem with mouseY: I can’t bring animation to work](https://discourse.processing.org/t/problem-with-mousey-i-can-t-bring-animation-to-work/17635)

<div class="topic-metadata">

**Author:** [@nausheen](https://discourse.processing.org/u/nausheen)\
**Replies:** 4\
**Last updated:** [February 8, 2020, 2:59pm UTC](https://discourse.processing.org/t/problem-with-mousey-i-can-t-bring-animation-to-work/17635 "2020-02-08T14:59:50Z")

</div>

I have used mouseY in my project but i cnt see any animation, there is no error on the console as well. Can someone please tell me the cases wherein mouseY is suppressed

---

## [How do I set these circles up?](https://discourse.processing.org/t/how-do-i-set-these-circles-up/17567)

<div class="topic-metadata">

**Author:** [@ImConfused](https://discourse.processing.org/u/ImConfused)\
**Replies:** 10\
**Last updated:** [February 8, 2020, 9:25am UTC](https://discourse.processing.org/t/how-do-i-set-these-circles-up/17567 "2020-02-08T09:25:02Z")

</div>

I’m having a hard time figuring out how to change the colors and how to set up the circles.Help a example would help

---

## [Getting Raw Mouse Data](https://discourse.processing.org/t/getting-raw-mouse-data/17617)

<div class="topic-metadata">

**Author:** [@jim8000](https://discourse.processing.org/u/jim8000)\
**Replies:** 1\
**Last updated:** [February 7, 2020, 11:25pm UTC](https://discourse.processing.org/t/getting-raw-mouse-data/17617 "2020-02-07T23:25:48Z")

</div>

Hi, New to forum and to Processing. I am trying to get raw mouse data before Windows massages it. I am trying to keep track of rough position over a large 3 foot by 3 foot area. I have used this method to first update my…

---

## [Help with PacMan](https://discourse.processing.org/t/help-with-pacman/17590)

<div class="topic-metadata">

**Author:** [@ImDaGr3en](https://discourse.processing.org/u/ImDaGr3en)\
**Replies:** 2\
**Last updated:** [February 7, 2020, 9:49pm UTC](https://discourse.processing.org/t/help-with-pacman/17590 "2020-02-07T21:49:56Z")

</div>

It’s me another time… Yap, I’m trying in making a PacMan-like mini-game, and as you know in this game 4 different AI is needed. All of them, anyways, are based on the Dijkstra path finding algorithm, that should help th…

---

## [How to do a true or false game?](https://discourse.processing.org/t/how-to-do-a-true-or-false-game/15963)

<div class="topic-metadata">

**Author:** [@Ladan](https://discourse.processing.org/u/Ladan)\
**Replies:** 36\
**Last updated:** [February 7, 2020, 8:38pm UTC](https://discourse.processing.org/t/how-to-do-a-true-or-false-game/15963 "2020-02-07T20:38:59Z")

</div>

Hello! I want to make a true or false game, with these questions: String Question1 = "Wir haben einen nicht gelisteten Helfer."; String Question2 = " Wir sind das erste Mal dabei."; String Question3 = "Unser …

---

## [Java.awt.Robot coordinates](https://discourse.processing.org/t/java-awt-robot-coordinates/4967)

<div class="topic-metadata">

**Author:** [@germaine](https://discourse.processing.org/u/germaine)\
**Replies:** 4\
**Last updated:** [February 7, 2020, 7:46pm UTC](https://discourse.processing.org/t/java-awt-robot-coordinates/4967 "2020-02-07T19:46:43Z")

</div>

I’ve been playing with the Robot.mouseMove() function to move the mouse cursor around. The x,y coordinates you put in the function move the cursor to any location on the screen. However, I want the cursor to move from o…

---

## [AP Project Help](https://discourse.processing.org/t/ap-project-help/17599)

<div class="topic-metadata">

**Author:** [@Thaunagamer](https://discourse.processing.org/u/Thaunagamer)\
**Replies:** 2\
**Last updated:** [February 7, 2020, 7:29pm UTC](https://discourse.processing.org/t/ap-project-help/17599 "2020-02-07T19:29:16Z")

</div>

Hi, I know helping people fully solve their answer with their code might be a forbidden taboo and that I should try and debugging and using println(); to solve my problems. But I have tried many different solutions invol…

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

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