# Processing

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

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

**Page:** 341

---

## [Should negative width in image produce mirroring?](https://discourse.processing.org/t/should-negative-width-in-image-produce-mirroring/6366)

<div class="topic-metadata">

**Author:** [@hamoid](https://discourse.processing.org/u/hamoid)\
**Replies:** 9\
**Last updated:** [December 7, 2018, 3:43pm UTC](https://discourse.processing.org/t/should-negative-width-in-image-produce-mirroring/6366 "2018-12-07T15:43:03Z")

</div>

I wonder if this is a bug… PGraphics canvas; void setup() { size(600, 600); // P2D make no difference canvas = createGraphics(width, height); } void draw() { background(255); canvas.beginDraw(); canvas.clear(…

---

## [Processing SpaceInvaders-Game](https://discourse.processing.org/t/processing-spaceinvaders-game/6126)

<div class="topic-metadata">

**Author:** [@ProcessingHelp](https://discourse.processing.org/u/ProcessingHelp)\
**Replies:** 2\
**Last updated:** [December 7, 2018, 2:53pm UTC](https://discourse.processing.org/t/processing-spaceinvaders-game/6126 "2018-12-07T14:53:38Z")

</div>

Delete this post.

---

## [Xml verification](https://discourse.processing.org/t/xml-verification/6253)

<div class="topic-metadata">

**Author:** [@matheplica](https://discourse.processing.org/u/matheplica)\
**Replies:** 2\
**Last updated:** [December 7, 2018, 1:51pm UTC](https://discourse.processing.org/t/xml-verification/6253 "2018-12-07T13:51:32Z")

</div>

Hi, I’m trying to load a xml file only if he’s correct (no tags errors) I’have try this void checkXml(String fileName) { try { data = loadXML(fileName); } catch(Exception e) { print(e); } } I put just …

---

## [Good practice for sending data from Arduino to Processing](https://discourse.processing.org/t/good-practice-for-sending-data-from-arduino-to-processing/6339)

<div class="topic-metadata">

**Author:** [@rodrigogamboa](https://discourse.processing.org/u/rodrigogamboa)\
**Replies:** 4\
**Last updated:** [December 6, 2018, 4:51pm UTC](https://discourse.processing.org/t/good-practice-for-sending-data-from-arduino-to-processing/6339 "2018-12-06T16:51:05Z")

</div>

Hi! This is the first question I make in the forum! Is in the context of good practices sending data from Arduino to Processing, and vice versa. Recenlty I made a VJ console that sends data from some potentiometers and…

---

## [Shader version error on mac](https://discourse.processing.org/t/shader-version-error-on-mac/6155)

<div class="topic-metadata">

**Author:** [@kosowski](https://discourse.processing.org/u/kosowski)\
**Replies:** 10\
**Last updated:** [December 7, 2018, 9:32am UTC](https://discourse.processing.org/t/shader-version-error-on-mac/6155 "2018-12-07T09:32:32Z")

</div>

Hi! What glsl version should I use on a shader for mac? I am working on a library thats uses a shader, works ok on Windows, but has compile errors on mac(tried El Capitan and High Sierra). A #version directive is requ…

---

## [I'm working with Kinect and need some guidance for skeleton interaction](https://discourse.processing.org/t/im-working-with-kinect-and-need-some-guidance-for-skeleton-interaction/6310)

<div class="topic-metadata">

**Author:** [@Brave33](https://discourse.processing.org/u/Brave33)\
**Replies:** 1\
**Last updated:** [December 7, 2018, 7:06am UTC](https://discourse.processing.org/t/im-working-with-kinect-and-need-some-guidance-for-skeleton-interaction/6310 "2018-12-07T07:06:07Z")

</div>

Hello everyone this is my first post so sorry if i make a mistake with the rules in general. First i’d like to explain my code, it’s a simple code to read skeleton with Kinect and add an image to the HEAD, i’d like to m…

---

## [Sound Mapping problem](https://discourse.processing.org/t/sound-mapping-problem/6154)

<div class="topic-metadata">

**Author:** [@Al3e](https://discourse.processing.org/u/Al3e)\
**Replies:** 6\
**Last updated:** [December 7, 2018, 1:09am UTC](https://discourse.processing.org/t/sound-mapping-problem/6154 "2018-12-07T01:09:05Z")

</div>

hello i have this code to visualize the songs according the frequency: import ddf.minim.\*; // minim library import processing.pdf.\*; // pdf export library import java.util.Calendar; // java timestamp Minim minim; // in…

---

## [The button code will not run with the rest of the code](https://discourse.processing.org/t/the-button-code-will-not-run-with-the-rest-of-the-code/6308)

<div class="topic-metadata">

**Author:** [@starkid](https://discourse.processing.org/u/starkid)\
**Replies:** 1\
**Last updated:** [December 7, 2018, 12:58am UTC](https://discourse.processing.org/t/the-button-code-will-not-run-with-the-rest-of-the-code/6308 "2018-12-07T00:58:55Z")

</div>

I’m trying to run the first 2 sections of code with the last section. The last section is a button, I tried rearranging everything and am still have trouble getting it to run. Please help in any way. //minim is the audi…

---

## [FTP: create new text file & save fileContent](https://discourse.processing.org/t/ftp-create-new-text-file-save-filecontent/6250)

<div class="topic-metadata">

**Author:** [@wieb](https://discourse.processing.org/u/wieb)\
**Replies:** 1\
**Last updated:** [December 7, 2018, 12:55am UTC](https://discourse.processing.org/t/ftp-create-new-text-file-save-filecontent/6250 "2018-12-07T00:55:45Z")

</div>

Hi everyone, Is it possible creating a new text file (which contains some string) on the fly then save it to FTP server with Processing? string fileContent = "test 12345 test 12345 test 12345 test 12345"; char fileName…

---

## [Hue with specific colors](https://discourse.processing.org/t/hue-with-specific-colors/6297)

<div class="topic-metadata">

**Author:** [@Missmew72](https://discourse.processing.org/u/Missmew72)\
**Replies:** 5\
**Last updated:** [December 7, 2018, 12:50am UTC](https://discourse.processing.org/t/hue-with-specific-colors/6297 "2018-12-07T00:50:30Z")

</div>

Hi, so I’m working on a school project and basically I want the option for hue in the background. I am able to get a horizontal hue with all the colours, but I was hoping to do a vertical hue with a specific set of colou…

---

## [ArrayList causing an IndexOutOfBoundsException](https://discourse.processing.org/t/arraylist-causing-an-indexoutofboundsexception/6247)

<div class="topic-metadata">

**Author:** [@CyberneticSquid](https://discourse.processing.org/u/CyberneticSquid)\
**Replies:** 2\
**Last updated:** [December 7, 2018, 12:09am UTC](https://discourse.processing.org/t/arraylist-causing-an-indexoutofboundsexception/6247 "2018-12-07T00:09:35Z")

</div>

I’m making a basic “Life” game, where larger circles eat smaller ones, and I keep getting a seemingly random IndexOutOfBoundsException. This is the section of code that causes the error: for (int i = beings.size() - …

---

## [Generating a live Jpeg from random numbers](https://discourse.processing.org/t/generating-a-live-jpeg-from-random-numbers/6066)

<div class="topic-metadata">

**Author:** [@glegassick](https://discourse.processing.org/u/glegassick)\
**Replies:** 5\
**Last updated:** [December 6, 2018, 10:17pm UTC](https://discourse.processing.org/t/generating-a-live-jpeg-from-random-numbers/6066 "2018-12-06T22:17:32Z")

</div>

Hi, I am new to the community and new to Processing and have a project in mind that I would like to tackle in order to learn. I would like to generate a “live” jpeg image from random number inputs. I am aware that the …

---

## [Trying to find the easiest way to export custom maps](https://discourse.processing.org/t/trying-to-find-the-easiest-way-to-export-custom-maps/6329)

<div class="topic-metadata">

**Author:** [@quorumetrix](https://discourse.processing.org/u/quorumetrix)\
**Replies:** 4\
**Last updated:** [December 6, 2018, 9:45pm UTC](https://discourse.processing.org/t/trying-to-find-the-easiest-way-to-export-custom-maps/6329 "2018-12-06T21:45:22Z")

</div>

Hi all, Long-time Processing user, but new to the forum. I’m wondering if someone can give me a suggestion of the best way to accomplish this. I am visualizing a series of GPS coordinates, spanning a large part of the…

---

## [Setting limit of random colours](https://discourse.processing.org/t/setting-limit-of-random-colours/6051)

<div class="topic-metadata">

**Author:** [@CowPieForever](https://discourse.processing.org/u/CowPieForever)\
**Replies:** 5\
**Last updated:** [December 6, 2018, 8:21pm UTC](https://discourse.processing.org/t/setting-limit-of-random-colours/6051 "2018-12-06T20:21:07Z")

</div>

So I have written that, when drawing a shape, the stroke and fill are random colours: stroke(random(255),random(255),random(255)); fill(random(255),random(255),random(255)); So if I wanted to set the colours to be rand…

---

## [Assign a Value to Every Element in an Array?](https://discourse.processing.org/t/assign-a-value-to-every-element-in-an-array/6381)

<div class="topic-metadata">

**Author:** [@Fixinit1](https://discourse.processing.org/u/Fixinit1)\
**Replies:** 3\
**Last updated:** [December 6, 2018, 7:51pm UTC](https://discourse.processing.org/t/assign-a-value-to-every-element-in-an-array/6381 "2018-12-06T19:51:58Z")

</div>

Can someone tell me how I could assign a value to every element in an array with a single line of code? Is it even possible? Right now i have this, yposi\[0\] = 0; yposi\[1\] = 0; yposi\[2\] = 0; yposi\[3\] = 0; yposi\[4\] = …

---

## [Multiple draggable images (drags once and locks)](https://discourse.processing.org/t/multiple-draggable-images-drags-once-and-locks/6001)

<div class="topic-metadata">

**Author:** [@HelaRua](https://discourse.processing.org/u/HelaRua)\
**Replies:** 6\
**Last updated:** [December 6, 2018, 5:20pm UTC](https://discourse.processing.org/t/multiple-draggable-images-drags-once-and-locks/6001 "2018-12-06T17:20:53Z")

</div>

Hello! I’ve got many images—over 30—and want to drag each one of them independently across the canvas. Once you move one of the images, by releasing it becomes locked at current mouseX and Y coordinates and can’t be mov…

---

## [Help on adding Color Collision to my game](https://discourse.processing.org/t/help-on-adding-color-collision-to-my-game/6358)

<div class="topic-metadata">

**Author:** [@Catbreath1](https://discourse.processing.org/u/Catbreath1)\
**Replies:** 2\
**Last updated:** [December 6, 2018, 2:49pm UTC](https://discourse.processing.org/t/help-on-adding-color-collision-to-my-game/6358 "2018-12-06T14:49:35Z")

</div>

Hey, so I am somewhat new to coding, and I have began to create a game out of what I knew. The game is pretty much like the Chrome dino jump game, but simplified for now as I make the base code. So far, I have all I need…

---

## [Mirror effect by mouse movement](https://discourse.processing.org/t/mirror-effect-by-mouse-movement/6363)

<div class="topic-metadata">

**Author:** [@AnisZo](https://discourse.processing.org/u/AnisZo)\
**Replies:** 3\
**Last updated:** [December 6, 2018, 1:51pm UTC](https://discourse.processing.org/t/mirror-effect-by-mouse-movement/6363 "2018-12-06T13:51:30Z")

</div>

Hi, guys, I have a question how can I mirror my mouse event? At the moment I have a growing lightningbolt while moving my mouse and I need it mirrored now. Here is the code int width = 250; int height = 250; //angl…

---

## [How to dynamically resize GTextField?](https://discourse.processing.org/t/how-to-dynamically-resize-gtextfield/6353)

<div class="topic-metadata">

**Author:** [@notcatfish2017](https://discourse.processing.org/u/notcatfish2017)\
**Replies:** 1\
**Last updated:** [December 6, 2018, 12:24pm UTC](https://discourse.processing.org/t/how-to-dynamically-resize-gtextfield/6353 "2018-12-06T12:24:44Z")

</div>

Hi, I’m using the G4P library and I’m trying to create a text field that will automatically resize when the user enters more and more text. However, I am unable to find a setWidth() method, is there any other way that I…

---

## [How do I make a ball continuously bounce on one platform?](https://discourse.processing.org/t/how-do-i-make-a-ball-continuously-bounce-on-one-platform/6355)

<div class="topic-metadata">

**Author:** [@irukandjijelly](https://discourse.processing.org/u/irukandjijelly)\
**Replies:** 2\
**Last updated:** [December 6, 2018, 9:45am UTC](https://discourse.processing.org/t/how-do-i-make-a-ball-continuously-bounce-on-one-platform/6355 "2018-12-06T09:45:13Z")

</div>

This is my code. What can I do to make the ball up and down on one platform. Right now when the right key is pressed, it goes straight up. int y=770; int back=20; int dir=20; int level=3; void setup(){ size(700,80…

---

## [Help with creating the correct functions for my ATM](https://discourse.processing.org/t/help-with-creating-the-correct-functions-for-my-atm/6337)

<div class="topic-metadata">

**Author:** [@Sventhepuffin](https://discourse.processing.org/u/Sventhepuffin)\
**Replies:** 9\
**Last updated:** [December 6, 2018, 7:08am UTC](https://discourse.processing.org/t/help-with-creating-the-correct-functions-for-my-atm/6337 "2018-12-06T07:08:06Z")

</div>

I know it is sloppy or most likely not done correct, i’m not very good at this but i’m still trying. I have been able to assign each numbered button to display its corresponding number but when it comes to creating the f…

---

## [Parallel Array for ripple effect/rain drop](https://discourse.processing.org/t/parallel-array-for-ripple-effect-rain-drop/6268)

<div class="topic-metadata">

**Author:** [@James](https://discourse.processing.org/u/James)\
**Replies:** 1\
**Last updated:** [December 5, 2018, 9:13pm UTC](https://discourse.processing.org/t/parallel-array-for-ripple-effect-rain-drop/6268 "2018-12-05T21:13:55Z")

</div>

Hello guys and gals, I’m trying to make something really weird and kinda stupid (ripple effect/rain drop effect). I’m trying to make a partial full array that can hold up to 1000 x & y cords pair. For me to do that I wi…

---

## [Connecting Xbee and processing and reading remote data](https://discourse.processing.org/t/connecting-xbee-and-processing-and-reading-remote-data/6349)

<div class="topic-metadata">

**Author:** [@stevenette](https://discourse.processing.org/u/stevenette)\
**Replies:** 0\
**Last updated:** [December 5, 2018, 9:05pm UTC](https://discourse.processing.org/t/connecting-xbee-and-processing-and-reading-remote-data/6349 "2018-12-05T21:05:55Z")

</div>

Hello, I am currently using processing, hooked up to a arduino Uno with an Xbee shield and an Xbee to top it all off. This setup is reading a mesh network of other xbee radios out there, and processing the data. What I …

---

## [Help with interfaces](https://discourse.processing.org/t/help-with-interfaces/6272)

<div class="topic-metadata">

**Author:** [@dcravens](https://discourse.processing.org/u/dcravens)\
**Replies:** 1\
**Last updated:** [December 5, 2018, 9:00pm UTC](https://discourse.processing.org/t/help-with-interfaces/6272 "2018-12-05T21:00:13Z")

</div>

I am a beginning coder trying to understand the best way to organize my code using inheritance, composition, and interfaces in a program that models a simple ecosystem. I apologize in advance for not knowing how word m…

---

## [Trying to use modelX() but built a spiral galaxy of points](https://discourse.processing.org/t/trying-to-use-modelx-but-built-a-spiral-galaxy-of-points/6064)

<div class="topic-metadata">

**Author:** [@HackinHarry](https://discourse.processing.org/u/HackinHarry)\
**Replies:** 26\
**Last updated:** [December 5, 2018, 6:18pm UTC](https://discourse.processing.org/t/trying-to-use-modelx-but-built-a-spiral-galaxy-of-points/6064 "2018-12-05T18:18:16Z")

</div>

I’m trying to use modelX() and modelY() to capture transformed coordinate values of a shape. I’ve cut the code down from 600 lines to 200 some by using processing’s built in functions rather than struggle with writing …

---

## [Trouble with variable as text on screen](https://discourse.processing.org/t/trouble-with-variable-as-text-on-screen/6333)

<div class="topic-metadata">

**Author:** [@Banansplitt](https://discourse.processing.org/u/Banansplitt)\
**Replies:** 1\
**Last updated:** [December 5, 2018, 5:36pm UTC](https://discourse.processing.org/t/trouble-with-variable-as-text-on-screen/6333 "2018-12-05T17:36:05Z")

</div>

I am showing text in a window but instead of showing my number it just shows “Humidity: null%” Here is my code: import processing.serial.\*; Serial myPort; // Create object from Serial class String val; // Data re…

---

## [Help needed with Leap Motion and live capture](https://discourse.processing.org/t/help-needed-with-leap-motion-and-live-capture/6323)

<div class="topic-metadata">

**Author:** [@saskia\_NL](https://discourse.processing.org/u/saskia_NL)\
**Replies:** 0\
**Last updated:** [December 5, 2018, 11:30am UTC](https://discourse.processing.org/t/help-needed-with-leap-motion-and-live-capture/6323 "2018-12-05T11:30:21Z")

</div>

Hi all! Can someone help me with this code? I’m trying to use the Leap Motion control the movement of the “scan beam” on the screen. It works when I use the mouseX as a input, but now I want it to use te X position from…

---

## [Trying to get animation to stop](https://discourse.processing.org/t/trying-to-get-animation-to-stop/6282)

<div class="topic-metadata">

**Author:** [@charmypatel](https://discourse.processing.org/u/charmypatel)\
**Replies:** 11\
**Last updated:** [December 5, 2018, 12:21pm UTC](https://discourse.processing.org/t/trying-to-get-animation-to-stop/6282 "2018-12-05T12:21:48Z")

</div>

have two tabs here, one is the sketch and the other is Star. I’m trying to have the starfield in the background to only be there half way into the song. After the songs are played halfway, I want to have a different anim…

---

## [How to distribuite a value unequally?](https://discourse.processing.org/t/how-to-distribuite-a-value-unequally/6104)

<div class="topic-metadata">

**Author:** [@Lexyth](https://discourse.processing.org/u/Lexyth)\
**Replies:** 18\
**Last updated:** [December 5, 2018, 12:08pm UTC](https://discourse.processing.org/t/how-to-distribuite-a-value-unequally/6104 "2018-12-05T12:08:01Z")

</div>

Hey, so distributing a value equally is just 50/5 = 5 Times a 10 value, But i Would Need a result of something like {15, 5, 20, 7, 3}. Now, i technically know how to do this in Code, But it‘s not very efficient, so i was…

---

## [Last click and keeping the image](https://discourse.processing.org/t/last-click-and-keeping-the-image/6317)

<div class="topic-metadata">

**Author:** [@Missmew72](https://discourse.processing.org/u/Missmew72)\
**Replies:** 6\
**Last updated:** [December 5, 2018, 11:27am UTC](https://discourse.processing.org/t/last-click-and-keeping-the-image/6317 "2018-12-05T11:27:49Z")

</div>

So I have a series of clicks setup, each click replaces the last image with the next one. When I get to the last image, I want it to stay even if there is an accidental click afterwards. Is there a way to do this?

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

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