# Processing

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

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

**Page:** 216

---

## [Problem using GPanel and child windows in G4P library](https://discourse.processing.org/t/problem-using-gpanel-and-child-windows-in-g4p-library/20137)

<div class="topic-metadata">

**Author:** [@David](https://discourse.processing.org/u/David)\
**Replies:** 30\
**Last updated:** [April 30, 2020, 1:36pm UTC](https://discourse.processing.org/t/problem-using-gpanel-and-child-windows-in-g4p-library/20137 "2020-04-30T13:36:37Z")

</div>

This is a further refinement to the sketch I posted in my previous question. I want to divide the main window into panels, and from some of the panels, I want to open a child window. The code below works fine without pan…

---

## [Color randomizing time reaction game](https://discourse.processing.org/t/color-randomizing-time-reaction-game/20222)

<div class="topic-metadata">

**Author:** [@stanley](https://discourse.processing.org/u/stanley)\
**Replies:** 1\
**Last updated:** [April 30, 2020, 12:08pm UTC](https://discourse.processing.org/t/color-randomizing-time-reaction-game/20222 "2020-04-30T12:08:51Z")

</div>

Hello all, I am relativity new to Processing and I have challenged myself to evolve a previous art project into a game based on reaction time. Below is an image of this project with my Processing interface open on the c…

---

## [Making an object appear multiple times when required](https://discourse.processing.org/t/making-an-object-appear-multiple-times-when-required/20236)

<div class="topic-metadata">

**Author:** [@captainmajere](https://discourse.processing.org/u/captainmajere)\
**Replies:** 1\
**Last updated:** [April 30, 2020, 11:41am UTC](https://discourse.processing.org/t/making-an-object-appear-multiple-times-when-required/20236 "2020-04-30T11:41:58Z")

</div>

I am trying to make a game about consuming balls and I have yet to find a solution for these two problems. 1- Making collision a one time thing without using a flag 2-Making my redorbs spawn exponantially after consumi…

---

## [Bubbles transform to black rectangles](https://discourse.processing.org/t/bubbles-transform-to-black-rectangles/20258)

<div class="topic-metadata">

**Author:** [@gurki](https://discourse.processing.org/u/gurki)\
**Replies:** 6\
**Last updated:** [April 30, 2020, 11:18am UTC](https://discourse.processing.org/t/bubbles-transform-to-black-rectangles/20258 "2020-04-30T11:18:04Z")

</div>

Hello Guys, I need help from an task where I am not quite sure where I am wrong. The task is in German but I will translate it via Deppl.com to english: Write the class Blubb with the four properties x, y, d (all floa…

---

## [Checking if a file exists - strange runtime error](https://discourse.processing.org/t/checking-if-a-file-exists-strange-runtime-error/20276)

<div class="topic-metadata">

**Author:** [@PhilHaw](https://discourse.processing.org/u/PhilHaw)\
**Replies:** 7\
**Last updated:** [April 30, 2020, 11:14am UTC](https://discourse.processing.org/t/checking-if-a-file-exists-strange-runtime-error/20276 "2020-04-30T11:14:00Z")

</div>

I’m trying to write a routine that will load from a user’s file (required filename is, say “My patches.txt”) in the data folder but that will default to another file if the user’s file does not exist. I found the ‘file e…

---

## [Multiple canvases](https://discourse.processing.org/t/multiple-canvases/20237)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 1\
**Last updated:** [April 29, 2020, 11:16pm UTC](https://discourse.processing.org/t/multiple-canvases/20237 "2020-04-29T23:16:25Z")

</div>

How do I get passed the following problem. I want to use PGraphics to create multiple canvases so that I can have proper overflow control on my menus however the following happens note the rectangle square in the bac…

---

## [Continuation of flocking example](https://discourse.processing.org/t/continuation-of-flocking-example/20018)

<div class="topic-metadata">

**Author:** [@alfrandell](https://discourse.processing.org/u/alfrandell)\
**Replies:** 7\
**Last updated:** [April 29, 2020, 6:26pm UTC](https://discourse.processing.org/t/continuation-of-flocking-example/20018 "2020-04-29T18:26:42Z")

</div>

I have continued with the arraylist example called flocking. I add health, age of boid, and a pecking order. Then, i can add predators. To amuse myself during a plague, i have been adding lifelike avoidance and hunting …

---

## [\[Unfolding Maps\] load custom map style](https://discourse.processing.org/t/unfolding-maps-load-custom-map-style/20245)

<div class="topic-metadata">

**Author:** [@eduzal](https://discourse.processing.org/u/eduzal)\
**Replies:** 2\
**Last updated:** [April 29, 2020, 2:58pm UTC](https://discourse.processing.org/t/unfolding-maps-load-custom-map-style/20245 "2020-04-29T14:58:23Z")

</div>

Hi.i’m trying to use online custom styled maps with Unfolding Maps. i wanna know how do I call a custom styled Mapbox or Google Maps maps. for instance, i have this mapbox style mapbox://styles/eduzal/ck9k5tj3b0n121jwa…

---

## [Storing Files in a Folder](https://discourse.processing.org/t/storing-files-in-a-folder/20265)

<div class="topic-metadata">

**Author:** [@Jack](https://discourse.processing.org/u/Jack)\
**Replies:** 3\
**Last updated:** [April 29, 2020, 1:56pm UTC](https://discourse.processing.org/t/storing-files-in-a-folder/20265 "2020-04-29T13:56:34Z")

</div>

Hello, I am working on a project currently where I have about 80 images to use. I would like all of these images to be in an array. As this number of images makes the files look cluttered, I would like to be able to sto…

---

## [Using Hexidecimal colors from a table (BEGINNER)](https://discourse.processing.org/t/using-hexidecimal-colors-from-a-table-beginner/19958)

<div class="topic-metadata">

**Author:** [@BenEvans](https://discourse.processing.org/u/BenEvans)\
**Replies:** 2\
**Last updated:** [April 29, 2020, 9:32am UTC](https://discourse.processing.org/t/using-hexidecimal-colors-from-a-table-beginner/19958 "2020-04-29T09:32:07Z")

</div>

Very basic question about how to pull hexi colors from a table. I want to have a bunch of six-character, regular ol’ hexidecimal colors in a column and use them to color my circles or lines or whatever. But it seems that…

---

## [Why am I getting InvocationTargetException?](https://discourse.processing.org/t/why-am-i-getting-invocationtargetexception/19917)

<div class="topic-metadata">

**Author:** [@Hypercube](https://discourse.processing.org/u/Hypercube)\
**Replies:** 1\
**Last updated:** [April 29, 2020, 5:11am UTC](https://discourse.processing.org/t/why-am-i-getting-invocationtargetexception/19917 "2020-04-29T05:11:05Z")

</div>

The code (it’s supposed to draw traffic lights: 1st a rectangle then 3 colored circles in it. The circles all start out as gray) final int windowWidth = 480; final int windowHeight = windowWidth; int timer; //final fl…

---

## [Help on reset draw()](https://discourse.processing.org/t/help-on-reset-draw/20110)

<div class="topic-metadata">

**Author:** [@random\_programmer](https://discourse.processing.org/u/random_programmer)\
**Replies:** 7\
**Last updated:** [April 28, 2020, 11:11pm UTC](https://discourse.processing.org/t/help-on-reset-draw/20110 "2020-04-28T23:11:30Z")

</div>

Hello there, here is my code for a tic tac toe game. How can I reset the game by pressing the reset button? I only want to reset draw(). Is there any way to do this? int rows = 3; int cols = 3; int \[\] \[\] matrix = new …

---

## [How do you find the latitude and longitude of a image map when hovering or clicking the mouse?](https://discourse.processing.org/t/how-do-you-find-the-latitude-and-longitude-of-a-image-map-when-hovering-or-clicking-the-mouse/20063)

<div class="topic-metadata">

**Author:** [@Stage1](https://discourse.processing.org/u/Stage1)\
**Replies:** 6\
**Last updated:** [April 28, 2020, 10:03pm UTC](https://discourse.processing.org/t/how-do-you-find-the-latitude-and-longitude-of-a-image-map-when-hovering-or-clicking-the-mouse/20063 "2020-04-28T22:03:40Z")

</div>

Hi, i would like to know if there is a way to find the coordinates of an image when clicked on a specific area on the image or when hovered over with a mouse.

---

## [Image() is slow, are there any alternatives?](https://discourse.processing.org/t/image-is-slow-are-there-any-alternatives/20146)

<div class="topic-metadata">

**Author:** [@KevinWho](https://discourse.processing.org/u/KevinWho)\
**Replies:** 24\
**Last updated:** [April 28, 2020, 7:51pm UTC](https://discourse.processing.org/t/image-is-slow-are-there-any-alternatives/20146 "2020-04-28T19:51:18Z")

</div>

I am rendering about 1024 images, they have to be scaled up, I store the scaled-up version so it is a bit faster. these images are covering the whole screen, and I would like to get at least 60 fps when rendering this. I…

---

## [saveFrame() not saving the whole frame in P3D](https://discourse.processing.org/t/saveframe-not-saving-the-whole-frame-in-p3d/20244)

<div class="topic-metadata">

**Author:** [@ivaneo](https://discourse.processing.org/u/ivaneo)\
**Replies:** 2\
**Last updated:** [April 28, 2020, 6:57pm UTC](https://discourse.processing.org/t/saveframe-not-saving-the-whole-frame-in-p3d/20244 "2020-04-28T18:57:41Z")

</div>

Hello, I have a 1920x1080p P3D sketch that I want to export, however, when I use saveFrame(), it only saves what is appearing on the screen, so I get a frame that has a part of it cut off and black. I have a 1366x768p di…

---

## [How to use length of a string for collision detection](https://discourse.processing.org/t/how-to-use-length-of-a-string-for-collision-detection/20218)

<div class="topic-metadata">

**Author:** [@Cybernet](https://discourse.processing.org/u/Cybernet)\
**Replies:** 2\
**Last updated:** [April 28, 2020, 6:08pm UTC](https://discourse.processing.org/t/how-to-use-length-of-a-string-for-collision-detection/20218 "2020-04-28T18:08:42Z")

</div>

So I have this code that displays a string, and whenever the mouse hovers over it, then it changes colour. if (mouseX \> 40 && mouseX \< text.length() \* 17) fill(0); The text size is 25. However, it seems that text.l…

---

## [PShape get Children target name afterwards](https://discourse.processing.org/t/pshape-get-children-target-name-afterwards/20189)

<div class="topic-metadata">

**Author:** [@eduzal](https://discourse.processing.org/u/eduzal)\
**Replies:** 2\
**Last updated:** [April 28, 2020, 4:22pm UTC](https://discourse.processing.org/t/pshape-get-children-target-name-afterwards/20189 "2020-04-28T16:22:43Z")

</div>

Hi, i’m working on the next iteration of my corona virus data viz apllication and got stuck in a PShape issue. Is there a way to get PShape children target names? Above is the current situation of the dashboard. The i…

---

## [Problem by receiving datas in Arduino? Or problem by sending datas to Arduino?](https://discourse.processing.org/t/problem-by-receiving-datas-in-arduino-or-problem-by-sending-datas-to-arduino/20202)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 2\
**Last updated:** [April 28, 2020, 11:05am UTC](https://discourse.processing.org/t/problem-by-receiving-datas-in-arduino-or-problem-by-sending-datas-to-arduino/20202 "2020-04-28T11:05:33Z")

</div>

Continuing the discussion from RE: My program getting slower when I write datas on Serial Port: Hello all, I send 5 datas from Processing to Arduino and I re write those datas with Arduino into an other serial port tha…

---

## [NSWindow drag regions should only be invalidated on the Main Thread!](https://discourse.processing.org/t/nswindow-drag-regions-should-only-be-invalidated-on-the-main-thread/20233)

<div class="topic-metadata">

**Author:** [@igormakovsky](https://discourse.processing.org/u/igormakovsky)\
**Replies:** 0\
**Last updated:** [April 28, 2020, 10:38am UTC](https://discourse.processing.org/t/nswindow-drag-regions-should-only-be-invalidated-on-the-main-thread/20233 "2020-04-28T10:38:04Z")

</div>

Hello! I am new to processing and just learn the basics. I’ve encountered strange problem with initializing P3D. Launching 3d sketch takes almost a minute (p2d launches in a few seconds) + puts this in terminal: java\[5…

---

## [G4P modal dialog behavior?](https://discourse.processing.org/t/g4p-modal-dialog-behavior/20188)

<div class="topic-metadata">

**Author:** [@ed\_from\_maine](https://discourse.processing.org/u/ed_from_maine)\
**Replies:** 3\
**Last updated:** [April 28, 2020, 9:14am UTC](https://discourse.processing.org/t/g4p-modal-dialog-behavior/20188 "2020-04-28T09:14:57Z")

</div>

I was wondering if there was a way to get a G4P secondary window to behave like a modal dialog-- I would like to create code that would require the user to remain in the window, and to provide an answer, before the windo…

---

## [\[SOLVED\] Problems sending data from Processing to Arduino through serial port](https://discourse.processing.org/t/solved-problems-sending-data-from-processing-to-arduino-through-serial-port/20138)

<div class="topic-metadata">

**Author:** [@bacum](https://discourse.processing.org/u/bacum)\
**Replies:** 10\
**Last updated:** [April 28, 2020, 6:22am UTC](https://discourse.processing.org/t/solved-problems-sending-data-from-processing-to-arduino-through-serial-port/20138 "2020-04-28T06:22:00Z")

</div>

Hello everybody! I’m newbie in Processing. I’m writing here hoping that someone will be able to help me… Thanks in advance;) I’m trying to communicate two XBEE S1 modules between the computer and an Arduino Mega, in AT…

---

## [Pixelate Ellipse Shape](https://discourse.processing.org/t/pixelate-ellipse-shape/20148)

<div class="topic-metadata">

**Author:** [@AndJ](https://discourse.processing.org/u/AndJ)\
**Replies:** 7\
**Last updated:** [April 27, 2020, 11:49pm UTC](https://discourse.processing.org/t/pixelate-ellipse-shape/20148 "2020-04-27T23:49:03Z")

</div>

As I was working through a project, I was wondering if there was a way to make a “pixelated ellipse” in Processing (I have provided an example of what I was thinking). I don’t want to have to import an image.

---

## [Easy question about if and function](https://discourse.processing.org/t/easy-question-about-if-and-function/20205)

<div class="topic-metadata">

**Author:** [@thom](https://discourse.processing.org/u/thom)\
**Replies:** 5\
**Last updated:** [April 27, 2020, 10:57pm UTC](https://discourse.processing.org/t/easy-question-about-if-and-function/20205 "2020-04-27T22:57:08Z")

</div>

I’m trying to make a simple tic tac toe game in processing. I don’t understand why the functions don’t follow the if() statements. CODE: int counter=0; void setup(){ size(500,500); background(255); strokeWeight(15); li…

---

## [Reduce output latency set to 80 msec for Windows 10?](https://discourse.processing.org/t/reduce-output-latency-set-to-80-msec-for-windows-10/19988)

<div class="topic-metadata">

**Author:** [@earp123](https://discourse.processing.org/u/earp123)\
**Replies:** 1\
**Last updated:** [April 27, 2020, 9:01pm UTC](https://discourse.processing.org/t/reduce-output-latency-set-to-80-msec-for-windows-10/19988 "2020-04-27T21:01:52Z")

</div>

Using AudioIn to grab the sound card but the default latency is causing a noticeable delay. Half the default, or 40ms would be great. Anyone know how to configure this, preferably on the processing side and not the Windo…

---

## [Ball should change direction after touching edge of the frame](https://discourse.processing.org/t/ball-should-change-direction-after-touching-edge-of-the-frame/20207)

<div class="topic-metadata">

**Author:** [@julia1312](https://discourse.processing.org/u/julia1312)\
**Replies:** 3\
**Last updated:** [April 27, 2020, 2:42pm UTC](https://discourse.processing.org/t/ball-should-change-direction-after-touching-edge-of-the-frame/20207 "2020-04-27T14:42:38Z")

</div>

Hi! I am completely new in the world of programming! I have started my programming lessons recently and I am stuck with my homework. What I basically have to do is a moving ball. The ball should move with velocity 20 pix…

---

## [Make a object class with random size](https://discourse.processing.org/t/make-a-object-class-with-random-size/19901)

<div class="topic-metadata">

**Author:** [@PabloTryAnimations](https://discourse.processing.org/u/PabloTryAnimations)\
**Replies:** 3\
**Last updated:** [April 27, 2020, 11:47am UTC](https://discourse.processing.org/t/make-a-object-class-with-random-size/19901 "2020-04-27T11:47:29Z")

</div>

I’m trying to make the size random in an object class Peixe (designed with BeginShape, and moving with pop Matrix ). I tried with scale, but didn’t work. Please Could you help me? void setup() { size (1000, 800); p…

---

## [Creating a font in setup but getting error in draw that no font are loaded](https://discourse.processing.org/t/creating-a-font-in-setup-but-getting-error-in-draw-that-no-font-are-loaded/20195)

<div class="topic-metadata">

**Author:** [@Ayfri](https://discourse.processing.org/u/Ayfri)\
**Replies:** 4\
**Last updated:** [April 27, 2020, 8:42am UTC](https://discourse.processing.org/t/creating-a-font-in-setup-but-getting-error-in-draw-that-no-font-are-loaded/20195 "2020-04-27T08:42:39Z")

</div>

Hi ! I’m using this code to generate a font that and use it in my setup function : public void setup() { PFont font = createFont("Arial", 32); textFont(font); } And on my draw function I just do public void d…

---

## [Rotating arcs based on probability are not all appearing in sketch](https://discourse.processing.org/t/rotating-arcs-based-on-probability-are-not-all-appearing-in-sketch/20147)

<div class="topic-metadata">

**Author:** [@debxyz](https://discourse.processing.org/u/debxyz)\
**Replies:** 5\
**Last updated:** [April 27, 2020, 1:44am UTC](https://discourse.processing.org/t/rotating-arcs-based-on-probability-are-not-all-appearing-in-sketch/20147 "2020-04-27T01:44:27Z")

</div>

Using probability I am trying to rotate arc object motifs in a 1D grid. I feel like I’ve tried every placement possibility of push&popMatrix (in class and main program) so that each arc rotates individually according to…

---

## [How to write files](https://discourse.processing.org/t/how-to-write-files/20155)

<div class="topic-metadata">

**Author:** [@Cybernet](https://discourse.processing.org/u/Cybernet)\
**Replies:** 5\
**Last updated:** [April 27, 2020, 12:31am UTC](https://discourse.processing.org/t/how-to-write-files/20155 "2020-04-27T00:31:21Z")

</div>

So I have this code: import java.io.FileWriter; FileWriter writeFile = new FileWriter("file.txt"); void setup() { noLoop(); } void draw() { writeFile.write("Hello World!"); writeFile.close(); } But the en…

---

## [My program getting slower when I write datas on Serial Port](https://discourse.processing.org/t/my-program-getting-slower-when-i-write-datas-on-serial-port/19828)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 6\
**Last updated:** [April 17, 2020, 9:52pm UTC](https://discourse.processing.org/t/my-program-getting-slower-when-i-write-datas-on-serial-port/19828 "2020-04-17T21:52:10Z")

</div>

Hello, I think there is a problem with my Processing program to write datas to the Serial Port. Or there is a problem with my Arduino code to read datas from the serial Port. I give you both program. Thank you. import…

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

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