# Processing

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

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

**Page:** 147

---

## [Rotate image with PVectors for game](https://discourse.processing.org/t/rotate-image-with-pvectors-for-game/28203)

<div class="topic-metadata">

**Author:** [@boomstick55](https://discourse.processing.org/u/boomstick55)\
**Replies:** 4\
**Last updated:** [March 3, 2021, 4:25pm UTC](https://discourse.processing.org/t/rotate-image-with-pvectors-for-game/28203 "2021-03-03T16:25:34Z")

</div>

For a project, I am making a simple top down shooter and I’m trying to incorporate a push pop rotation to the player character. I am having trouble having the character image rotate to the mouse coordinates ala pointing …

---

## [API gives NullPointerException](https://discourse.processing.org/t/api-gives-nullpointerexception/26792)

<div class="topic-metadata">

**Author:** [@AntiQliMax](https://discourse.processing.org/u/AntiQliMax)\
**Replies:** 1\
**Last updated:** [March 3, 2021, 2:08pm UTC](https://discourse.processing.org/t/api-gives-nullpointerexception/26792 "2021-03-03T14:08:56Z")

</div>

Dear users of this forum. I started learning API calls and tried it with some code I found on the old forum. The goal is i want to use the openweather API to check if it is raining, now the API works and the URL, but I…

---

## [Code Organisation](https://discourse.processing.org/t/code-organisation/28215)

<div class="topic-metadata">

**Author:** [@s31](https://discourse.processing.org/u/s31)\
**Replies:** 5\
**Last updated:** [March 3, 2021, 10:53am UTC](https://discourse.processing.org/t/code-organisation/28215 "2021-03-03T10:53:16Z")

</div>

hey all, I’ve been using processing for a while now, but have only just started using this forum. As my projects become larger and larger in scale, the code becomes harder and harder to navigate. All of the text seems t…

---

## [HSL- Another colorful box](https://discourse.processing.org/t/hsl-another-colorful-box/28209)

<div class="topic-metadata">

**Author:** [@Apollo](https://discourse.processing.org/u/Apollo)\
**Replies:** 4\
**Last updated:** [March 3, 2021, 8:07am UTC](https://discourse.processing.org/t/hsl-another-colorful-box/28209 "2021-03-03T08:07:15Z")

</div>

Hey, Maybe you could help me here. I have to make an interactive HSL (Hue, Saturation, Lightness) Box in Processing. On top of the window, there should be a 500px wide and 50px tall color strip that will determine the…

---

## [Filling up the canvas with some paint](https://discourse.processing.org/t/filling-up-the-canvas-with-some-paint/28210)

<div class="topic-metadata">

**Author:** [@Apollo](https://discourse.processing.org/u/Apollo)\
**Replies:** 2\
**Last updated:** [March 3, 2021, 7:49am UTC](https://discourse.processing.org/t/filling-up-the-canvas-with-some-paint/28210 "2021-03-03T07:49:46Z")

</div>

Hi! I hope you could help me here. The code should create a 500x500 canvas and fills it in with a solid color (try maroon) using a 25px brush in 20 seconds. The brush goes from left to right for a layer/level/row, then…

---

## [Need help with this (sliding puzzle game)](https://discourse.processing.org/t/need-help-with-this-sliding-puzzle-game/28189)

<div class="topic-metadata">

**Author:** [@cocopuffs](https://discourse.processing.org/u/cocopuffs)\
**Replies:** 3\
**Last updated:** [March 3, 2021, 6:50am UTC](https://discourse.processing.org/t/need-help-with-this-sliding-puzzle-game/28189 "2021-03-03T06:50:12Z")

</div>

I’ve been working on this for quite some time and am very lost right now. I’m trying to figure out how to shuffle the image, and then have it set to where the player can rearrange the image using the white square so that…

---

## [First person camera help](https://discourse.processing.org/t/first-person-camera-help/28205)

<div class="topic-metadata">

**Author:** [@s31](https://discourse.processing.org/u/s31)\
**Replies:** 1\
**Last updated:** [March 3, 2021, 5:20am UTC](https://discourse.processing.org/t/first-person-camera-help/28205 "2021-03-03T05:20:20Z")

</div>

i’ve edited some code i found for a first person camera but cant figure out how to rotate y axis well inside the matrix and also how to stop the block from jittering around when i move the camera. any help would be appre…

---

## [How do I use mousePressed/mouseClicked for this part? (image order game)](https://discourse.processing.org/t/how-do-i-use-mousepressed-mouseclicked-for-this-part-image-order-game/28190)

<div class="topic-metadata">

**Author:** [@cocopuffs](https://discourse.processing.org/u/cocopuffs)\
**Replies:** 3\
**Last updated:** [March 3, 2021, 3:27am UTC](https://discourse.processing.org/t/how-do-i-use-mousepressed-mouseclicked-for-this-part-image-order-game/28190 "2021-03-03T03:27:02Z")

</div>

I’m just about done with this work, but I’m stuck on this part. the 4 images are shuffling as needed, but I need it to where the player clicks on the image in the correct order, and then the words “YOU WIN!” or “YOU LOSE…

---

## [How to instantiate class from String?](https://discourse.processing.org/t/how-to-instantiate-class-from-string/27641)

<div class="topic-metadata">

**Author:** [@molo32](https://discourse.processing.org/u/molo32)\
**Replies:** 7\
**Last updated:** [March 2, 2021, 8:25pm UTC](https://discourse.processing.org/t/how-to-instantiate-class-from-string/27641 "2021-03-02T20:25:02Z")

</div>

instantiate class from string I have the car class class car { ... } how can I do ArrayList \<Object\> cars = new ArrayList \<Object\> (); // Create an ArrayList object String s = "car" cars.add (new s()) I tried this…

---

## [Create a counter from 1 to 10 in secondes to my games](https://discourse.processing.org/t/create-a-counter-from-1-to-10-in-secondes-to-my-games/28193)

<div class="topic-metadata">

**Author:** [@Torikusu](https://discourse.processing.org/u/Torikusu)\
**Replies:** 1\
**Last updated:** [March 2, 2021, 8:05pm UTC](https://discourse.processing.org/t/create-a-counter-from-1-to-10-in-secondes-to-my-games/28193 "2021-03-02T20:05:14Z")

</div>

Hello, i would like to display on my games a stopwatch on my code, counting from 1 to 10 in secondes wel after 10 secondes it returns to 0 and its repeating float wait2 = 1000 - floor(millis()/1000)\*90; int lastTime = …

---

## [Bug with color variable type (lerpColor)](https://discourse.processing.org/t/bug-with-color-variable-type-lerpcolor/27705)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 17\
**Last updated:** [March 2, 2021, 8:00pm UTC](https://discourse.processing.org/t/bug-with-color-variable-type-lerpcolor/27705 "2021-03-02T20:00:53Z")

</div>

size(400,200); color clr = 255, clr2 = color(255,255,255); noStroke(); fill(red(clr),green(clr),blue(clr)); rect(0,0,200,200); fill(red(clr2),green(clr2),blue(clr2)); rect(200,0,200,200); I know color is stored as a w…

---

## [Create an error counter for my game](https://discourse.processing.org/t/create-an-error-counter-for-my-game/28194)

<div class="topic-metadata">

**Author:** [@Torikusu](https://discourse.processing.org/u/Torikusu)\
**Replies:** 0\
**Last updated:** [March 2, 2021, 7:16pm UTC](https://discourse.processing.org/t/create-an-error-counter-for-my-game/28194 "2021-03-02T19:16:34Z")

</div>

Hello, I would like,when I click next to a square or I take too long to click on it, a counter is displayed, example if Iam mistaken 2 times I diplayed 2. When i tried this i encountered an error witch Java that i do not…

---

## [Arranging objects in random rows and columns](https://discourse.processing.org/t/arranging-objects-in-random-rows-and-columns/28163)

<div class="topic-metadata">

**Author:** [@Criste44](https://discourse.processing.org/u/Criste44)\
**Replies:** 10\
**Last updated:** [March 2, 2021, 12:07pm UTC](https://discourse.processing.org/t/arranging-objects-in-random-rows-and-columns/28163 "2021-03-02T12:07:54Z")

</div>

private void InitialSetup() { AddPiece(whiteRook, white, 0, 0); AddPiece(whiteKnight, white,1,2); AddPiece(whiteBishop, white,2,0); AddPiece(whiteQueen, white, 3,4); AddPiece(whiteKing, white, 4, 6); AddPiece(whit…

---

## [3d drawing with mouse](https://discourse.processing.org/t/3d-drawing-with-mouse/27738)

<div class="topic-metadata">

**Author:** [@jafal](https://discourse.processing.org/u/jafal)\
**Replies:** 36\
**Last updated:** [March 2, 2021, 11:47am UTC](https://discourse.processing.org/t/3d-drawing-with-mouse/27738 "2021-03-02T11:47:17Z")

</div>

Mr @Chrisir hi i read this post for you i need some headlights if you kind void setup() { size(600, 600, OPENGL); rectMode(CENTER); } void draw() { background(0); lights(); translate(width/2, heigh…

---

## [Developing a new library: error while creating javadoc and some general question](https://discourse.processing.org/t/developing-a-new-library-error-while-creating-javadoc-and-some-general-question/13863)

<div class="topic-metadata">

**Author:** [@fedpep](https://discourse.processing.org/u/fedpep)\
**Replies:** 11\
**Last updated:** [September 13, 2019, 5:48pm UTC](https://discourse.processing.org/t/developing-a-new-library-error-while-creating-javadoc-and-some-general-question/13863 "2019-09-13T17:48:52Z")

</div>

Hi, I’m working on a library for processing for the first time. I followed the guidelines on Github and downloaded the template. Everything works correctly but I have an issue because when I run ant in eclipse it doesn’…

---

## [Vector field to an array (Aborigines Art)](https://discourse.processing.org/t/vector-field-to-an-array-aborigines-art/27839)

<div class="topic-metadata">

**Author:** [@Hiram-Belgium](https://discourse.processing.org/u/Hiram-Belgium)\
**Replies:** 14\
**Last updated:** [March 2, 2021, 11:25am UTC](https://discourse.processing.org/t/vector-field-to-an-array-aborigines-art/27839 "2021-03-02T11:25:22Z")

</div>

Hello (please excuse my poor English I am French speaking Belgian) I would like to know how I could put all the points of a vector field in an array?My goal is to replace the lines of my vector field with circles to simu…

---

## [How to add image to terrain sketch](https://discourse.processing.org/t/how-to-add-image-to-terrain-sketch/28158)

<div class="topic-metadata">

**Author:** [@jafal](https://discourse.processing.org/u/jafal)\
**Replies:** 1\
**Last updated:** [March 2, 2021, 7:55am UTC](https://discourse.processing.org/t/how-to-add-image-to-terrain-sketch/28158 "2021-03-02T07:55:31Z")

</div>

hi how to add text and image to this sketch int cols, rows; int scl = 13; int w = 1200; int h = 1600; float flying = 0; //int scl = 10; //int w = 1900; //int h = 2600; float\[\]\[\] terrain; void setup() { size (600…

---

## [Time elapsed correlated with FrameCount](https://discourse.processing.org/t/time-elapsed-correlated-with-framecount/28004)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 13\
**Last updated:** [March 1, 2021, 6:08pm UTC](https://discourse.processing.org/t/time-elapsed-correlated-with-framecount/28004 "2021-03-01T18:08:01Z")

</div>

Hello guys and girls, Hi made a function to see seconds elapsed from the the first frame. I did like that int Time=0; void setup (){ frameRate(30); } void TimeElapsed () { if ((frameCount%30)==0) { Time+=1; …

---

## [How to make Grid out of Boxes (3D)](https://discourse.processing.org/t/how-to-make-grid-out-of-boxes-3d/28070)

<div class="topic-metadata">

**Author:** [@jafal](https://discourse.processing.org/u/jafal)\
**Replies:** 29\
**Last updated:** [March 1, 2021, 2:59pm UTC](https://discourse.processing.org/t/how-to-make-grid-out-of-boxes-3d/28070 "2021-03-01T14:59:14Z")

</div>

@ Chrisir hi how are you int unit = 90; int count; Module\[\] mods; void setup() { size(600, 660, OPENGL); noStroke(); int wideCount = width / unit; int highCount = height / unit; int depthCount = h…

---

## [Create another window accessible with a key from the menu](https://discourse.processing.org/t/create-another-window-accessible-with-a-key-from-the-menu/28108)

<div class="topic-metadata">

**Author:** [@Torikusu](https://discourse.processing.org/u/Torikusu)\
**Replies:** 5\
**Last updated:** [March 1, 2021, 2:42pm UTC](https://discourse.processing.org/t/create-another-window-accessible-with-a-key-from-the-menu/28108 "2021-03-01T14:42:56Z")

</div>

Hello, I would like to create a third page (I have the menu and the games) except that it does not work here is the code with the error: float wait2 = 1000 - floor(millis()/1000)\*90; int lastTime = 0; int score = 0; …

---

## [Read file in zipped folder with password](https://discourse.processing.org/t/read-file-in-zipped-folder-with-password/27852)

<div class="topic-metadata">

**Author:** [@Marco0030](https://discourse.processing.org/u/Marco0030)\
**Replies:** 2\
**Last updated:** [March 1, 2021, 10:41am UTC](https://discourse.processing.org/t/read-file-in-zipped-folder-with-password/27852 "2021-03-01T10:41:10Z")

</div>

Hello. I’m new to processing. Is there a way to read and reproduce a file audio in a zipped folder with password? (i would like to avoid that someone could change the audiofiles) thank you

---

## [How to divide a sketch - Beginner math question (rows of graphic)](https://discourse.processing.org/t/how-to-divide-a-sketch-beginner-math-question-rows-of-graphic/28144)

<div class="topic-metadata">

**Author:** [@leatherbird](https://discourse.processing.org/u/leatherbird)\
**Replies:** 8\
**Last updated:** [March 1, 2021, 8:09am UTC](https://discourse.processing.org/t/how-to-divide-a-sketch-beginner-math-question-rows-of-graphic/28144 "2021-03-01T08:09:36Z")

</div>

My efforts to learn Processing always seem to get tripped up by my poor math skills. I am also not sure if I’m using the correct terminology, so I’m hoping someone can either help me, or at least point me toward the corr…

---

## [Can I use Blockbench for Processing, is it able to implement 3d objects and also 3d objects with animation?](https://discourse.processing.org/t/can-i-use-blockbench-for-processing-is-it-able-to-implement-3d-objects-and-also-3d-objects-with-animation/28119)

<div class="topic-metadata">

**Author:** [@SailorToei](https://discourse.processing.org/u/SailorToei)\
**Replies:** 3\
**Last updated:** [March 1, 2021, 7:37am UTC](https://discourse.processing.org/t/can-i-use-blockbench-for-processing-is-it-able-to-implement-3d-objects-and-also-3d-objects-with-animation/28119 "2021-03-01T07:37:50Z")

</div>

Hello everybody. I am just curious what is possible in Processing. I thought that at least adding a 3d object with animation to Javascript is possible, because of games like Minecraft and Yandere Simulator which were ori…

---

## [I need help with a life counter ending the game. I need it to end the program when the lives hit 0](https://discourse.processing.org/t/i-need-help-with-a-life-counter-ending-the-game-i-need-it-to-end-the-program-when-the-lives-hit-0/28154)

<div class="topic-metadata">

**Author:** [@ruvinson](https://discourse.processing.org/u/ruvinson)\
**Replies:** 1\
**Last updated:** [March 1, 2021, 6:27am UTC](https://discourse.processing.org/t/i-need-help-with-a-life-counter-ending-the-game-i-need-it-to-end-the-program-when-the-lives-hit-0/28154 "2021-03-01T06:27:07Z")

</div>

//START SCREEN int stateWaitBeforeProgram = 0; int stateNormalProgram = 1; int state = stateWaitBeforeProgram; //TIMER class Timer { int time; int duration; Timer() { duration = 100; reset(); } v…

---

## [Answers for Learning Processing](https://discourse.processing.org/t/answers-for-learning-processing/11284)

<div class="topic-metadata">

**Author:** [@r8th](https://discourse.processing.org/u/r8th)\
**Replies:** 5\
**Last updated:** [April 24, 2020, 11:14am UTC](https://discourse.processing.org/t/answers-for-learning-processing/11284 "2020-04-24T11:14:55Z")

</div>

Hi, I am an artist new to code. I am using Shiffman’s Learning Processing (2nd Ed.) to teach myself. Throughout the book there are “test” your knowledge and “fill-in-the-blank” exercises. Does anyone know if there is a…

---

## [Having trouble visualizing twitter data](https://discourse.processing.org/t/having-trouble-visualizing-twitter-data/28139)

<div class="topic-metadata">

**Author:** [@CodingNovice](https://discourse.processing.org/u/CodingNovice)\
**Replies:** 0\
**Last updated:** [February 28, 2021, 3:52pm UTC](https://discourse.processing.org/t/having-trouble-visualizing-twitter-data/28139 "2021-02-28T15:52:00Z")

</div>

Hi! I’m a processing novice and only have a limited understanding of coding, but I’m putting together a sketch for my final project in class. I have the basic code where every time the mouse is pressed, orbs spawn in a …

---

## [Test whether a button has been pressed even when the program is minimized](https://discourse.processing.org/t/test-whether-a-button-has-been-pressed-even-when-the-program-is-minimized/28114)

<div class="topic-metadata">

**Author:** [@Flolo](https://discourse.processing.org/u/Flolo)\
**Replies:** 0\
**Last updated:** [February 27, 2021, 2:24pm UTC](https://discourse.processing.org/t/test-whether-a-button-has-been-pressed-even-when-the-program-is-minimized/28114 "2021-02-27T14:24:22Z")

</div>

Hi I want to create a program that runs in the background and tests whether a key has been pressed. Like a keylogger… I need that because when I press ALT & S, for example, I want to take a screenshot. Here is the Code…

---

## [Score help 30 hello](https://discourse.processing.org/t/score-help-30-hello/28110)

<div class="topic-metadata">

**Author:** [@Mrcroissant](https://discourse.processing.org/u/Mrcroissant)\
**Replies:** 1\
**Last updated:** [February 27, 2021, 12:33pm UTC](https://discourse.processing.org/t/score-help-30-hello/28110 "2021-02-27T12:33:27Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hello i want too stop the programe when the score go to 30 how i can do that int x,y, couleur; // Déclaration variables coordonées …

---

## [Font on Button Processing an controlP5](https://discourse.processing.org/t/font-on-button-processing-an-controlp5/28094)

<div class="topic-metadata">

**Author:** [@deerfox](https://discourse.processing.org/u/deerfox)\
**Replies:** 2\
**Last updated:** [February 27, 2021, 10:16am UTC](https://discourse.processing.org/t/font-on-button-processing-an-controlp5/28094 "2021-02-27T10:16:40Z")

</div>

Hi everyone, I try to set my font on my button, i tried a few thinks like public ControlFont(processing.core.PFont theFont) but it doesen’t really work but its my first projekt with processing an controlP5, I also tr…

---

## [How to use nested for-loop to draw a tree](https://discourse.processing.org/t/how-to-use-nested-for-loop-to-draw-a-tree/28102)

<div class="topic-metadata">

**Author:** [@Yeladogg](https://discourse.processing.org/u/Yeladogg)\
**Replies:** 2\
**Last updated:** [February 27, 2021, 2:18am UTC](https://discourse.processing.org/t/how-to-use-nested-for-loop-to-draw-a-tree/28102 "2021-02-27T02:18:08Z")

</div>

Hi everyone, Should I use nested triple for loop to do it? This is my goal: here is my code : int x,y,w,h; void setup() { background(255); size(500, 500); x=250;//The center of the starting circle at the t…

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

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