# Latest

**URL:** https://discourse.processing.org/latest.md?no_subcategories=false&page=97

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

**Page:** 98

---

## [HashMap Workaround](https://discourse.processing.org/t/hashmap-workaround/40018)

<div class="topic-metadata">

**Author:** [@moffmix](https://discourse.processing.org/u/moffmix)\
**Replies:** 5\
**Last updated:** [December 8, 2022, 4:48am UTC](https://discourse.processing.org/t/hashmap-workaround/40018 "2022-12-08T04:48:53Z")

</div>

Hello again! I’ve got another question for my Processing class. I found a great example in another forum on how to make a Choose Your Own Adventure game; I’m currently dissecting it and trying to make it my own, with the…

---

## [How to continue running while Android screen is locked](https://discourse.processing.org/t/how-to-continue-running-while-android-screen-is-locked/40049)

<div class="topic-metadata">

**Author:** [@bigboss97](https://discourse.processing.org/u/bigboss97)\
**Replies:** 1\
**Last updated:** [December 8, 2022, 4:41am UTC](https://discourse.processing.org/t/how-to-continue-running-while-android-screen-is-locked/40049 "2022-12-08T04:41:04Z")

</div>

I’m using draw() loop to send repetitively HTTP requests. Everything works fine. But as soon as the phone times out and goes into lock mode. The draw loop is no longer running. What should I use in order to keep my sket…

---

## [Can't Connect to Device](https://discourse.processing.org/t/cant-connect-to-device/40056)

<div class="topic-metadata">

**Author:** [@ArduingoAteYoBaby](https://discourse.processing.org/u/ArduingoAteYoBaby)\
**Replies:** 2\
**Last updated:** [December 8, 2022, 3:39am UTC](https://discourse.processing.org/t/cant-connect-to-device/40056 "2022-12-08T03:39:24Z")

</div>

Hello, I have tried via both Processing 3 and 4 to connect to my android. Processing 4, I installed the Android mode and allocated everything supposedly correctly, but it didn’t appear as an install option. So I went …

---

## [No audio comes up in the browser after uploaded to github page, work fine P5js](https://discourse.processing.org/t/no-audio-comes-up-in-the-browser-after-uploaded-to-github-page-work-fine-p5js/40058)

<div class="topic-metadata">

**Author:** [@vrtx](https://discourse.processing.org/u/vrtx)\
**Replies:** 0\
**Last updated:** [December 8, 2022, 2:31am UTC](https://discourse.processing.org/t/no-audio-comes-up-in-the-browser-after-uploaded-to-github-page-work-fine-p5js/40058 "2022-12-08T02:31:12Z")

</div>

Hi there! 1# i was with no internet, its made using only my knoledge and some PDF. to whrite java processing and turn it into p5js.BUT It works fine on processing java but if i paste the p5js dont show up images on bro…

---

## [P5js trail transparent Background？](https://discourse.processing.org/t/p5js-trail-transparent-background/39864)

<div class="topic-metadata">

**Author:** [@AbleYudada](https://discourse.processing.org/u/AbleYudada)\
**Replies:** 7\
**Last updated:** [December 8, 2022, 2:22am UTC](https://discourse.processing.org/t/p5js-trail-transparent-background/39864 "2022-12-08T02:22:38Z")

</div>

Hello guys! Recently, I have encountered some troubles with p5js. I want to make a raindrop with a track, but the ball moves without a track. Finally, they merge together, but I can’t get a raindrop with a track and a tr…

---

## [Using dist(); for collision detection](https://discourse.processing.org/t/using-dist-for-collision-detection/40050)

<div class="topic-metadata">

**Author:** [@LeckereKrokette](https://discourse.processing.org/u/LeckereKrokette)\
**Replies:** 6\
**Last updated:** [December 8, 2022, 2:12am UTC](https://discourse.processing.org/t/using-dist-for-collision-detection/40050 "2022-12-08T02:12:46Z")

</div>

Hello processing community. I want to make a mini game where you control a ellipse and have to avoid other ellipse. I first wanted the “opponents” to repel each other. For this I initialized 10 ellipses in an array. But …

---

## [Cannot find a class or type named “Enemy” -- How to Initialize an Array of Objects](https://discourse.processing.org/t/cannot-find-a-class-or-type-named-enemy-how-to-initialize-an-array-of-objects/40043)

<div class="topic-metadata">

**Author:** [@C2014](https://discourse.processing.org/u/C2014)\
**Replies:** 3\
**Last updated:** [December 7, 2022, 2:32pm UTC](https://discourse.processing.org/t/cannot-find-a-class-or-type-named-enemy-how-to-initialize-an-array-of-objects/40043 "2022-12-07T14:32:28Z")

</div>

int spawnTime=180; Enemy\[\] zombieArray; int zombiecount; int maxzombie=8; int i; void setup() { maxzombie=8; size(500,300); zombieArray = new Enemy\[maxzombie\]; } void draw(){ background (100); for ( Enemy zomb…

---

## [Snake game: start screen and two players](https://discourse.processing.org/t/snake-game-start-screen-and-two-players/39962)

<div class="topic-metadata">

**Author:** [@ALAL](https://discourse.processing.org/u/ALAL)\
**Replies:** 10\
**Last updated:** [December 7, 2022, 1:06pm UTC](https://discourse.processing.org/t/snake-game-start-screen-and-two-players/39962 "2022-12-07T13:06:38Z")

</div>

Heyy!! this is my first time and I’m a beginner. I have questions about sank game in processing. I have an exam next week so I hoop to found someone to help me. my question is how can I make a home start en a another s…

---

## [Convert camera from 3:2 to 16:9](https://discourse.processing.org/t/convert-camera-from-3-2-to-16-9/40041)

<div class="topic-metadata">

**Author:** [@illus](https://discourse.processing.org/u/illus)\
**Replies:** 14\
**Last updated:** [December 7, 2022, 12:57pm UTC](https://discourse.processing.org/t/convert-camera-from-3-2-to-16-9/40041 "2022-12-07T12:57:39Z")

</div>

Hi, I’m trying to convert an live camera image of 640x480 (3:2)to 640x360 (16:9) only to display it at a size of 1126x633 (still 16:9). Clearly it needs cropping, which is fine. But how? I have: if (cam.available() ) {…

---

## [Balls wait problem](https://discourse.processing.org/t/balls-wait-problem/40047)

<div class="topic-metadata">

**Author:** [@SYN1810](https://discourse.processing.org/u/SYN1810)\
**Replies:** 1\
**Last updated:** [December 7, 2022, 10:54am UTC](https://discourse.processing.org/t/balls-wait-problem/40047 "2022-12-07T10:54:56Z")

</div>

Hello, now I am making a game of hunting a ball, what happens is that the balls do not stay on the screen, but new ones are written continuously, I wanted to do it by myself but I have not succeeded, the objective is tha…

---

## [How to use Google calendar API with Processing desktop (Mac)](https://discourse.processing.org/t/how-to-use-google-calendar-api-with-processing-desktop-mac/39884)

<div class="topic-metadata">

**Author:** [@dehyde](https://discourse.processing.org/u/dehyde)\
**Replies:** 3\
**Last updated:** [December 6, 2022, 10:17pm UTC](https://discourse.processing.org/t/how-to-use-google-calendar-api-with-processing-desktop-mac/39884 "2022-12-06T22:17:25Z")

</div>

Hay all! I’m quite rusty with programming, processing and Java, hope somebody could help here: I’m trying to use google calendar’s API, but it’s using something called “gradle” to build and everything’s quite confusing…

---

## ['Rotate' gradient background](https://discourse.processing.org/t/rotate-gradient-background/39989)

<div class="topic-metadata">

**Author:** [@Erif](https://discourse.processing.org/u/Erif)\
**Replies:** 11\
**Last updated:** [December 6, 2022, 8:48pm UTC](https://discourse.processing.org/t/rotate-gradient-background/39989 "2022-12-06T20:48:23Z")

</div>

Hi, Quick simple question I’m sure but somehow I can’t manage to make it work. This code below shows a green to red gradient background from bottom left to top right. How can I make it go from bottom right to top left…

---

## [P3D: Window doesn't open](https://discourse.processing.org/t/p3d-window-doesnt-open/39965)

<div class="topic-metadata">

**Author:** [@martin1](https://discourse.processing.org/u/martin1)\
**Replies:** 4\
**Last updated:** [December 6, 2022, 4:12pm UTC](https://discourse.processing.org/t/p3d-window-doesnt-open/39965 "2022-12-06T16:12:01Z")

</div>

Whenever I open a P3D sketch and try to run it, a window opens as usual. However once I edit the sketch and try to run it, no window appears. There is a window icon on the task bar, however clicking on it doesn’t open …

---

## [Drawing Fibonacci Spiral with SVG that Changes Angles](https://discourse.processing.org/t/drawing-fibonacci-spiral-with-svg-that-changes-angles/40038)

<div class="topic-metadata">

**Author:** [@DDe](https://discourse.processing.org/u/DDe)\
**Replies:** 4\
**Last updated:** [December 6, 2022, 4:09pm UTC](https://discourse.processing.org/t/drawing-fibonacci-spiral-with-svg-that-changes-angles/40038 "2022-12-06T16:09:57Z")

</div>

Hey hey, obviously I’m new to proccessing but long story short, I am trying to replace the line/points drawn out for a Fibonnaci Spiral with an svg file of my design, but I’m struggling to make that work. I have some cod…

---

## [Bug? shapes in P2D](https://discourse.processing.org/t/bug-shapes-in-p2d/39976)

<div class="topic-metadata">

**Author:** [@zzabel8](https://discourse.processing.org/u/zzabel8)\
**Replies:** 1\
**Last updated:** [December 6, 2022, 8:53am UTC](https://discourse.processing.org/t/bug-shapes-in-p2d/39976 "2022-12-06T08:53:28Z")

</div>

When you run this code it draws a linear line and a ball that jumps around with ‘a’ and ‘d’. The line is drawn in the for loop. Running this works just fine, but if you change the conditional in the for loop to 1250 inst…

---

## [Bug on KetaiCamera solved, please recompile lib!](https://discourse.processing.org/t/bug-on-ketaicamera-solved-please-recompile-lib/40025)

<div class="topic-metadata">

**Author:** [@erkosone](https://discourse.processing.org/u/erkosone)\
**Replies:** 1\
**Last updated:** [December 6, 2022, 8:27am UTC](https://discourse.processing.org/t/bug-on-ketaicamera-solved-please-recompile-lib/40025 "2022-12-06T08:27:02Z")

</div>

Hello, I just fixed a bug in the Ketai library, in its module for the android “camera”. This library contains obsolete code for autofocus and it needs to be corrected, I would appreciate it if someone would recompile th…

---

## [Calculation the color density of an image](https://discourse.processing.org/t/calculation-the-color-density-of-an-image/40021)

<div class="topic-metadata">

**Author:** [@jaspervb](https://discourse.processing.org/u/jaspervb)\
**Replies:** 5\
**Last updated:** [December 6, 2022, 1:11am UTC](https://discourse.processing.org/t/calculation-the-color-density-of-an-image/40021 "2022-12-06T01:11:14Z")

</div>

Hi There, Is there a way to calculate the percentages of the colors in an image, for example in a logo. If it is possible i want to translate those color percentage values into rectangles. I hope to hear from you. Ki…

---

## [Sort method of the Table Class doesn’t work correctly](https://discourse.processing.org/t/sort-method-of-the-table-class-doesn-t-work-correctly/40031)

<div class="topic-metadata">

**Author:** [@Schiffmann](https://discourse.processing.org/u/Schiffmann)\
**Replies:** 1\
**Last updated:** [December 5, 2022, 1:43pm UTC](https://discourse.processing.org/t/sort-method-of-the-table-class-doesn-t-work-correctly/40031 "2022-12-05T13:43:30Z")

</div>

Hello, I wrote a program that should sort a table according a column with int values that were initialised in descending order, starting with 100000. Unfortunately the result is wrong while by excel or numbers it can be…

---

## [Connecting to points with an arc](https://discourse.processing.org/t/connecting-to-points-with-an-arc/40009)

<div class="topic-metadata">

**Author:** [@cristiano\_b](https://discourse.processing.org/u/cristiano_b)\
**Replies:** 6\
**Last updated:** [December 5, 2022, 10:55am UTC](https://discourse.processing.org/t/connecting-to-points-with-an-arc/40009 "2022-12-05T10:55:25Z")

</div>

Ok, this is probably easy but I can’t find a way. How can I connect two random points with an arc? The code below shows the final result, but I’d like to do it calculating the arc starting from any position of the two …

---

## [Gifs generated with saveGif() only contain a single color](https://discourse.processing.org/t/gifs-generated-with-savegif-only-contain-a-single-color/39954)

<div class="topic-metadata">

**Author:** [@Kevin](https://discourse.processing.org/u/Kevin)\
**Replies:** 9\
**Last updated:** [December 5, 2022, 1:14am UTC](https://discourse.processing.org/t/gifs-generated-with-savegif-only-contain-a-single-color/39954 "2022-12-05T01:14:33Z")

</div>

Hey friends, long time no see! I’ve been pretty excited about the saveGif() function, but I’m having trouble getting it to work as expected. Here’s some code I’m trying: let colors = \['red', 'yellow', 'orange', 'green…

---

## [Coding Train Tutorial 6.2 while loop question](https://discourse.processing.org/t/coding-train-tutorial-6-2-while-loop-question/40020)

<div class="topic-metadata">

**Author:** [@Siyue](https://discourse.processing.org/u/Siyue)\
**Replies:** 3\
**Last updated:** [December 4, 2022, 6:01pm UTC](https://discourse.processing.org/t/coding-train-tutorial-6-2-while-loop-question/40020 "2022-12-04T18:01:28Z")

</div>

float y=0; float x=0; void setup() { size(800, 800); } void draw() { background(200, 20, 90); y=0; while (y\<height) { if (mouseY\<1) { y=y+1; } else { y=mouseY+y; } } …

---

## [How can I rotate all of this](https://discourse.processing.org/t/how-can-i-rotate-all-of-this/40015)

<div class="topic-metadata">

**Author:** [@returng](https://discourse.processing.org/u/returng)\
**Replies:** 1\
**Last updated:** [December 3, 2022, 10:57pm UTC](https://discourse.processing.org/t/how-can-i-rotate-all-of-this/40015 "2022-12-03T22:57:25Z")

</div>

I want to rotate my snowflake with mouseX, here is the full code; float angle = 0; float cx; float cy; void setup() { size(640, 480); cx = 50; cy = height/2; noLoop(); } void draw() { background(255); …

---

## [Concentric Circles Animation doubt](https://discourse.processing.org/t/concentric-circles-animation-doubt/39992)

<div class="topic-metadata">

**Author:** [@JoseRocha](https://discourse.processing.org/u/JoseRocha)\
**Replies:** 6\
**Last updated:** [December 4, 2022, 2:28pm UTC](https://discourse.processing.org/t/concentric-circles-animation-doubt/39992 "2022-12-04T14:28:40Z")

</div>

Hi All. Is it possible to do this kind of animation smoothly with code in p5.js Thanks for any help.

---

## [PDF of P3D Processing sketch](https://discourse.processing.org/t/pdf-of-p3d-processing-sketch/39996)

<div class="topic-metadata">

**Author:** [@asymmetric](https://discourse.processing.org/u/asymmetric)\
**Replies:** 13\
**Last updated:** [December 4, 2022, 1:32am UTC](https://discourse.processing.org/t/pdf-of-p3d-processing-sketch/39996 "2022-12-04T01:32:41Z")

</div>

I’m finding it difficult to create a PDF from the PDF library when my sketch specifies P2D or P3D. What am I doing wrong? import processing.pdf.\*; boolean record; void setup(){ size(1500,800,P3D); frameRate(1); …

---

## [Handy or similar pencil sketch library in Processing.py](https://discourse.processing.org/t/handy-or-similar-pencil-sketch-library-in-processing-py/40005)

<div class="topic-metadata">

**Author:** [@Fosker](https://discourse.processing.org/u/Fosker)\
**Replies:** 5\
**Last updated:** [December 3, 2022, 11:50pm UTC](https://discourse.processing.org/t/handy-or-similar-pencil-sketch-library-in-processing-py/40005 "2022-12-03T23:50:46Z")

</div>

Is there a way to make your sketches look more like they have been sketched by a pencil (ie rough sketch type lines)? I’ve seen people using the Handy library in other processing modes but can’t see any info on it with…

---

## [Does anyone know what is wrong with this program?](https://discourse.processing.org/t/does-anyone-know-what-is-wrong-with-this-program/40012)

<div class="topic-metadata">

**Author:** [@add](https://discourse.processing.org/u/add)\
**Replies:** 2\
**Last updated:** [December 3, 2022, 8:45pm UTC](https://discourse.processing.org/t/does-anyone-know-what-is-wrong-with-this-program/40012 "2022-12-03T20:45:44Z")

</div>

int h,m; void setup(){ size (800,600); frameRate(10); } void draw (){ // if (framec==0){ background (180); stroke (0); fill(255); rect (0,500,width,height);//chenar jos h=nf(hits); m=nf(misses); f…

---

## [How can I do this homework?](https://discourse.processing.org/t/how-can-i-do-this-homework/40011)

<div class="topic-metadata">

**Author:** [@add](https://discourse.processing.org/u/add)\
**Replies:** 1\
**Last updated:** [December 3, 2022, 8:39pm UTC](https://discourse.processing.org/t/how-can-i-do-this-homework/40011 "2022-12-03T20:39:17Z")

</div>

Add a rectangle in which the input is entered. Make 5 buttons with the following text operations: - Clear: clear the text in the textbox - Capitals: put the letters in capitals - Last character: show the last character o…

---

## [Using Sublime text.. Processing-Java error in Processing](https://discourse.processing.org/t/using-sublime-text-processing-java-error-in-processing/39998)

<div class="topic-metadata">

**Author:** [@bardo](https://discourse.processing.org/u/bardo)\
**Replies:** 6\
**Last updated:** [December 3, 2022, 5:04pm UTC](https://discourse.processing.org/t/using-sublime-text-processing-java-error-in-processing/39998 "2022-12-03T17:04:05Z")

</div>

hi there, i am tryng to use processing with Sublime. I have been following the tutorials on how to set everything. The only issue im having is that when I click build in Sublime, it gies me an error about Processign-ja…

---

## [Which one is a quadratic equation?](https://discourse.processing.org/t/which-one-is-a-quadratic-equation/39981)

<div class="topic-metadata">

**Author:** [@Robertrichardr](https://discourse.processing.org/u/Robertrichardr)\
**Replies:** 2\
**Last updated:** [December 3, 2022, 10:40am UTC](https://discourse.processing.org/t/which-one-is-a-quadratic-equation/39981 "2022-12-03T10:40:17Z")

</div>

A quadratic equation is a 2nd-degree equation, meaning it has at least one term that is equaled. A common form is ax ² + bx + c = 0, with a, b, and c being constants or mathematical coefficients and x being the unknown v…

---

## [Loading a random image for every different screen in Processing](https://discourse.processing.org/t/loading-a-random-image-for-every-different-screen-in-processing/40004)

<div class="topic-metadata">

**Author:** [@onosecond](https://discourse.processing.org/u/onosecond)\
**Replies:** 1\
**Last updated:** [December 3, 2022, 7:22am UTC](https://discourse.processing.org/t/loading-a-random-image-for-every-different-screen-in-processing/40004 "2022-12-03T07:22:34Z")

</div>

Hi everyone! Please note that I am a beginner :slight\_smile: I am trying to find how to change the background to a different image every time the screen changes. A bit of context: I am trying to make a quiz game, and e…

[Previous page](https://discourse.processing.org/latest.md?no_subcategories=false&page=96)

[Next page](https://discourse.processing.org/latest.md?no_subcategories=false&page=98)
