# Processing

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

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

**Page:** 246

---

## [keyPressed is behaving very oddly](https://discourse.processing.org/t/keypressed-is-behaving-very-oddly/16865)

<div class="topic-metadata">

**Author:** [@Psteely](https://discourse.processing.org/u/Psteely)\
**Replies:** 3\
**Last updated:** [January 4, 2020, 9:00pm UTC](https://discourse.processing.org/t/keypressed-is-behaving-very-oddly/16865 "2020-01-04T21:00:00Z")

</div>

This is going to be something dumb but… I have a code snipet showing my issue. int currentRow; void setup() { } void draw() { } void keyPressed() { currentRow = key; println(key); println(currentRow); } If I r…

---

## [Save command in void?](https://discourse.processing.org/t/save-command-in-void/16863)

<div class="topic-metadata">

**Author:** [@Optyfen\_met\_Eenden](https://discourse.processing.org/u/Optyfen_met_Eenden)\
**Replies:** 4\
**Last updated:** [January 4, 2020, 7:03pm UTC](https://discourse.processing.org/t/save-command-in-void/16863 "2020-01-04T19:03:50Z")

</div>

Hi! I’m new to Processing and also to this forum. I got some trouble with the void command; I couldn’t use a save(""); in a void. See an example below, when I execute it, it will say “ArrayIndexOutOfBoundsException: Coo…

---

## [Triggering video clips with buttons](https://discourse.processing.org/t/triggering-video-clips-with-buttons/16836)

<div class="topic-metadata">

**Author:** [@marianne91](https://discourse.processing.org/u/marianne91)\
**Replies:** 3\
**Last updated:** [January 4, 2020, 5:48pm UTC](https://discourse.processing.org/t/triggering-video-clips-with-buttons/16836 "2020-01-04T17:48:08Z")

</div>

Hi there, Am working on a project in which I would like to trigger the playing of video clips via buttons. I’m able to trigger sound samples via buttons but haven’t been able to with video. Any ideas?

---

## [Sketch does not always have focus on start up](https://discourse.processing.org/t/sketch-does-not-always-have-focus-on-start-up/16834)

<div class="topic-metadata">

**Author:** [@rhole](https://discourse.processing.org/u/rhole)\
**Replies:** 6\
**Last updated:** [January 4, 2020, 3:57pm UTC](https://discourse.processing.org/t/sketch-does-not-always-have-focus-on-start-up/16834 "2020-01-04T15:57:18Z")

</div>

I have a sketch which frequently does not gain focus at start-up. I was able to solve this: boolean \_focusConfirmed= false; void draw(){ // ensure focus comes to this sketch on start-up if (millis() \< 20000 && !\_focu…

---

## [Creating a moving snake on a predefined grid](https://discourse.processing.org/t/creating-a-moving-snake-on-a-predefined-grid/16854)

<div class="topic-metadata">

**Author:** [@Reynaert98](https://discourse.processing.org/u/Reynaert98)\
**Replies:** 2\
**Last updated:** [January 4, 2020, 11:30am UTC](https://discourse.processing.org/t/creating-a-moving-snake-on-a-predefined-grid/16854 "2020-01-04T11:30:04Z")

</div>

I’m working on a game on which a snake/ centipede can move on a grid by mouseclicking on grid spaces next to it. Its body consists of 10 pieces which all follow the previous locations of its head. My question is, where d…

---

## [Processing + egpu (OSX)](https://discourse.processing.org/t/processing-egpu-osx/16733)

<div class="topic-metadata">

**Author:** [@Garz](https://discourse.processing.org/u/Garz)\
**Replies:** 7\
**Last updated:** [January 4, 2020, 11:17am UTC](https://discourse.processing.org/t/processing-egpu-osx/16733 "2020-01-04T11:17:35Z")

</div>

Hi! This is my first post. I´m very exited to learn Processing to make visuals. I have a 2018 MacMini and a Razor CoreX with an Vega 64 as an eGpu. I tried the particles example and the performance is very low. Also i ge…

---

## [Regarding opencv](https://discourse.processing.org/t/regarding-opencv/14256)

<div class="topic-metadata">

**Author:** [@maddyna](https://discourse.processing.org/u/maddyna)\
**Replies:** 2\
**Last updated:** [January 4, 2020, 7:34am UTC](https://discourse.processing.org/t/regarding-opencv/14256 "2020-01-04T07:34:24Z")

</div>

Can somebody suggest me a good place where the various objects documented in opencv are discussed with certain clarity Thanks

---

## [Video Library Release 6 (version 2.0-beta4)](https://discourse.processing.org/t/video-library-release-6-version-2-0-beta4/16784)

<div class="topic-metadata">

**Author:** [@f42ter](https://discourse.processing.org/u/f42ter)\
**Replies:** 2\
**Last updated:** [January 4, 2020, 7:27am UTC](https://discourse.processing.org/t/video-library-release-6-version-2-0-beta4/16784 "2020-01-04T07:27:40Z")

</div>

Is udpsrc supported by Video Library Release 6 (version 2.0-beta4) or any plans to support this as a source.

---

## [Where can I find rules for different cellular automata?](https://discourse.processing.org/t/where-can-i-find-rules-for-different-cellular-automata/16827)

<div class="topic-metadata">

**Author:** [@Ruchi](https://discourse.processing.org/u/Ruchi)\
**Replies:** 3\
**Last updated:** [January 4, 2020, 5:23am UTC](https://discourse.processing.org/t/where-can-i-find-rules-for-different-cellular-automata/16827 "2020-01-04T05:23:26Z")

</div>

https://www.conwaylife.com/wiki/List\_of\_Life-like\_cellular\_automata This site mentions list of various cellular automata. But no description further of the rules. Any reference as to where I can find the rules?

---

## [Move background](https://discourse.processing.org/t/move-background/16818)

<div class="topic-metadata">

**Author:** [@nati1704](https://discourse.processing.org/u/nati1704)\
**Replies:** 3\
**Last updated:** [January 4, 2020, 4:09am UTC](https://discourse.processing.org/t/move-background/16818 "2020-01-04T04:09:15Z")

</div>

Hi I try to make a little game where the background has to move. I´ve made an own background with photohop beforehand, which has a larger width than the sketch. Now I wanted to know HOW can I insert an photo,which has…

---

## [PImage alpha color problems P2D](https://discourse.processing.org/t/pimage-alpha-color-problems-p2d/16648)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 3\
**Last updated:** [January 3, 2020, 11:40pm UTC](https://discourse.processing.org/t/pimage-alpha-color-problems-p2d/16648 "2020-01-03T23:40:34Z")

</div>

There is a problem amending the alpha channel in pixel arrays in P2D, under FX2D alpha can be adjusted like so however the same code in P2D.

---

## [Controlp5 - error java.lang.NullPointerException](https://discourse.processing.org/t/controlp5-error-java-lang-nullpointerexception/16808)

<div class="topic-metadata">

**Author:** [@nikodemd](https://discourse.processing.org/u/nikodemd)\
**Replies:** 2\
**Last updated:** [January 3, 2020, 9:38am UTC](https://discourse.processing.org/t/controlp5-error-java-lang-nullpointerexception/16808 "2020-01-03T09:38:28Z")

</div>

Hi guys! Im Niko, new here :slight\_smile: I am trying to make an application where I mix together images of different lamps and lighting conditions. The way I imagined it, is that each there is one channel with the natu…

---

## [Cant play two videos at the same time](https://discourse.processing.org/t/cant-play-two-videos-at-the-same-time/16820)

<div class="topic-metadata">

**Author:** [@markcoelho](https://discourse.processing.org/u/markcoelho)\
**Replies:** 1\
**Last updated:** [January 3, 2020, 3:32am UTC](https://discourse.processing.org/t/cant-play-two-videos-at-the-same-time/16820 "2020-01-03T03:32:31Z")

</div>

So, i have an animation of a car moving, and i’m trying to use mask on it, exactly the same video, but i only exported the alpha channel. I’m trying to play them simultaneously, so they overlap, but they seem to be play…

---

## [Returning multiple values and also a problem with the class](https://discourse.processing.org/t/returning-multiple-values-and-also-a-problem-with-the-class/16821)

<div class="topic-metadata">

**Author:** [@ousmm](https://discourse.processing.org/u/ousmm)\
**Replies:** 1\
**Last updated:** [January 2, 2020, 9:04pm UTC](https://discourse.processing.org/t/returning-multiple-values-and-also-a-problem-with-the-class/16821 "2020-01-02T21:04:22Z")

</div>

void setup() { } float discriminant(float a, float b,float c ){ float x1,x2; float d=(b\*b)-4\*a\*c; if (d\>0){ x1=((-b)-sqrt(d))/2\*a; x2=((-b)+sqrt(d))/2\*a; return(x1) ; } if (d\<0){ x1=-b/…

---

## [hint(ENABLE\_DEPTH\_SORT) issues](https://discourse.processing.org/t/hint-enable-depth-sort-issues/16804)

<div class="topic-metadata">

**Author:** [@iofthebeholder](https://discourse.processing.org/u/iofthebeholder)\
**Replies:** 4\
**Last updated:** [January 2, 2020, 7:46pm UTC](https://discourse.processing.org/t/hint-enable-depth-sort-issues/16804 "2020-01-02T19:46:05Z")

</div>

working on a P3D sketch with many semi-transparent, moving geometries distributed in space. finding transparency renders as desired on when i use hint(ENABLE\_DEPTH\_SORT); however, there seems to be some kind of bufferi…

---

## [How to Find Percentage of a Quiz On Processing](https://discourse.processing.org/t/how-to-find-percentage-of-a-quiz-on-processing/15910)

<div class="topic-metadata">

**Author:** [@seerhallow12247](https://discourse.processing.org/u/seerhallow12247)\
**Replies:** 11\
**Last updated:** [January 2, 2020, 4:45pm UTC](https://discourse.processing.org/t/how-to-find-percentage-of-a-quiz-on-processing/15910 "2020-01-02T16:45:23Z")

</div>

Hi. I am making a quiz using processing. Our teacher instructed us to create the function findPercent, which will find the percent of the quiz using the variable totalCorrect (represents the answers the user got correct …

---

## [Processing saying "width cannot be resolved"](https://discourse.processing.org/t/processing-saying-width-cannot-be-resolved/16814)

<div class="topic-metadata">

**Author:** [@anaapearl](https://discourse.processing.org/u/anaapearl)\
**Replies:** 3\
**Last updated:** [January 2, 2020, 3:29pm UTC](https://discourse.processing.org/t/processing-saying-width-cannot-be-resolved/16814 "2020-01-02T15:29:04Z")

</div>

I keep trying to make my images change when clicking, and for some reason I can’t seem to get the width right… Could someone help me find the answer? Thanks! :slight\_smile: float drawLength = 250; float noiseScale = 0.0…

---

## [Creating woven patterns ... beginner](https://discourse.processing.org/t/creating-woven-patterns-beginner/16788)

<div class="topic-metadata">

**Author:** [@Lee14](https://discourse.processing.org/u/Lee14)\
**Replies:** 3\
**Last updated:** [January 2, 2020, 1:42pm UTC](https://discourse.processing.org/t/creating-woven-patterns-beginner/16788 "2020-01-02T13:42:54Z")

</div>

I am looking to create a sketch which draws a woven pattern … that is, mimics woven cloth … so with warp and weft. I would like to do it, as a beginner coder, using pixels to draw it … but am a bit confused. I have been …

---

## [CODE CRASHED PLEASE HELP (21 sticks game / AI CRASHES)](https://discourse.processing.org/t/code-crashed-please-help-21-sticks-game-ai-crashes/16802)

<div class="topic-metadata">

**Author:** [@pothead](https://discourse.processing.org/u/pothead)\
**Replies:** 13\
**Last updated:** [January 2, 2020, 11:53am UTC](https://discourse.processing.org/t/code-crashed-please-help-21-sticks-game-ai-crashes/16802 "2020-01-02T11:53:59Z")

</div>

So far here is my code Pretty Much there is 21 sticks in the beginning the player gets choice between picking 1 or 2 sticks and the AI gets to pick the Sticks when its turn,The one who is forced to pick the last stick l…

---

## [Hi, I have a error in my code please help project due (MEMORY GAME)](https://discourse.processing.org/t/hi-i-have-a-error-in-my-code-please-help-project-due-memory-game/16749)

<div class="topic-metadata">

**Author:** [@pothead](https://discourse.processing.org/u/pothead)\
**Replies:** 10\
**Last updated:** [January 2, 2020, 7:44am UTC](https://discourse.processing.org/t/hi-i-have-a-error-in-my-code-please-help-project-due-memory-game/16749 "2020-01-02T07:44:43Z")

</div>

So I am trying to make a memory game with an AI that chooses cards after my turn and when you find pair of cards that matches, it deletes and moves it to the side. I am having ARRAY OUT OF BOUNDS on my code if someon…

---

## [How do I detect collision with the background color in Processing 3 (java)?](https://discourse.processing.org/t/how-do-i-detect-collision-with-the-background-color-in-processing-3-java/16779)

<div class="topic-metadata">

**Author:** [@CharmanderProgrammer](https://discourse.processing.org/u/CharmanderProgrammer)\
**Replies:** 1\
**Last updated:** [January 2, 2020, 1:04am UTC](https://discourse.processing.org/t/how-do-i-detect-collision-with-the-background-color-in-processing-3-java/16779 "2020-01-02T01:04:50Z")

</div>

I am creating a basic dungeon game where you spawn into a randomly generated dungeon and you need to fight monsters. I just did a random generator where it will move a simulated character around the screen and draw a pa…

---

## [Java Reflections cheatsheet for processing](https://discourse.processing.org/t/java-reflections-cheatsheet-for-processing/16778)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 5\
**Last updated:** [January 1, 2020, 10:34pm UTC](https://discourse.processing.org/t/java-reflections-cheatsheet-for-processing/16778 "2020-01-01T22:34:40Z")

</div>

Hi I am trying to create a cheatsheet for most things reflections in java, however I am currently struggling with some aspects of the code. Please note the code is not mine, original code can be found here. …

---

## [Deserializing objects sent from a client program to a server program](https://discourse.processing.org/t/deserializing-objects-sent-from-a-client-program-to-a-server-program/16124)

<div class="topic-metadata">

**Author:** [@creepercrack](https://discourse.processing.org/u/creepercrack)\
**Replies:** 10\
**Last updated:** [January 1, 2020, 4:00pm UTC](https://discourse.processing.org/t/deserializing-objects-sent-from-a-client-program-to-a-server-program/16124 "2020-01-01T16:00:09Z")

</div>

Hi! I’m trying to make 2 diffrerent programs using the net library included with processign and I’m trying to send data between a server and a client using serializable objects The problem is that the client and the se…

---

## [Brick Breaker Game - Problem with brick and ball interactions](https://discourse.processing.org/t/brick-breaker-game-problem-with-brick-and-ball-interactions/16763)

<div class="topic-metadata">

**Author:** [@shadowfire\_elite](https://discourse.processing.org/u/shadowfire_elite)\
**Replies:** 4\
**Last updated:** [January 1, 2020, 8:02pm UTC](https://discourse.processing.org/t/brick-breaker-game-problem-with-brick-and-ball-interactions/16763 "2020-01-01T20:02:00Z")

</div>

I’ve been trying for a long time to make a successful brick breaker game, but I’m still stuck on how to make the ball and bricks to interact. Can someone help me figure out a way for one brick to disappear when the ball …

---

## [Running sketch files to LED matrix from MacBook Pro](https://discourse.processing.org/t/running-sketch-files-to-led-matrix-from-macbook-pro/13427)

<div class="topic-metadata">

**Author:** [@blackdiam\_echo](https://discourse.processing.org/u/blackdiam_echo)\
**Replies:** 6\
**Last updated:** [August 20, 2019, 9:37am UTC](https://discourse.processing.org/t/running-sketch-files-to-led-matrix-from-macbook-pro/13427 "2019-08-20T09:37:42Z")

</div>

Hello all, this is my first post here and I am so glad to have discovered Processing and this community. At the same time please excuse my ignorance. I am looking to run sketch files onto a LED matrix. I can see plenty…

---

## [Unexpected Character Movement](https://discourse.processing.org/t/unexpected-character-movement/16716)

<div class="topic-metadata">

**Author:** [@fredstout](https://discourse.processing.org/u/fredstout)\
**Replies:** 9\
**Last updated:** [January 1, 2020, 3:54pm UTC](https://discourse.processing.org/t/unexpected-character-movement/16716 "2020-01-01T15:54:44Z")

</div>

I am developing a sketch to graphically display GPS data coming from an Arduino. The sketch paints the background and “gauge” bezel and then calls various functions to fill in the face with appropriate data, . The comp…

---

## [Get Two Maximum values from array of numbers](https://discourse.processing.org/t/get-two-maximum-values-from-array-of-numbers/16517)

<div class="topic-metadata">

**Author:** [@tiarnola](https://discourse.processing.org/u/tiarnola)\
**Replies:** 2\
**Last updated:** [January 1, 2020, 3:52pm UTC](https://discourse.processing.org/t/get-two-maximum-values-from-array-of-numbers/16517 "2020-01-01T15:52:06Z")

</div>

Hi, I’ve got an array of numbers that looks like this: int \[\] numbers = { 2, 3, 8, 1, 8, 9, 6 }; I need to write a function that identifies 8 & 9 as the highest integers. I’ve seen plenty of solutions for returning on…

---

## [Beginner with Processing](https://discourse.processing.org/t/beginner-with-processing/16767)

<div class="topic-metadata">

**Author:** [@christiank79](https://discourse.processing.org/u/christiank79)\
**Replies:** 3\
**Last updated:** [January 1, 2020, 2:57pm UTC](https://discourse.processing.org/t/beginner-with-processing/16767 "2020-01-01T14:57:14Z")

</div>

Hello, I wanted to learning to programming in Processing and drawing with pen plotter in SVG format. Which book do you recommend? Thank you. Christian

---

## [Opencv depth estimation](https://discourse.processing.org/t/opencv-depth-estimation/16705)

<div class="topic-metadata">

**Author:** [@costachemadalin](https://discourse.processing.org/u/costachemadalin)\
**Replies:** 1\
**Last updated:** [January 1, 2020, 11:44am UTC](https://discourse.processing.org/t/opencv-depth-estimation/16705 "2020-01-01T11:44:28Z")

</div>

I am trying to get depth from 2 rectified images using openCV ,i took this code from here opencv-depth . I want to understand how the program works ,but i couldn’t find any documentation. import gab.opencv.\*; import or…

---

## [How to set color to the plot in grafica library](https://discourse.processing.org/t/how-to-set-color-to-the-plot-in-grafica-library/16773)

<div class="topic-metadata">

**Author:** [@iamgsshetty](https://discourse.processing.org/u/iamgsshetty)\
**Replies:** 1\
**Last updated:** [January 1, 2020, 11:20am UTC](https://discourse.processing.org/t/how-to-set-color-to-the-plot-in-grafica-library/16773 "2020-01-01T11:20:18Z")

</div>

I want to change color of the line from grey(default) to some other color

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

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