# Latest

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

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

**Page:** 181

---

## [How to Position Shape based on display size](https://discourse.processing.org/t/how-to-position-shape-based-on-display-size/33238)

<div class="topic-metadata">

**Author:** [@avong](https://discourse.processing.org/u/avong)\
**Replies:** 5\
**Last updated:** [November 3, 2021, 11:12am UTC](https://discourse.processing.org/t/how-to-position-shape-based-on-display-size/33238 "2021-11-03T11:12:59Z")

</div>

I wish to position buttons by calculating the x and y coordinates based on the display size. I did something like this: My laptop screen pixel is 1600x900. \< float x\_button1 =displayWidth-displayWidth/6; float y\_but…

---

## [Creating perlin noise spheres/ blobs that reacts to mic on p5.js](https://discourse.processing.org/t/creating-perlin-noise-spheres-blobs-that-reacts-to-mic-on-p5-js/33243)

<div class="topic-metadata">

**Author:** [@timtam198](https://discourse.processing.org/u/timtam198)\
**Replies:** 1\
**Last updated:** [November 3, 2021, 6:40am UTC](https://discourse.processing.org/t/creating-perlin-noise-spheres-blobs-that-reacts-to-mic-on-p5-js/33243 "2021-11-03T06:40:12Z")

</div>

Hello, I am trying to create spheres that moves/distorts with mic inputs. I am trying to create a “blob” effect and found out that perlin noise creates an effect similar to what I envision. Does anyone knows how to apply…

---

## [ERROR: The sketch path is not set](https://discourse.processing.org/t/error-the-sketch-path-is-not-set/33248)

<div class="topic-metadata">

**Author:** [@lee](https://discourse.processing.org/u/lee)\
**Replies:** 1\
**Last updated:** [November 3, 2021, 12:45am UTC](https://discourse.processing.org/t/error-the-sketch-path-is-not-set/33248 "2021-11-03T00:45:16Z")

</div>

This feels like an amateur question but I can’t seem to solve. I’m on Ubuntu 18.04 and have this issue with both Processing 3.5.4 as well as 4.0 When I try to run a sketch I get the following error: The sketch path is …

---

## [\[Processing Android\] BLE GATT EXAMPLE](https://discourse.processing.org/t/processing-android-ble-gatt-example/33239)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 3\
**Last updated:** [November 2, 2021, 11:45pm UTC](https://discourse.processing.org/t/processing-android-ble-gatt-example/33239 "2021-11-02T23:45:50Z")

</div>

VIDEO(YOUTUBE) https://youtu.be/ilDFFb0BbH4 https://youtu.be/ilDFFb0BbH4 Processing SOURCE CODE BLE\_UART\_RAYTEMPBLUE.zip - Google Drive (You need to find the UUID carefully and write it down.) Arduino Code …

---

## [Merging two sketches (pt.2)](https://discourse.processing.org/t/merging-two-sketches-pt-2/33259)

<div class="topic-metadata">

**Author:** [@acb](https://discourse.processing.org/u/acb)\
**Replies:** 5\
**Last updated:** [November 2, 2021, 9:13pm UTC](https://discourse.processing.org/t/merging-two-sketches-pt-2/33259 "2021-11-02T21:13:35Z")

</div>

As mentioned in my last post, I am trying to merge these codes but I keep getting the error; “java.lang.reflect.InvocationTargetException” . From my research I was not able to understand (I am new to coding), could anyon…

---

## [How do I setUniform for an array of a custom struct?](https://discourse.processing.org/t/how-do-i-setuniform-for-an-array-of-a-custom-struct/33267)

<div class="topic-metadata">

**Author:** [@modusponens](https://discourse.processing.org/u/modusponens)\
**Replies:** 2\
**Last updated:** [November 2, 2021, 7:51pm UTC](https://discourse.processing.org/t/how-do-i-setuniform-for-an-array-of-a-custom-struct/33267 "2021-11-02T19:51:54Z")

</div>

I have a shader with this struct defined in it: struct LightInputData { vec3 worldPos; vec3 color; vec3 falloff; }; and it has this uniform variable: uniform LightInputData uPointLights\[8\]; How can I set this u…

---

## [How to check if "marco" is typed in textbox?](https://discourse.processing.org/t/how-to-check-if-marco-is-typed-in-textbox/33255)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 1\
**Last updated:** [November 2, 2021, 6:16pm UTC](https://discourse.processing.org/t/how-to-check-if-marco-is-typed-in-textbox/33255 "2021-11-02T18:16:08Z")

</div>

how to check if marco is entered in the textbox and increase balance\[0\] by 75 when this happens for the first time static final int NUM = 2; final TextBox\[\] tboxes = new TextBox\[NUM\]; int idx; PImage shop; PImage …

---

## [Change button name programmatically](https://discourse.processing.org/t/change-button-name-programmatically/33257)

<div class="topic-metadata">

**Author:** [@Clark](https://discourse.processing.org/u/Clark)\
**Replies:** 2\
**Last updated:** [November 2, 2021, 5:04pm UTC](https://discourse.processing.org/t/change-button-name-programmatically/33257 "2021-11-02T17:04:08Z")

</div>

Hi. Is it possible to change the name of a button programmatically? Something like: button = createButton("one"); button.position(0, 0); button.mousePressed(changeName); function changeName() { button.value = "two"…

---

## [I want to create a pattern where i have 4 different squares in different colours that directly change color as a code. This is what i have, but i dont know how to change the color of the sqaures and then turn them back to normal in one time. Please help](https://discourse.processing.org/t/i-want-to-create-a-pattern-where-i-have-4-different-squares-in-different-colours-that-directly-change-color-as-a-code-this-is-what-i-have-but-i-dont-know-how-to-change-the-color-of-the-sqaures-and-then-turn-them-back-to-normal-in-one-time-please-help/33254)

<div class="topic-metadata">

**Author:** [@LeRonald](https://discourse.processing.org/u/LeRonald)\
**Replies:** 1\
**Last updated:** [November 2, 2021, 12:25pm UTC](https://discourse.processing.org/t/i-want-to-create-a-pattern-where-i-have-4-different-squares-in-different-colours-that-directly-change-color-as-a-code-this-is-what-i-have-but-i-dont-know-how-to-change-the-color-of-the-sqaures-and-then-turn-them-back-to-normal-in-one-time-please-help/33254 "2021-11-02T12:25:27Z")

</div>

please format code with \</\> button \* homework policy \* asking questions int lastTimeCheck; int timeIntervalFlag = 3000; // 3 seconds because we are working with millis void setup() { size(500,500); background(0); …

---

## [Merging two sketches (for a school project)](https://discourse.processing.org/t/merging-two-sketches-for-a-school-project/33231)

<div class="topic-metadata">

**Author:** [@acb](https://discourse.processing.org/u/acb)\
**Replies:** 3\
**Last updated:** [November 2, 2021, 12:44pm UTC](https://discourse.processing.org/t/merging-two-sketches-for-a-school-project/33231 "2021-11-02T12:44:23Z")

</div>

I have been working on two codes that I would now like to have in the same frame, one over the other. I am asking for advice or just straight up the full solutions to merging these two codes. I have tried everything that…

---

## [ControlP5 Radio button event](https://discourse.processing.org/t/controlp5-radio-button-event/33081)

<div class="topic-metadata">

**Author:** [@MattC](https://discourse.processing.org/u/MattC)\
**Replies:** 2\
**Last updated:** [November 2, 2021, 11:27am UTC](https://discourse.processing.org/t/controlp5-radio-button-event/33081 "2021-11-02T11:27:55Z")

</div>

Hi All, I tried to make an sketch with some ControlP5 elements (knobs and radio buttons). Idea is to based on the selected radio button, change specific value with knob. This I got working. the harder part is when i …

---

## [How do I reverse the animation of a drawing in P5JS (more details in post)](https://discourse.processing.org/t/how-do-i-reverse-the-animation-of-a-drawing-in-p5js-more-details-in-post/33245)

<div class="topic-metadata">

**Author:** [@mrloosid](https://discourse.processing.org/u/mrloosid)\
**Replies:** 1\
**Last updated:** [November 2, 2021, 9:24am UTC](https://discourse.processing.org/t/how-do-i-reverse-the-animation-of-a-drawing-in-p5js-more-details-in-post/33245 "2021-11-02T09:24:31Z")

</div>

Source Code: p5.js Web Editor Basically I’m trying to do a pseudo generative poster that swaps between 3 artworks that I have predesigned. The idea is to make load one artpiece, wait a few seconds then reverse (essentia…

---

## [How draw shapes in accordion?](https://discourse.processing.org/t/how-draw-shapes-in-accordion/33249)

<div class="topic-metadata">

**Author:** [@yujunah](https://discourse.processing.org/u/yujunah)\
**Replies:** 0\
**Last updated:** [November 2, 2021, 7:05am UTC](https://discourse.processing.org/t/how-draw-shapes-in-accordion/33249 "2021-11-02T07:05:35Z")

</div>

import controlP5.\*; ControlP5 cp5; Accordion accordion; color c = color(0, 160, 100); void setup() { size(400, 600); noStroke(); smooth(); gui(); } void gui() { cp5 = new ControlP5(this); // group number 1, c…

---

## [Creating perlin noise spheres/ blobs that reacts to mic](https://discourse.processing.org/t/creating-perlin-noise-spheres-blobs-that-reacts-to-mic/33241)

<div class="topic-metadata">

**Author:** [@timtam198](https://discourse.processing.org/u/timtam198)\
**Replies:** 0\
**Last updated:** [November 2, 2021, 4:23am UTC](https://discourse.processing.org/t/creating-perlin-noise-spheres-blobs-that-reacts-to-mic/33241 "2021-11-02T04:23:38Z")

</div>

Hello, I am trying to create spheres that reacts and distorts with mic inputs. I did some research and thought that perlin noise can create the effect I visualise. I wonder if anyone knows how to add perlin noise to my s…

---

## [Text position on screen](https://discourse.processing.org/t/text-position-on-screen/33234)

<div class="topic-metadata">

**Author:** [@hacketet](https://discourse.processing.org/u/hacketet)\
**Replies:** 4\
**Last updated:** [November 2, 2021, 1:54am UTC](https://discourse.processing.org/t/text-position-on-screen/33234 "2021-11-02T01:54:54Z")

</div>

Here’s the code I had to use to get text placed in a 30 x 22 rectangle. From the documentation I expected th using the diagonal coordinates of the rectangle to properly place the text, but it was WAY off. I had to mult…

---

## [Strategy for drawing tree contour](https://discourse.processing.org/t/strategy-for-drawing-tree-contour/33127)

<div class="topic-metadata">

**Author:** [@ishback](https://discourse.processing.org/u/ishback)\
**Replies:** 7\
**Last updated:** [November 2, 2021, 12:53am UTC](https://discourse.processing.org/t/strategy-for-drawing-tree-contour/33127 "2021-11-02T00:53:59Z")

</div>

Hello, I’m trying to draw the contour of a tree. This is how I’m doing it so far: Create the branches (center line, in green) Create segments for each branch. Each segment stores a length, an angle, and a thickness. C…

---

## [How to have textbox only appear when boolean is true?](https://discourse.processing.org/t/how-to-have-textbox-only-appear-when-boolean-is-true/33235)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 0\
**Last updated:** [November 1, 2021, 9:10pm UTC](https://discourse.processing.org/t/how-to-have-textbox-only-appear-when-boolean-is-true/33235 "2021-11-01T21:10:21Z")

</div>

I want to make the textbox only appear when killb=true, how do i do this? static final int NUM = 2; final TextBox\[\] tboxes = new TextBox\[NUM\]; int idx; PImage shop; PImage settings; PImage teams; PImage kill; PImage…

---

## [Scaling down & rotating a pattern causes rendering issues and flickering](https://discourse.processing.org/t/scaling-down-rotating-a-pattern-causes-rendering-issues-and-flickering/33227)

<div class="topic-metadata">

**Author:** [@miracle2k](https://discourse.processing.org/u/miracle2k)\
**Replies:** 1\
**Last updated:** [November 1, 2021, 8:49pm UTC](https://discourse.processing.org/t/scaling-down-rotating-a-pattern-causes-rendering-issues-and-flickering/33227 "2021-11-01T20:49:58Z")

</div>

Take this sketch as an example, which I created to reproduce the problem in isolation: https://editor.p5js.org/elsdoerfer/sketches/NrPcyu-mG It’s supposed to be a striped line pattern. I want it to be very fine, 1px li…

---

## [Nf() number format decimal places to array using for loop](https://discourse.processing.org/t/nf-number-format-decimal-places-to-array-using-for-loop/33182)

<div class="topic-metadata">

**Author:** [@louise00](https://discourse.processing.org/u/louise00)\
**Replies:** 4\
**Last updated:** [November 1, 2021, 6:36pm UTC](https://discourse.processing.org/t/nf-number-format-decimal-places-to-array-using-for-loop/33182 "2021-11-01T18:36:05Z")

</div>

I’m migrating from p5js to processing and something from p5js that works really well its just getting stuck in processing. I’m trying to: • Define a PImage array • Load a set of images that are named 0.jpg ~ 11.jpg • …

---

## [Why is it not displaying my typed keys?](https://discourse.processing.org/t/why-is-it-not-displaying-my-typed-keys/33230)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 0\
**Last updated:** [November 1, 2021, 6:24pm UTC](https://discourse.processing.org/t/why-is-it-not-displaying-my-typed-keys/33230 "2021-11-01T18:24:39Z")

</div>

i would like text to show up in the rectangle that appears when kill is true, but it’s not working. why? PImage shop; PImage settings; PImage teams; PImage kill; PImage phone; PImage coin; PImage bounty; boolean invert…

---

## [Calling a PShape too many times](https://discourse.processing.org/t/calling-a-pshape-too-many-times/33209)

<div class="topic-metadata">

**Author:** [@bcabc](https://discourse.processing.org/u/bcabc)\
**Replies:** 1\
**Last updated:** [November 1, 2021, 5:58pm UTC](https://discourse.processing.org/t/calling-a-pshape-too-many-times/33209 "2021-11-01T17:58:57Z")

</div>

Hi there - I am calling PShape Shape1 within a for loop. for (Shape1 mod : mods) { mod.display(); I have set a value for an array of mods elsewhere in the code. mods = new Shape1\[count\*someother\]; My issue …

---

## [Movement to where I touch on the screen](https://discourse.processing.org/t/movement-to-where-i-touch-on-the-screen/33193)

<div class="topic-metadata">

**Author:** [@tati1202](https://discourse.processing.org/u/tati1202)\
**Replies:** 3\
**Last updated:** [November 1, 2021, 3:50pm UTC](https://discourse.processing.org/t/movement-to-where-i-touch-on-the-screen/33193 "2021-11-01T15:50:36Z")

</div>

Hey, I’m working in this videogame where you have to shoot the ball pressing in x place in the net/goal. Does anyone knows how to incorporate this with easy coding? Thanks

---

## [Array sorting of file paths](https://discourse.processing.org/t/array-sorting-of-file-paths/33096)

<div class="topic-metadata">

**Author:** [@garrettlynch](https://discourse.processing.org/u/garrettlynch)\
**Replies:** 8\
**Last updated:** [November 1, 2021, 10:17am UTC](https://discourse.processing.org/t/array-sorting-of-file-paths/33096 "2021-11-01T10:17:33Z")

</div>

I am creating an array from a directory of images using listFiles() and then sorting them like so. images = dir.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { …

---

## [How to create a good fractal zoom?](https://discourse.processing.org/t/how-to-create-a-good-fractal-zoom/33217)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 0\
**Last updated:** [November 1, 2021, 9:29am UTC](https://discourse.processing.org/t/how-to-create-a-good-fractal-zoom/33217 "2021-11-01T09:29:30Z")

</div>

Hi! I created a mandelbrot set explorer, with which, you can zoom into the fractal if you use the mouse wheel. But I can’t seem to get the mouse wheel zoom working correctly. What can I do to fix it? Right now, both zo…

---

## [Color interpolation in HSB - how to go the "closest" direction?](https://discourse.processing.org/t/color-interpolation-in-hsb-how-to-go-the-closest-direction/33211)

<div class="topic-metadata">

**Author:** [@dtreybig](https://discourse.processing.org/u/dtreybig)\
**Replies:** 2\
**Last updated:** [November 1, 2021, 7:13am UTC](https://discourse.processing.org/t/color-interpolation-in-hsb-how-to-go-the-closest-direction/33211 "2021-11-01T07:13:48Z")

</div>

Hi! I am exploring doing some color gradients in something I am working on. I generally have the core structure working well, defining multiple colors and using lerpColor() to linearly interpolate between them. The chal…

---

## [The pixels array is null using setTexture()](https://discourse.processing.org/t/the-pixels-array-is-null-using-settexture/23712)

<div class="topic-metadata">

**Author:** [@garrettlynch](https://discourse.processing.org/u/garrettlynch)\
**Replies:** 8\
**Last updated:** [October 31, 2021, 10:46pm UTC](https://discourse.processing.org/t/the-pixels-array-is-null-using-settexture/23712 "2021-10-31T22:46:08Z")

</div>

Running the simple sketch below on Android I keep getting “The pixels array is null.” error. The error does not happen when I use Java mode on my computer. From what I’ve read this error is usually caused by a missing lo…

---

## [Cross-language random numbers](https://discourse.processing.org/t/cross-language-random-numbers/3474)

<div class="topic-metadata">

**Author:** [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Replies:** 21\
**Last updated:** [October 31, 2021, 9:23pm UTC](https://discourse.processing.org/t/cross-language-random-numbers/3474 "2021-10-31T21:23:35Z")

</div>

I have developed a set of demo sketches that implement simple cross-language random numbers. The goal is to make it easy to adapt a sketch between Processing (Java), p5.js (JavaScript), or Processing.py (Python) such th…

---

## [How to make more images appear over time?](https://discourse.processing.org/t/how-to-make-more-images-appear-over-time/33194)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 1\
**Last updated:** [October 31, 2021, 6:50pm UTC](https://discourse.processing.org/t/how-to-make-more-images-appear-over-time/33194 "2021-10-31T18:50:40Z")

</div>

hey right now there is only one “trash” image but i’m trying to make it so the amount of “trash” images is equal to score+1 here’s my code: float trashX; float trashY; float boatX; float boatY; float ropelenght = 0; …

---

## [Web Server. Load image?](https://discourse.processing.org/t/web-server-load-image/20356)

<div class="topic-metadata">

**Author:** [@Omnimusha](https://discourse.processing.org/u/Omnimusha)\
**Replies:** 2\
**Last updated:** [October 31, 2021, 9:40am UTC](https://discourse.processing.org/t/web-server-load-image/20356 "2021-10-31T09:40:35Z")

</div>

Hi. how to upload an image from my pc? c.write("\<img src=1.jpg\>"); import processing.net.\*; String HTTP\_GET\_REQUEST = "GET /"; String HTTP\_HEADER = "HTTP/1.0 200 OK\\r\\nContent-Type: text/html\\r\\n\\r\\n"; Server s; Clie…

---

## [Overlapping one sound multiple times with minim library](https://discourse.processing.org/t/overlapping-one-sound-multiple-times-with-minim-library/32878)

<div class="topic-metadata">

**Author:** [@rojele](https://discourse.processing.org/u/rojele)\
**Replies:** 8\
**Last updated:** [October 31, 2021, 5:29am UTC](https://discourse.processing.org/t/overlapping-one-sound-multiple-times-with-minim-library/32878 "2021-10-31T05:29:09Z")

</div>

Hi, I’m working on the sound part of an interactive installation that would need an event to be triggered by osc an undefined number of times, making the sound linked to it overlaps instead of being rewinded and started …

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

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