# Latest

**URL:** https://discourse.processing.org/latest.md?page=196

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

**Page:** 197

---

## [Why is built-in bezier function more smooth than my custom bezier function?](https://discourse.processing.org/t/why-is-built-in-bezier-function-more-smooth-than-my-custom-bezier-function/31833)

<div class="topic-metadata">

**Author:** [@ibrahimak](https://discourse.processing.org/u/ibrahimak)\
**Replies:** 6\
**Last updated:** [August 25, 2021, 10:39am UTC](https://discourse.processing.org/t/why-is-built-in-bezier-function-more-smooth-than-my-custom-bezier-function/31833 "2021-08-25T10:39:28Z")

</div>

I’ve a linear interpolate function: Vector2 linearInterpolate(Vector2 p1, Vector2 p2, float value) { return p1.add(p2.sub(p1).mult(value)); } I’ve quadratic bezier curve function: Vector2 quadraticBezier(Vector2 p1,…

---

## [I want to change the Flocking](https://discourse.processing.org/t/i-want-to-change-the-flocking/32005)

<div class="topic-metadata">

**Author:** [@aug](https://discourse.processing.org/u/aug)\
**Replies:** 5\
**Last updated:** [September 2, 2021, 8:15am UTC](https://discourse.processing.org/t/i-want-to-change-the-flocking/32005 "2021-09-02T08:15:37Z")

</div>

I want to change the weight of cohesion only for the agent added by clicking in the sample code of Flocking. How do I change the code?

---

## [Getting to grips with vectorization in py5](https://discourse.processing.org/t/getting-to-grips-with-vectorization-in-py5/32023)

<div class="topic-metadata">

**Author:** [@monkstone](https://discourse.processing.org/u/monkstone)\
**Replies:** 4\
**Last updated:** [September 2, 2021, 8:14am UTC](https://discourse.processing.org/t/getting-to-grips-with-vectorization-in-py5/32023 "2021-09-02T08:14:01Z")

</div>

@solub, @tabreturn @villares thanks for some kind help from @hx2A I’m making progress with numpy and image processing in py5. Recently there has been some discussion about the quality of different noise implementations, …

---

## [Using Shapes in p5.js](https://discourse.processing.org/t/using-shapes-in-p5-js/32058)

<div class="topic-metadata">

**Author:** [@bcabc](https://discourse.processing.org/u/bcabc)\
**Replies:** 1\
**Last updated:** [September 2, 2021, 8:06am UTC](https://discourse.processing.org/t/using-shapes-in-p5-js/32058 "2021-09-02T08:06:26Z")

</div>

Hi there - I’m newish to Processing and looking to get a sketch up and running. Using Example 03: Objects Array from the Examples Folder, I’d like to replace the “ellipse” with a tailored “createShape” - but it doesn’t…

---

## [How get a sketch to run on startup of a Mac](https://discourse.processing.org/t/how-get-a-sketch-to-run-on-startup-of-a-mac/32052)

<div class="topic-metadata">

**Author:** [@GeorgeRoland](https://discourse.processing.org/u/GeorgeRoland)\
**Replies:** 3\
**Last updated:** [September 1, 2021, 11:08pm UTC](https://discourse.processing.org/t/how-get-a-sketch-to-run-on-startup-of-a-mac/32052 "2021-09-01T23:08:54Z")

</div>

I used Export Application in Processing to create an app. No errors were generated when it was created. This app runs fine if you click on it. However, if I put it in Login Items in an account set to auto login, the syst…

---

## [Writing to CSV, new set of rows each day, is it possible?](https://discourse.processing.org/t/writing-to-csv-new-set-of-rows-each-day-is-it-possible/32018)

<div class="topic-metadata">

**Author:** [@laptophead](https://discourse.processing.org/u/laptophead)\
**Replies:** 5\
**Last updated:** [September 1, 2021, 8:35pm UTC](https://discourse.processing.org/t/writing-to-csv-new-set-of-rows-each-day-is-it-possible/32018 "2021-09-01T20:35:02Z")

</div>

I have this recording function that updates every 5 sec and records data as such: void SaveToFile () { //table.clearRows(); //newRow.setInt("MACH ID", table.getRowCount() - 1); for (int i=1; i\<=10; i++) {Tabl…

---

## [Can't load images before setup()](https://discourse.processing.org/t/cant-load-images-before-setup/31998)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 4\
**Last updated:** [September 1, 2021, 8:16pm UTC](https://discourse.processing.org/t/cant-load-images-before-setup/31998 "2021-09-01T20:16:07Z")

</div>

Hi, I am not sure if this is a bug or a feature. Basically, you cannot load files before setup(). Example code PImage img = loadImage("clrPic.jpg"); int p\[\]\[\]; int v\[\]\[\]; void setup() { size(600, 800); p = new int\[…

---

## [Posterization filter explained?](https://discourse.processing.org/t/posterization-filter-explained/32001)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 5\
**Last updated:** [September 1, 2021, 7:35pm UTC](https://discourse.processing.org/t/posterization-filter-explained/32001 "2021-09-01T19:35:14Z")

</div>

Hi! I saw an interesting filter recently, its called posterization. In short terms, it sets the maximum number of colors in an image. You set the maximum of n-colors and only use them. So I have a few questions: H…

---

## [Is there a better way to compare multiple Strings?](https://discourse.processing.org/t/is-there-a-better-way-to-compare-multiple-strings/32024)

<div class="topic-metadata">

**Author:** [@chaotic](https://discourse.processing.org/u/chaotic)\
**Replies:** 4\
**Last updated:** [September 1, 2021, 7:17pm UTC](https://discourse.processing.org/t/is-there-a-better-way-to-compare-multiple-strings/32024 "2021-09-01T19:17:46Z")

</div>

I’m trying to write a code that will only allow you to enter certain numbers. I found a way but I feel like there should be a more efficient way. String text=""; String saved=""; String degree90="90"; String degree89="8…

---

## [How to improve movement with keys?](https://discourse.processing.org/t/how-to-improve-movement-with-keys/31856)

<div class="topic-metadata">

**Author:** [@Braunstein](https://discourse.processing.org/u/Braunstein)\
**Replies:** 9\
**Last updated:** [September 1, 2021, 2:44pm UTC](https://discourse.processing.org/t/how-to-improve-movement-with-keys/31856 "2021-09-01T14:44:52Z")

</div>

Heya, i picked up a project again that i dropped a while ago, and it includes a playable figure that is steered with w, a, s and d. But i noticed how the player would first kinda spazz out and then change direction with …

---

## [Sketch stuck in WEBGL mode and cannot switch back to P2D mode](https://discourse.processing.org/t/sketch-stuck-in-webgl-mode-and-cannot-switch-back-to-p2d-mode/32048)

<div class="topic-metadata">

**Author:** [@salmans911](https://discourse.processing.org/u/salmans911)\
**Replies:** 1\
**Last updated:** [September 1, 2021, 2:08pm UTC](https://discourse.processing.org/t/sketch-stuck-in-webgl-mode-and-cannot-switch-back-to-p2d-mode/32048 "2021-09-01T14:08:30Z")

</div>

Hello everyone, how do I programmatically switch the sketch from WEBGL mode back to P2D mode, it switches fine from P2D mode to WEBGL mode, but not back. I tried manually changing \_renderer with the P2D Object, but it st…

---

## [Text Input How To?](https://discourse.processing.org/t/text-input-how-to/32031)

<div class="topic-metadata">

**Author:** [@jhsa](https://discourse.processing.org/u/jhsa)\
**Replies:** 4\
**Last updated:** [September 1, 2021, 11:09am UTC](https://discourse.processing.org/t/text-input-how-to/32031 "2021-09-01T11:09:26Z")

</div>

Hi guys, I am stuck with something here. I am making an Eeprom editor for my for my DIY guitar effect switcher and I have implemented an eeprom emulation for it. That is working great. The emulated eeprom bytes are st…

---

## [Select one button from button object array](https://discourse.processing.org/t/select-one-button-from-button-object-array/32034)

<div class="topic-metadata">

**Author:** [@Naison](https://discourse.processing.org/u/Naison)\
**Replies:** 2\
**Last updated:** [September 1, 2021, 8:47am UTC](https://discourse.processing.org/t/select-one-button-from-button-object-array/32034 "2021-09-01T08:47:25Z")

</div>

Hey guys! I’m just experimenting with how to code a system that selects one from multiple buttons in your sketch if clicked on one button and deselects it when clicked on another button so that always just one or none bu…

---

## [Dynamic Text size (responsive)](https://discourse.processing.org/t/dynamic-text-size-responsive/31491)

<div class="topic-metadata">

**Author:** [@Quorum](https://discourse.processing.org/u/Quorum)\
**Replies:** 2\
**Last updated:** [September 1, 2021, 6:02am UTC](https://discourse.processing.org/t/dynamic-text-size-responsive/31491 "2021-09-01T06:02:18Z")

</div>

Hello, everyone, I would like the text to change size according to the choice of window size. But my code doesn’t work. Can you explain me why please? let titleSize = floor(createNumberDict(12, setLayout\[layoutMode\]\[0\]…

---

## [How to check if all elements in an array are the same?](https://discourse.processing.org/t/how-to-check-if-all-elements-in-an-array-are-the-same/32044)

<div class="topic-metadata">

**Author:** [@lucaswoah](https://discourse.processing.org/u/lucaswoah)\
**Replies:** 2\
**Last updated:** [September 1, 2021, 5:59am UTC](https://discourse.processing.org/t/how-to-check-if-all-elements-in-an-array-are-the-same/32044 "2021-09-01T05:59:50Z")

</div>

I made this game for my exam where I have this two dimensional (int \[\] \[\] M = new int \[30\]\[30\]) array that has 3 possible values: 0 (black tile), 1 (white tile) and 2 (fruits). The player can click with the left mouse bu…

---

## [How to add score and ending to my game](https://discourse.processing.org/t/how-to-add-score-and-ending-to-my-game/13235)

<div class="topic-metadata">

**Author:** [@Mike92](https://discourse.processing.org/u/Mike92)\
**Replies:** 12\
**Last updated:** [November 3, 2020, 12:22am UTC](https://discourse.processing.org/t/how-to-add-score-and-ending-to-my-game/13235 "2020-11-03T00:22:38Z")

</div>

Hi all, I’m new on this forum. I’ve writing my first game to processing and I’m trying to add score and ending to my game. I’ve just add some lines of code but don’t work. Someone can help me? Here the code: float x = …

---

## [Error Downloading Examples](https://discourse.processing.org/t/error-downloading-examples/32033)

<div class="topic-metadata">

**Author:** [@minami](https://discourse.processing.org/u/minami)\
**Replies:** 1\
**Last updated:** [August 31, 2021, 10:07pm UTC](https://discourse.processing.org/t/error-downloading-examples/32033 "2021-08-31T22:07:37Z")

</div>

Trying to download the Getting Started with Processing, 2nd Edition example and getting the error message “Error during download and install of Getting Started with Processing, 2nd Edition.”, but I’m able to download oth…

---

## [Trouble loading image](https://discourse.processing.org/t/trouble-loading-image/31915)

<div class="topic-metadata">

**Author:** [@LindowMan](https://discourse.processing.org/u/LindowMan)\
**Replies:** 9\
**Last updated:** [August 31, 2021, 4:04pm UTC](https://discourse.processing.org/t/trouble-loading-image/31915 "2021-08-31T16:04:11Z")

</div>

Really can’t see what the problem is supposed to be here. def setup(): img = loadImage("b2.jpg") size(img.width, img.height) Result is the following error: processing.app.SketchException: NameError: global nam…

---

## [Instantiate class from string](https://discourse.processing.org/t/instantiate-class-from-string/32006)

<div class="topic-metadata">

**Author:** [@molo32](https://discourse.processing.org/u/molo32)\
**Replies:** 2\
**Last updated:** [August 31, 2021, 3:02pm UTC](https://discourse.processing.org/t/instantiate-class-from-string/32006 "2021-08-31T15:02:25Z")

</div>

I googled methods but couldn’t get it to work in processing. what I’m looking for is something like. String s="foo"; void setup(){ parent new\_instance= new s; } class parent{ } class foo extends parent{ }

---

## [P5.JS 3D Dot Diagram rendering extremely slow](https://discourse.processing.org/t/p5-js-3d-dot-diagram-rendering-extremely-slow/31953)

<div class="topic-metadata">

**Author:** [@salmans911](https://discourse.processing.org/u/salmans911)\
**Replies:** 11\
**Last updated:** [August 31, 2021, 10:50am UTC](https://discourse.processing.org/t/p5-js-3d-dot-diagram-rendering-extremely-slow/31953 "2021-08-31T10:50:16Z")

</div>

I am trying to convert a normal 2D image(a simple JPEG) into a 3D Dot Diagram that the user can move around with. But upon trying to render that dot diagram, the program becomes extremely slow. Can anyone point where I a…

---

## [The different performance of noise() in processing and p5.js](https://discourse.processing.org/t/the-different-performance-of-noise-in-processing-and-p5-js/32019)

<div class="topic-metadata">

**Author:** [@niuuin](https://discourse.processing.org/u/niuuin)\
**Replies:** 2\
**Last updated:** [August 31, 2021, 5:37am UTC](https://discourse.processing.org/t/the-different-performance-of-noise-in-processing-and-p5-js/32019 "2021-08-31T05:37:39Z")

</div>

I am learning a tutorial from Vamoss and trying to implement it with Processing. But I encountered a problem in the noise() part of Chapter 2, which resulted in a different result from Vamoss. This is my code: int…

---

## [Problem with keyPressed() and SPACE](https://discourse.processing.org/t/problem-with-keypressed-and-space/7468)

<div class="topic-metadata">

**Author:** [@JoLi](https://discourse.processing.org/u/JoLi)\
**Replies:** 2\
**Last updated:** [October 27, 2020, 3:52pm UTC](https://discourse.processing.org/t/problem-with-keypressed-and-space/7468 "2020-10-27T15:52:32Z")

</div>

I am new here and with Processing. My Problem is: void keyPressed() { if(key == SPACE) { ellipse(10, 10, 20, 20); } } Processing “says” that “SPACE” is an invalid character constant. I also tried these: void key…

---

## [Slow down an animation](https://discourse.processing.org/t/slow-down-an-animation/10381)

<div class="topic-metadata">

**Author:** [@vincentstrebelle](https://discourse.processing.org/u/vincentstrebelle)\
**Replies:** 16\
**Last updated:** [March 5, 2021, 12:24pm UTC](https://discourse.processing.org/t/slow-down-an-animation/10381 "2021-03-05T12:24:49Z")

</div>

Hi, i found the sequential example to make an animation and i wonder how can i slow down the animation without change the framerate. Is that possible ? here is the example: (https://processing.org/examples/sequential.ht…

---

## [Can't install modes](https://discourse.processing.org/t/cant-install-modes/31859)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 4\
**Last updated:** [August 30, 2021, 9:55pm UTC](https://discourse.processing.org/t/cant-install-modes/31859 "2021-08-30T21:55:32Z")

</div>

the install button doesn’t do anything

---

## [Sketching - "Processing" using Racket as the base language](https://discourse.processing.org/t/sketching-processing-using-racket-as-the-base-language/32010)

<div class="topic-metadata">

**Author:** [@soegaard](https://discourse.processing.org/u/soegaard)\
**Replies:** 6\
**Last updated:** [August 30, 2021, 8:01pm UTC](https://discourse.processing.org/t/sketching-processing-using-racket-as-the-base-language/32010 "2021-08-30T20:01:47Z")

</div>

Hi All, My summer project this year was to make a version of Processing that uses Racket as its base language. Comments are welcome. Check the documentation here: https://soegaard.github.io/sketching/ The Github rep…

---

## [Processing interaction imperfections on Windows](https://discourse.processing.org/t/processing-interaction-imperfections-on-windows/18686)

<div class="topic-metadata">

**Author:** [@RichardDL](https://discourse.processing.org/u/RichardDL)\
**Replies:** 7\
**Last updated:** [August 30, 2021, 5:14pm UTC](https://discourse.processing.org/t/processing-interaction-imperfections-on-windows/18686 "2021-08-30T17:14:33Z")

</div>

Hi These 3 annoy me frequently using Processing on Windows (W10 today). I’m thinking of logging them as issues, but want to see what anyone else thinks first. Keypress doesn’t work until Clicked When the sketch is ru…

---

## [mousePressed with multiple windows](https://discourse.processing.org/t/mousepressed-with-multiple-windows/31947)

<div class="topic-metadata">

**Author:** [@stef0206](https://discourse.processing.org/u/stef0206)\
**Replies:** 2\
**Last updated:** [August 30, 2021, 4:12pm UTC](https://discourse.processing.org/t/mousepressed-with-multiple-windows/31947 "2021-08-30T16:12:29Z")

</div>

I am working with processingpy and wanted to make a drawing program, I’ve created a basic color picker in one window, and then created a seperate one for drawing, but when I attempt to use mousePressed in the new window …

---

## [JSON file not being read correctly](https://discourse.processing.org/t/json-file-not-being-read-correctly/31791)

<div class="topic-metadata">

**Author:** [@fleshcircuit](https://discourse.processing.org/u/fleshcircuit)\
**Replies:** 9\
**Last updated:** [August 30, 2021, 9:37am UTC](https://discourse.processing.org/t/json-file-not-being-read-correctly/31791 "2021-08-30T09:37:39Z")

</div>

Hello, I am trying to read data from a JSON file, but I am having trouble. I would like the background to change based on the level type indicated (deep, light, wake, rem). I followed Dan Shiffman’s Coding train video a…

---

## [Create 8 clickable circles](https://discourse.processing.org/t/create-8-clickable-circles/32002)

<div class="topic-metadata">

**Author:** [@jhsa](https://discourse.processing.org/u/jhsa)\
**Replies:** 13\
**Last updated:** [August 30, 2021, 2:33am UTC](https://discourse.processing.org/t/create-8-clickable-circles/32002 "2021-08-30T02:33:21Z")

</div>

I have been looking for examples on how to draw 8 clickable circles. The idea is to emulate 8 LEDs, and turn them ON/OFF when clicking on them with the mouse. I have been playing with the example I found (that one with …

---

## [Is there a better way to write this piece of code?](https://discourse.processing.org/t/is-there-a-better-way-to-write-this-piece-of-code/31961)

<div class="topic-metadata">

**Author:** [@jhsa](https://discourse.processing.org/u/jhsa)\
**Replies:** 8\
**Last updated:** [August 30, 2021, 1:49am UTC](https://discourse.processing.org/t/is-there-a-better-way-to-write-this-piece-of-code/31961 "2021-08-30T01:49:48Z")

</div>

Is there a better way to write this piece of code? These belong to my DropDownList code. These lines are needed to bring the clicked list to front. Thank You. if (d1.isMousePressed()) { d1.bringToFront(); } i…

[Previous page](https://discourse.processing.org/latest.md?page=195)

[Next page](https://discourse.processing.org/latest.md?page=197)
