# Coding Questions

**URL:** https://discourse.processing.org/c/processing/processing-questions/15.md?page=94

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

**Page:** 95

---

## [Issue with using keyReleased() to pause row of moving ellipses](https://discourse.processing.org/t/issue-with-using-keyreleased-to-pause-row-of-moving-ellipses/20816)

<div class="topic-metadata">

**Author:** [@user6886](https://discourse.processing.org/u/user6886)\
**Replies:** 11\
**Last updated:** [May 14, 2020, 1:53pm UTC](https://discourse.processing.org/t/issue-with-using-keyreleased-to-pause-row-of-moving-ellipses/20816 "2020-05-14T13:53:55Z")

</div>

Hello! I posted this on StackOverflow, but don’t seem to be having any luck with answers, and would really appreciate some help please. I’m having some trouble with a program I’m altering in Processing. This is the link…

---

## [Reset grid back to white](https://discourse.processing.org/t/reset-grid-back-to-white/20782)

<div class="topic-metadata">

**Author:** [@alex](https://discourse.processing.org/u/alex)\
**Replies:** 12\
**Last updated:** [May 14, 2020, 11:34am UTC](https://discourse.processing.org/t/reset-grid-back-to-white/20782 "2020-05-14T11:34:54Z")

</div>

Hi all. I’m new to Processing. I have managed to make this grid of squares which is assigned a random colour after each mouse click. After all the squares have been filled, I want to reset the squares back to white one …

---

## [Problem looping through a 4D array](https://discourse.processing.org/t/problem-looping-through-a-4d-array/20444)

<div class="topic-metadata">

**Author:** [@timAllan](https://discourse.processing.org/u/timAllan)\
**Replies:** 34\
**Last updated:** [May 12, 2020, 4:39pm UTC](https://discourse.processing.org/t/problem-looping-through-a-4d-array/20444 "2020-05-12T16:39:42Z")

</div>

Hello! I want to create an animation based on the greyscale values (0-255) of each pixel in an image. Each pixel in the image would be represented by drawing a ‘grid’ (say, 4 rows \* 3 columns) of squares (rects), with…

---

## [Flashlight example, Image and Pixels tut](https://discourse.processing.org/t/flashlight-example-image-and-pixels-tut/20683)

<div class="topic-metadata">

**Author:** [@Fibonacci](https://discourse.processing.org/u/Fibonacci)\
**Replies:** 2\
**Last updated:** [May 14, 2020, 8:03am UTC](https://discourse.processing.org/t/flashlight-example-image-and-pixels-tut/20683 "2020-05-14T08:03:00Z")

</div>

Hi, This is my first post, so please be kind if I missed something regarding rules/etiquette. So, working through all the tuts so far and everything is fine, except I’m really trying to conceptualize what two lines are…

---

## [Running really slow for a relatively simple program](https://discourse.processing.org/t/running-really-slow-for-a-relatively-simple-program/20762)

<div class="topic-metadata">

**Author:** [@Xabdro](https://discourse.processing.org/u/Xabdro)\
**Replies:** 4\
**Last updated:** [May 14, 2020, 6:23am UTC](https://discourse.processing.org/t/running-really-slow-for-a-relatively-simple-program/20762 "2020-05-14T06:23:54Z")

</div>

I’ve made much more complicated programs than this yet its running at 30fps when at low resolution. If I go fullscreen it drops to less than ten fps. I think I must be missing something really obvious that is causing thi…

---

## [Mapping a specified number to an argument in Perlin Noise space](https://discourse.processing.org/t/mapping-a-specified-number-to-an-argument-in-perlin-noise-space/20747)

<div class="topic-metadata">

**Author:** [@yajnya](https://discourse.processing.org/u/yajnya)\
**Replies:** 1\
**Last updated:** [May 14, 2020, 5:47am UTC](https://discourse.processing.org/t/mapping-a-specified-number-to-an-argument-in-perlin-noise-space/20747 "2020-05-14T05:47:12Z")

</div>

Hello everyone, I am very new to processing. recently, I watched The coding train’s 3d terrain generation using Pelrin noise tutorial. I am also trying to create a terrain consisting of mountains. However, I want my mo…

---

## [Question about movement](https://discourse.processing.org/t/question-about-movement/20619)

<div class="topic-metadata">

**Author:** [@Arsenii](https://discourse.processing.org/u/Arsenii)\
**Replies:** 0\
**Last updated:** [May 8, 2020, 8:18am UTC](https://discourse.processing.org/t/question-about-movement/20619 "2020-05-08T08:18:42Z")

</div>

I have a problem with method move() in Bolder class. The idea is that method move() creates a vector aiming to object of class spaceShip. But it doesn’t work and i can’t understand why. Also I have a problem with deleti…

---

## [Extend mouseX position beyond screen](https://discourse.processing.org/t/extend-mousex-position-beyond-screen/20605)

<div class="topic-metadata">

**Author:** [@JunQu](https://discourse.processing.org/u/JunQu)\
**Replies:** 16\
**Last updated:** [May 14, 2020, 12:59am UTC](https://discourse.processing.org/t/extend-mousex-position-beyond-screen/20605 "2020-05-14T00:59:26Z")

</div>

As the topic states, I need to be able to move my mouseX “outside” of the screen, as if my screen was endless. I need it to be able to endlessly rotate a box on the x axis. The cursor should not leave the screen at any p…

---

## [Better Way To Determine Pixel's Hue Range](https://discourse.processing.org/t/better-way-to-determine-pixels-hue-range/20842)

<div class="topic-metadata">

**Author:** [@derivativejojomemes](https://discourse.processing.org/u/derivativejojomemes)\
**Replies:** 4\
**Last updated:** [May 13, 2020, 9:12pm UTC](https://discourse.processing.org/t/better-way-to-determine-pixels-hue-range/20842 "2020-05-13T21:12:05Z")

</div>

Hi! I’m working on an application that assigns color names based on the hue of a pixel in an image. The method I am currently using is inelegant: Create a String array that holds the names of colors that I want to use…

---

## [Interactive keyboard for a smartwatch processing](https://discourse.processing.org/t/interactive-keyboard-for-a-smartwatch-processing/20726)

<div class="topic-metadata">

**Author:** [@matildespinheiro](https://discourse.processing.org/u/matildespinheiro)\
**Replies:** 10\
**Last updated:** [May 13, 2020, 5:44pm UTC](https://discourse.processing.org/t/interactive-keyboard-for-a-smartwatch-processing/20726 "2020-05-13T17:44:07Z")

</div>

How can I do this but instead of 1-100kg I wanted from a-z. This is how it would work: when you press and start dragging the letters would change when you release the mouse the letter on top of the row is the letter…

---

## [Help with collision between two array objects](https://discourse.processing.org/t/help-with-collision-between-two-array-objects/20827)

<div class="topic-metadata">

**Author:** [@maverick24](https://discourse.processing.org/u/maverick24)\
**Replies:** 1\
**Last updated:** [May 13, 2020, 3:02pm UTC](https://discourse.processing.org/t/help-with-collision-between-two-array-objects/20827 "2020-05-13T15:02:23Z")

</div>

I’m a beginner coder learning in Processing and I’m trying to figure out how I can detect a collision between two array objects so that both objects can no longer display on the screen. The game is a shooter game, but I…

---

## [How to reset a grid back to white with timer](https://discourse.processing.org/t/how-to-reset-a-grid-back-to-white-with-timer/20810)

<div class="topic-metadata">

**Author:** [@alex](https://discourse.processing.org/u/alex)\
**Replies:** 2\
**Last updated:** [May 13, 2020, 5:46am UTC](https://discourse.processing.org/t/how-to-reset-a-grid-back-to-white-with-timer/20810 "2020-05-13T05:46:03Z")

</div>

Hi so I have a grid of 5\*5 that I have filled with random colours with each individual mouseClick. How do I reset the grid back to white with the next mouseClick? Also how do I use a timer so that the resetting animati…

---

## ["Waited 5000ms for" issue](https://discourse.processing.org/t/waited-5000ms-for-issue/10830)

<div class="topic-metadata">

**Author:** [@rogerotein](https://discourse.processing.org/u/rogerotein)\
**Replies:** 12\
**Last updated:** [May 13, 2020, 3:32am UTC](https://discourse.processing.org/t/waited-5000ms-for-issue/10830 "2020-05-13T03:32:00Z")

</div>

Hi everyone, I have encountered a problem with four nested for loops, where for each cell (X, Y), I look into all other cells to add up the distances to certain type of cells. The result is something like metaball. The…

---

## [How to add gravity to this example?](https://discourse.processing.org/t/how-to-add-gravity-to-this-example/20751)

<div class="topic-metadata">

**Author:** [@Pepbaggen](https://discourse.processing.org/u/Pepbaggen)\
**Replies:** 2\
**Last updated:** [May 12, 2020, 1:06am UTC](https://discourse.processing.org/t/how-to-add-gravity-to-this-example/20751 "2020-05-12T01:06:12Z")

</div>

Thanks in advance!!! int schermMode = 0; //begint bij beginscherm PImage img; int punten = 0; float schiethoek = 0; //schiethoek : -100 float schiethoekrekenen; PVector plaats; //xt --\> uitendelijke pos PVector snelheid…

---

## [Changing from moving the grid to moving box()](https://discourse.processing.org/t/changing-from-moving-the-grid-to-moving-box/20740)

<div class="topic-metadata">

**Author:** [@JunQu](https://discourse.processing.org/u/JunQu)\
**Replies:** 3\
**Last updated:** [May 11, 2020, 10:46pm UTC](https://discourse.processing.org/t/changing-from-moving-the-grid-to-moving-box/20740 "2020-05-11T22:46:18Z")

</div>

I don’t know how to form the right topic, although I believe it explains enough. Right now, my movement controls the grid (WASD). This stops me from creating independent “enemy” boxes. I would like to make the grid stati…

---

## [Can you print a pdf file?](https://discourse.processing.org/t/can-you-print-a-pdf-file/20743)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 0\
**Last updated:** [May 11, 2020, 10:40am UTC](https://discourse.processing.org/t/can-you-print-a-pdf-file/20743 "2020-05-11T10:40:24Z")

</div>

Can you print a pdf file? Good morning. You can print jpg files, but it is difficult to print pdf files. Is there any way? \[jpg printer code\] import java.io.FileInputStream; import javax.print.Doc; import javax.prin…

---

## [Class problem: Place four Sketches on the screen](https://discourse.processing.org/t/class-problem-place-four-sketches-on-the-screen/20689)

<div class="topic-metadata">

**Author:** [@Filo96ge](https://discourse.processing.org/u/Filo96ge)\
**Replies:** 11\
**Last updated:** [May 11, 2020, 2:39pm UTC](https://discourse.processing.org/t/class-problem-place-four-sketches-on-the-screen/20689 "2020-05-11T14:39:06Z")

</div>

Hi guys I have this situation: I created an exercise where inside of it I created a class object called A\_square, but my goal would be has in a square 666x666, four different classes (A\_B\_C\_D) which different graphic out…

---

## [Let user input date and time and store it as variable](https://discourse.processing.org/t/let-user-input-date-and-time-and-store-it-as-variable/20705)

<div class="topic-metadata">

**Author:** [@kimikim](https://discourse.processing.org/u/kimikim)\
**Replies:** 2\
**Last updated:** [May 10, 2020, 9:39pm UTC](https://discourse.processing.org/t/let-user-input-date-and-time-and-store-it-as-variable/20705 "2020-05-10T21:39:22Z")

</div>

hello… I am a beginner in processing may I know how can I let user enter date and time of their choice and then assign it to a variable in date and time format because 1 want to compare the input time with current t…

---

## [Reading / Writing HSB values](https://discourse.processing.org/t/reading-writing-hsb-values/20710)

<div class="topic-metadata">

**Author:** [@IRIGIMA](https://discourse.processing.org/u/IRIGIMA)\
**Replies:** 9\
**Last updated:** [May 10, 2020, 9:34pm UTC](https://discourse.processing.org/t/reading-writing-hsb-values/20710 "2020-05-10T21:34:36Z")

</div>

Using the below code, trying to read the HSB values from PGraphics screen. Reading is from random areas. As a test, am currently writing back read values expecting no change. Running code shows change as should show u…

---

## [Can you help me understand why b = null in draw function is incorrect](https://discourse.processing.org/t/can-you-help-me-understand-why-b-null-in-draw-function-is-incorrect/20713)

<div class="topic-metadata">

**Author:** [@Arsenii](https://discourse.processing.org/u/Arsenii)\
**Replies:** 2\
**Last updated:** [May 10, 2020, 7:34pm UTC](https://discourse.processing.org/t/can-you-help-me-understand-why-b-null-in-draw-function-is-incorrect/20713 "2020-05-10T19:34:43Z")

</div>

Can you help me understand why b = null in draw function is incorrect import java.util.List; import java.util.ArrayList; spaceShip ship; boolean left = false; boolean right = false; boolean forward = false; int maxQu…

---

## [Help with updating variable for tank game](https://discourse.processing.org/t/help-with-updating-variable-for-tank-game/20645)

<div class="topic-metadata">

**Author:** [@Pepbaggen](https://discourse.processing.org/u/Pepbaggen)\
**Replies:** 3\
**Last updated:** [May 10, 2020, 3:47pm UTC](https://discourse.processing.org/t/help-with-updating-variable-for-tank-game/20645 "2020-05-10T15:47:27Z")

</div>

Hi! I’m new to the platform but i have a question… Sorry for all the Dutch ‘variable-names’, however, i hope you will understand. I want to tilt my tank gun, and the value ‘schiethoek, (angle)’ changes. So the ball’s ve…

---

## [I have questions about visualization data](https://discourse.processing.org/t/i-have-questions-about-visualization-data/20648)

<div class="topic-metadata">

**Author:** [@ranaulubas](https://discourse.processing.org/u/ranaulubas)\
**Replies:** 3\
**Last updated:** [May 10, 2020, 3:41pm UTC](https://discourse.processing.org/t/i-have-questions-about-visualization-data/20648 "2020-05-10T15:41:47Z")

</div>

this is a study that I have done using the data of two different months to visualize this data, I want to fill in between these two different data, but I have not been successful in this matter. I have something wrong wi…

---

## [Processing text shifting issue](https://discourse.processing.org/t/processing-text-shifting-issue/20307)

<div class="topic-metadata">

**Author:** [@some](https://discourse.processing.org/u/some)\
**Replies:** 17\
**Last updated:** [April 30, 2020, 5:45pm UTC](https://discourse.processing.org/t/processing-text-shifting-issue/20307 "2020-04-30T17:45:12Z")

</div>

Hi i have issue with text() command here is a sorce code //Ascii Video Player String\[\] video; int heig,widt; int d; int textSizes=7; void setup(){ size(800,600); video = lo…

---

## [My text only appears for less than half a second](https://discourse.processing.org/t/my-text-only-appears-for-less-than-half-a-second/20701)

<div class="topic-metadata">

**Author:** [@anklesatrisk](https://discourse.processing.org/u/anklesatrisk)\
**Replies:** 1\
**Last updated:** [May 10, 2020, 6:01am UTC](https://discourse.processing.org/t/my-text-only-appears-for-less-than-half-a-second/20701 "2020-05-10T06:01:02Z")

</div>

My text only appears as soon as I press the button of which it’s supposed to run, but it only appears for less than a second. my code: int userNumber; float MyNumber = random (1, 10); int Guesses = 0; void setup() { …

---

## [Interactive Image Rasterization with Mouse](https://discourse.processing.org/t/interactive-image-rasterization-with-mouse/19953)

<div class="topic-metadata">

**Author:** [@anhng2611](https://discourse.processing.org/u/anhng2611)\
**Replies:** 8\
**Last updated:** [May 10, 2020, 1:38am UTC](https://discourse.processing.org/t/interactive-image-rasterization-with-mouse/19953 "2020-05-10T01:38:55Z")

</div>

Hi everyone, I’m pretty new to Processing and I’m trying to create a fun pixelate tool for image. I’ve archived the effect for the image by using this tutorial, which include drawing grids of rectangles using loop and g…

---

## [OSC - realtime display](https://discourse.processing.org/t/osc-realtime-display/20584)

<div class="topic-metadata">

**Author:** [@sanvip](https://discourse.processing.org/u/sanvip)\
**Replies:** 3\
**Last updated:** [May 10, 2020, 1:33am UTC](https://discourse.processing.org/t/osc-realtime-display/20584 "2020-05-10T01:33:40Z")

</div>

Hello Everyone, I am new to processing and I am working on a program to receive data from a third party software through OSC. I can successfully receive OSC messages and print them with the following code. Messages I r…

---

## [UI-related stuff](https://discourse.processing.org/t/ui-related-stuff/20692)

<div class="topic-metadata">

**Author:** [@sharmadhruv741](https://discourse.processing.org/u/sharmadhruv741)\
**Replies:** 2\
**Last updated:** [May 9, 2020, 9:57pm UTC](https://discourse.processing.org/t/ui-related-stuff/20692 "2020-05-09T21:57:38Z")

</div>

Hello everybody. I was trying to make a simple, UI-based sketch where I am trying display ascII characters by sifting through them using a ‘slider’. But, I’ve got stuck. Any help? stroke (255); noFill (); rect (re…

---

## [Camera rotation in 3D using mouse](https://discourse.processing.org/t/camera-rotation-in-3d-using-mouse/20563)

<div class="topic-metadata">

**Author:** [@JunQu](https://discourse.processing.org/u/JunQu)\
**Replies:** 7\
**Last updated:** [May 9, 2020, 9:27pm UTC](https://discourse.processing.org/t/camera-rotation-in-3d-using-mouse/20563 "2020-05-09T21:27:55Z")

</div>

I’m working on a personal project, and I want to create a camera that follows a box() around. That is however already done. My problem is, I want the box AND camera to rotate with the mouse. (See; every third person game…

---

## [Split a circle into 28 parts](https://discourse.processing.org/t/split-a-circle-into-28-parts/20650)

<div class="topic-metadata">

**Author:** [@matildespinheiro](https://discourse.processing.org/u/matildespinheiro)\
**Replies:** 10\
**Last updated:** [May 9, 2020, 7:38pm UTC](https://discourse.processing.org/t/split-a-circle-into-28-parts/20650 "2020-05-09T19:38:34Z")

</div>

Hi, I’m trying to split a circle into 28 parts to look something like this: But I can’t do it. Does someone know how to do it?

---

## [Is the a "load all text files in a directory" (\*.txt) function in processing?](https://discourse.processing.org/t/is-the-a-load-all-text-files-in-a-directory-txt-function-in-processing/20507)

<div class="topic-metadata">

**Author:** [@dtools22](https://discourse.processing.org/u/dtools22)\
**Replies:** 4\
**Last updated:** [May 9, 2020, 12:36pm UTC](https://discourse.processing.org/t/is-the-a-load-all-text-files-in-a-directory-txt-function-in-processing/20507 "2020-05-09T12:36:50Z")

</div>

Hello All, I have a more general question. I have a data analysis program I have been working on that takes in .txt files using loadStrings(). Before I run the program I am manually reformatting the names of the .txt …

[Previous page](https://discourse.processing.org/c/processing/processing-questions/15.md?page=93)

[Next page](https://discourse.processing.org/c/processing/processing-questions/15.md?page=95)
