# Processing

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

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

**Page:** 263

---

## [Ellipse appears at 0,0 due to an array, I want it to only appear when mouse is pressed.](https://discourse.processing.org/t/ellipse-appears-at-0-0-due-to-an-array-i-want-it-to-only-appear-when-mouse-is-pressed/15198)

<div class="topic-metadata">

**Author:** [@jackattack991](https://discourse.processing.org/u/jackattack991)\
**Replies:** 1\
**Last updated:** [November 3, 2019, 4:23pm UTC](https://discourse.processing.org/t/ellipse-appears-at-0-0-due-to-an-array-i-want-it-to-only-appear-when-mouse-is-pressed/15198 "2019-11-03T16:23:24Z")

</div>

final int N\_PARTITIONS = 10; int Diameter = 10; int length = 101; // max number of nodes float \[\] Node1 = new float \[10\]; float \[\] Node2 = new float \[10\]; void setup() { background(255); size(600,360); } void draw() …

---

## [Array of Circle-Buttons do not work!](https://discourse.processing.org/t/array-of-circle-buttons-do-not-work/15118)

<div class="topic-metadata">

**Author:** [@Noerre](https://discourse.processing.org/u/Noerre)\
**Replies:** 4\
**Last updated:** [November 3, 2019, 1:41pm UTC](https://discourse.processing.org/t/array-of-circle-buttons-do-not-work/15118 "2019-11-03T13:41:45Z")

</div>

Hello, the following program creates four circle-buttons in an array. The first three buttons are unvisible and they won’t work. I can not find the mistake! The code: color myColor = color(102); int myCircleSize = 100…

---

## [More efficient UDP message parsing when receiving colour arrays from Processing on Arduino](https://discourse.processing.org/t/more-efficient-udp-message-parsing-when-receiving-colour-arrays-from-processing-on-arduino/14467)

<div class="topic-metadata">

**Author:** [@sdnorris](https://discourse.processing.org/u/sdnorris)\
**Replies:** 1\
**Last updated:** [November 3, 2019, 12:49pm UTC](https://discourse.processing.org/t/more-efficient-udp-message-parsing-when-receiving-colour-arrays-from-processing-on-arduino/14467 "2019-11-03T12:49:59Z")

</div>

I am making a flexible LED display system using Processing to generate and transmit imagery via OSC to a set of 10 Arduinos (Adafruit Feather HUZZAH), each controlling a single meter long 30-LED NeoPixel strip using the …

---

## [Drag shape with mouse / Pre-last thread in this week](https://discourse.processing.org/t/drag-shape-with-mouse-pre-last-thread-in-this-week/15176)

<div class="topic-metadata">

**Author:** [@FilDomInteractive](https://discourse.processing.org/u/FilDomInteractive)\
**Replies:** 16\
**Last updated:** [November 3, 2019, 12:31pm UTC](https://discourse.processing.org/t/drag-shape-with-mouse-pre-last-thread-in-this-week/15176 "2019-11-03T12:31:50Z")

</div>

Hello! I just want to ask, how can I make that if I drag ANY of the geometric shapes will be where my mouse, and when I release my mouse, it will stay in the place where I dragged it to? Thank you! Also, when I will ge…

---

## [Using arrays to create a node and edge connector](https://discourse.processing.org/t/using-arrays-to-create-a-node-and-edge-connector/14464)

<div class="topic-metadata">

**Author:** [@johnsmith17](https://discourse.processing.org/u/johnsmith17)\
**Replies:** 17\
**Last updated:** [November 3, 2019, 3:05am UTC](https://discourse.processing.org/t/using-arrays-to-create-a-node-and-edge-connector/14464 "2019-11-03T03:05:24Z")

</div>

hi im trying to create a program that adds balls with mousePressed on the sketch and connects each of the balls with lines. ive managed to create an array of length 5 that adds a value(mouseX and mouseY), each time i mou…

---

## [Framerate in live video delay project : Ed Tannenbaum, Recollections](https://discourse.processing.org/t/framerate-in-live-video-delay-project-ed-tannenbaum-recollections/3129)

<div class="topic-metadata">

**Author:** [@Adrien](https://discourse.processing.org/u/Adrien)\
**Replies:** 30\
**Last updated:** [November 3, 2019, 12:11am UTC](https://discourse.processing.org/t/framerate-in-live-video-delay-project-ed-tannenbaum-recollections/3129 "2019-11-03T00:11:45Z")

</div>

Hi, I try to create something like this : https://www.youtube.com/watch?v=YBKkVpRxUfs, using a kinect. At the moment I made some tests with something like this : class User { PGraphics pgTotal; PGraphics pgBodyBg…

---

## [Drag and drop an MP3 file](https://discourse.processing.org/t/drag-and-drop-an-mp3-file/15127)

<div class="topic-metadata">

**Author:** [@ozman](https://discourse.processing.org/u/ozman)\
**Replies:** 2\
**Last updated:** [November 2, 2019, 10:05pm UTC](https://discourse.processing.org/t/drag-and-drop-an-mp3-file/15127 "2019-11-02T22:05:43Z")

</div>

Hello! Are there any tutorials or does any one know how to drag and drop a sound file into a processing sketch and have it play? Thanks for any help, been struggling all day with this!

---

## [Multiple help beginner completely new](https://discourse.processing.org/t/multiple-help-beginner-completely-new/15153)

<div class="topic-metadata">

**Author:** [@FilDomInteractive](https://discourse.processing.org/u/FilDomInteractive)\
**Replies:** 1\
**Last updated:** [November 2, 2019, 4:44pm UTC](https://discourse.processing.org/t/multiple-help-beginner-completely-new/15153 "2019-11-02T16:44:43Z")

</div>

please help me, I am making a project and I want a rectangle be at a random position but will stay here until the game closes, not that it will still generate everywhere. help. I will insert the code I need to fix. Than…

---

## [Custom error throwing "Unhandled Exception Type" when called](https://discourse.processing.org/t/custom-error-throwing-unhandled-exception-type-when-called/15152)

<div class="topic-metadata">

**Author:** [@dragon\_hatcher](https://discourse.processing.org/u/dragon_hatcher)\
**Replies:** 1\
**Last updated:** [November 2, 2019, 4:20pm UTC](https://discourse.processing.org/t/custom-error-throwing-unhandled-exception-type-when-called/15152 "2019-11-02T16:20:45Z")

</div>

What am I doing wrong? Here is my code: void setup() { size(100, 100); throw new customException("test"); } class customException extends Exception{ customException(String message){ super(message); }…

---

## [Memory Game Code](https://discourse.processing.org/t/memory-game-code/15097)

<div class="topic-metadata">

**Author:** [@San](https://discourse.processing.org/u/San)\
**Replies:** 8\
**Last updated:** [November 1, 2019, 8:17pm UTC](https://discourse.processing.org/t/memory-game-code/15097 "2019-11-01T20:17:52Z")

</div>

Im not so good with Processing. But I’m trying to make the Memory game. so far this is what I got: I can print 6 sets of cards. (12 cards in total) I have to match color with color. But I have been thinking all day and…

---

## [Game, hitbox (if condition) ignored for number of loops](https://discourse.processing.org/t/game-hitbox-if-condition-ignored-for-number-of-loops/15133)

<div class="topic-metadata">

**Author:** [@D.Signer](https://discourse.processing.org/u/D.Signer)\
**Replies:** 2\
**Last updated:** [November 2, 2019, 10:24am UTC](https://discourse.processing.org/t/game-hitbox-if-condition-ignored-for-number-of-loops/15133 "2019-11-02T10:24:43Z")

</div>

While running the code, it spawns 6 targets in front of you when you press right mousebutton. You move the 3d camera towards the objects, and if one is within a certain distance of the camera position on the x axis, you …

---

## [Changing Boolean to Int in a custom function](https://discourse.processing.org/t/changing-boolean-to-int-in-a-custom-function/15140)

<div class="topic-metadata">

**Author:** [@nathanchun](https://discourse.processing.org/u/nathanchun)\
**Replies:** 2\
**Last updated:** [November 2, 2019, 9:53am UTC](https://discourse.processing.org/t/changing-boolean-to-int-in-a-custom-function/15140 "2019-11-02T09:53:46Z")

</div>

Hi! I am trying to create a bunch of random circles to appear and then bounce around the edges of the screen. I got everything I wanted so far except the “checkEdge” function. I keep getting the error that says “The oper…

---

## [On private keyword](https://discourse.processing.org/t/on-private-keyword/15139)

<div class="topic-metadata">

**Author:** [@plux](https://discourse.processing.org/u/plux)\
**Replies:** 3\
**Last updated:** [November 2, 2019, 9:24am UTC](https://discourse.processing.org/t/on-private-keyword/15139 "2019-11-02T09:24:38Z")

</div>

Hello, maybe I’m getting confused but I was expecting for this print line to return an error since I’m trying to access a private field (age) from outside its class (Parent)? Thanks class Parent{ private int age; …

---

## [SuperShape formula working abruptly in processing](https://discourse.processing.org/t/supershape-formula-working-abruptly-in-processing/15104)

<div class="topic-metadata">

**Author:** [@Ruchi](https://discourse.processing.org/u/Ruchi)\
**Replies:** 10\
**Last updated:** [November 2, 2019, 6:43am UTC](https://discourse.processing.org/t/supershape-formula-working-abruptly-in-processing/15104 "2019-11-02T06:43:21Z")

</div>

float n1, n2, n3; float m; float a, b; float r; float total; float increment; void setup() { size(900, 900); n1 = 60; n2 = 55; n3 = 30; m = 7; a=b=2; total=700; increment=TWO\_PI/total; } float s…

---

## [Shape has weird behavior with 4 parameters](https://discourse.processing.org/t/shape-has-weird-behavior-with-4-parameters/15129)

<div class="topic-metadata">

**Author:** [@Dregni](https://discourse.processing.org/u/Dregni)\
**Replies:** 1\
**Last updated:** [November 2, 2019, 1:07am UTC](https://discourse.processing.org/t/shape-has-weird-behavior-with-4-parameters/15129 "2019-11-02T01:07:07Z")

</div>

Hoï ! So I was trying to have a generic body class so it could represent the body of all my objects for some simulation but then this happened : void display() { shapeMode(CENTER); shape(body, 50, 50, 100, …

---

## [P3D hint() with 2D depth sort not working](https://discourse.processing.org/t/p3d-hint-with-2d-depth-sort-not-working/15080)

<div class="topic-metadata">

**Author:** [@GeorgeJava](https://discourse.processing.org/u/GeorgeJava)\
**Replies:** 1\
**Last updated:** [November 1, 2019, 8:19pm UTC](https://discourse.processing.org/t/p3d-hint-with-2d-depth-sort-not-working/15080 "2019-11-01T20:19:40Z")

</div>

Hello i want to create layer system and i cant ENABLE\_DEPTH\_SORT in a hint… Its resizing… yeah one of two objects gets before and after when i moving mouse, but i want to make it without sizing… :confused: can you help …

---

## [PVectors - Help new beginner follow](https://discourse.processing.org/t/pvectors-help-new-beginner-follow/15122)

<div class="topic-metadata">

**Author:** [@FilDomInteractive](https://discourse.processing.org/u/FilDomInteractive)\
**Replies:** 2\
**Last updated:** [November 1, 2019, 4:39pm UTC](https://discourse.processing.org/t/pvectors-help-new-beginner-follow/15122 "2019-11-01T16:39:24Z")

</div>

need help, how can a rectangle (or something) follow a next rectangle that is at different position?

---

## [Help shoot ellipse beginner complete new](https://discourse.processing.org/t/help-shoot-ellipse-beginner-complete-new/15121)

<div class="topic-metadata">

**Author:** [@FilDomInteractive](https://discourse.processing.org/u/FilDomInteractive)\
**Replies:** 2\
**Last updated:** [November 1, 2019, 4:36pm UTC](https://discourse.processing.org/t/help-shoot-ellipse-beginner-complete-new/15121 "2019-11-01T16:36:48Z")

</div>

How can I shoot ellipses? Example \> https://youtu.be/v1kqMxsvElM?t=514

---

## [Zigzag path through 2D array](https://discourse.processing.org/t/zigzag-path-through-2d-array/15093)

<div class="topic-metadata">

**Author:** [@dangerousclive](https://discourse.processing.org/u/dangerousclive)\
**Replies:** 2\
**Last updated:** [November 1, 2019, 12:03pm UTC](https://discourse.processing.org/t/zigzag-path-through-2d-array/15093 "2019-11-01T12:03:32Z")

</div>

Hi, I’m attempting to reorder a 2D array to follow a zigzag path. This image illustrates the path I wish to follow: https://en.wikipedia.org/wiki/JPEG#/media/File:JPEG\_ZigZag.svg I’m having a bit of a problem moving b…

---

## [Solution for repeating keyPressed while holding key](https://discourse.processing.org/t/solution-for-repeating-keypressed-while-holding-key/3989)

<div class="topic-metadata">

**Author:** [@tutantontut](https://discourse.processing.org/u/tutantontut)\
**Replies:** 10\
**Last updated:** [November 1, 2019, 11:39am UTC](https://discourse.processing.org/t/solution-for-repeating-keypressed-while-holding-key/3989 "2019-11-01T11:39:00Z")

</div>

I came up with a solution for a problem I’ve encountered regarding inputs. The problem: When you hold down a key, at least on my computer it registers as if you were repeatedly pressing that key very fast. In some case…

---

## [I need a working scoreboard!](https://discourse.processing.org/t/i-need-a-working-scoreboard/15100)

<div class="topic-metadata">

**Author:** [@Fluxy](https://discourse.processing.org/u/Fluxy)\
**Replies:** 8\
**Last updated:** [November 1, 2019, 10:42am UTC](https://discourse.processing.org/t/i-need-a-working-scoreboard/15100 "2019-11-01T10:42:46Z")

</div>

Hey there! I am busy with a schoolproject, but I can’t figure out how to configure the scoreboard. There is a grid with yellow rects. These are points and there is a purple rect that is the player. Don’t mind the red re…

---

## [I need random circles and rectangles in a grid, Stuck in a problem I can't solve!](https://discourse.processing.org/t/i-need-random-circles-and-rectangles-in-a-grid-stuck-in-a-problem-i-cant-solve/15061)

<div class="topic-metadata">

**Author:** [@Fluxy](https://discourse.processing.org/u/Fluxy)\
**Replies:** 10\
**Last updated:** [November 1, 2019, 9:36am UTC](https://discourse.processing.org/t/i-need-random-circles-and-rectangles-in-a-grid-stuck-in-a-problem-i-cant-solve/15061 "2019-11-01T09:36:53Z")

</div>

This is a big problem for me because I don’t know how to do it. I’ve got a small code, but the most important is that i have a grid. this grid is 60x40 and in this grid need to be random circles and rectangles about 10 o…

---

## [How do I make a random array interactive?](https://discourse.processing.org/t/how-do-i-make-a-random-array-interactive/15086)

<div class="topic-metadata">

**Author:** [@brandy22](https://discourse.processing.org/u/brandy22)\
**Replies:** 12\
**Last updated:** [November 1, 2019, 8:41am UTC](https://discourse.processing.org/t/how-do-i-make-a-random-array-interactive/15086 "2019-11-01T08:41:02Z")

</div>

I want to make random numbers in an array interactive. int\[\] numbers = new int\[500\]; void setup() { size(500, 500); for (int i = 0; i\< 450; i++) { numbers\[i\] = (int)random(0, 450); } } void draw() { backg…

---

## [Make text that is drawn, editable](https://discourse.processing.org/t/make-text-that-is-drawn-editable/15091)

<div class="topic-metadata">

**Author:** [@cp796](https://discourse.processing.org/u/cp796)\
**Replies:** 3\
**Last updated:** [November 1, 2019, 3:24am UTC](https://discourse.processing.org/t/make-text-that-is-drawn-editable/15091 "2019-11-01T03:24:04Z")

</div>

So I got the colour wheel from cp5 library, and achieved to display the hexcode with text everytime the colour is changed. This is the code which make the hex code display: // “C” is the colour on the colour wheel, so …

---

## [Random pairs from an arrayList](https://discourse.processing.org/t/random-pairs-from-an-arraylist/15088)

<div class="topic-metadata">

**Author:** [@jeykech](https://discourse.processing.org/u/jeykech)\
**Replies:** 5\
**Last updated:** [October 31, 2019, 9:54pm UTC](https://discourse.processing.org/t/random-pairs-from-an-arraylist/15088 "2019-10-31T21:54:40Z")

</div>

hi all, I am a little bit stuck with this simple problem; I have an arrayList of let’s say PVectors and I would like to draw random lines between two different points.( or have any other connection rule ), the number of…

---

## [Random values from array](https://discourse.processing.org/t/random-values-from-array/15084)

<div class="topic-metadata">

**Author:** [@San](https://discourse.processing.org/u/San)\
**Replies:** 1\
**Last updated:** [October 31, 2019, 7:44pm UTC](https://discourse.processing.org/t/random-values-from-array/15084 "2019-10-31T19:44:08Z")

</div>

I want to select random values from this array. But if I run it, it sometimes has the same number in it twice. I want to have each number just one time but in a different order everytime I run it. image|690x188

---

## [How do I center a rect in a grid?](https://discourse.processing.org/t/how-do-i-center-a-rect-in-a-grid/15074)

<div class="topic-metadata">

**Author:** [@RubenF](https://discourse.processing.org/u/RubenF)\
**Replies:** 6\
**Last updated:** [October 31, 2019, 4:39pm UTC](https://discourse.processing.org/t/how-do-i-center-a-rect-in-a-grid/15074 "2019-10-31T16:39:09Z")

</div>

I’m making a snake game, where the user has to click at a position in the grid for it to move there. The problem is, how do I make this rect align in the center of the grid? Here’s my code: float mousePosX=100, mousePo…

---

## [Vanishing objects when using ortho()](https://discourse.processing.org/t/vanishing-objects-when-using-ortho/15056)

<div class="topic-metadata">

**Author:** [@pheelia](https://discourse.processing.org/u/pheelia)\
**Replies:** 2\
**Last updated:** [October 31, 2019, 3:46pm UTC](https://discourse.processing.org/t/vanishing-objects-when-using-ortho/15056 "2019-10-31T15:46:48Z")

</div>

Hey everyone, I’m creating a sketch using orthographic perspective and I get strange effects here. If I run the code the white rectangles in the background can’t be seen through the gaps left between the black ones. On…

---

## [Knife Movemement](https://discourse.processing.org/t/knife-movemement/15004)

<div class="topic-metadata">

**Author:** [@beornten](https://discourse.processing.org/u/beornten)\
**Replies:** 3\
**Last updated:** [October 31, 2019, 1:47pm UTC](https://discourse.processing.org/t/knife-movemement/15004 "2019-10-31T13:47:35Z")

</div>

Ok so basically i want a knife to o down like 600 px, and if its there go back. But i want it to look smooth and that other things dont freeze while the knife goes down. Thats. (btw the comments are german) My Code: //m…

---

## [Matching memory Game](https://discourse.processing.org/t/matching-memory-game/15076)

<div class="topic-metadata">

**Author:** [@filmon](https://discourse.processing.org/u/filmon)\
**Replies:** 1\
**Last updated:** [October 31, 2019, 1:25pm UTC](https://discourse.processing.org/t/matching-memory-game/15076 "2019-10-31T13:25:12Z")

</div>

i want two players but i dont know how it works

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

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