# Processing

**URL:** https://discourse.processing.org/c/processing/6.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

---

## [Method from class does not work](https://discourse.processing.org/t/method-from-class-does-not-work/34354)

<div class="topic-metadata">

**Author:** [@marina\_kdot](https://discourse.processing.org/u/marina_kdot)\
**Replies:** 2\
**Last updated:** [December 29, 2021, 10:45pm UTC](https://discourse.processing.org/t/method-from-class-does-not-work/34354 "2021-12-29T22:45:23Z")

</div>

I try to set up a short array and display four squares with random position and size. But I always get a syntax error. I spend lots of time comparing my code to other examples and they are all running, but mine is not. …

---

## [String contraining HEX color to Color value](https://discourse.processing.org/t/string-contraining-hex-color-to-color-value/34380)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 1\
**Last updated:** [December 30, 2021, 6:00pm UTC](https://discourse.processing.org/t/string-contraining-hex-color-to-color-value/34380 "2021-12-30T18:00:07Z")

</div>

I have a txt file that contains colors in the form of #01abEf and I want to load them and turn into processing color variable type. How can I do this? How can I turn “#FF00FF” to color(255,0,255) ?

---

## [Make two characters change color after colliding](https://discourse.processing.org/t/make-two-characters-change-color-after-colliding/34230)

<div class="topic-metadata">

**Author:** [@mpsch](https://discourse.processing.org/u/mpsch)\
**Replies:** 8\
**Last updated:** [December 30, 2021, 2:51pm UTC](https://discourse.processing.org/t/make-two-characters-change-color-after-colliding/34230 "2021-12-30T14:51:46Z")

</div>

I want to make an animation to persuade people to get vaccinated for a school project. I want when a “person” that has red head which indicates that he is not vaccinated, gets in touch with the vaccine change his color t…

---

## [Multi Core Processing](https://discourse.processing.org/t/multi-core-processing/34366)

<div class="topic-metadata">

**Author:** [@IRIGIMA](https://discourse.processing.org/u/IRIGIMA)\
**Replies:** 1\
**Last updated:** [December 30, 2021, 11:16am UTC](https://discourse.processing.org/t/multi-core-processing/34366 "2021-12-30T11:16:41Z")

</div>

Hi. Does Processing support Multi Core ? Like if I had a 16 Core CPU, would my code run super fast ? Thanks in advance.

---

## [Announcing Browser-Based GUI Controls (buttons, etc.) for Sketches](https://discourse.processing.org/t/announcing-browser-based-gui-controls-buttons-etc-for-sketches/34363)

<div class="topic-metadata">

**Author:** [@pbrooks](https://discourse.processing.org/u/pbrooks)\
**Replies:** 0\
**Last updated:** [December 29, 2021, 9:00pm UTC](https://discourse.processing.org/t/announcing-browser-based-gui-controls-buttons-etc-for-sketches/34363 "2021-12-29T21:00:06Z")

</div>

For Processing (Java version): Very easy creation of GUI controls (buttons, sliders, dropdowns, textboxes and checkboxes) inside a browser window to control Processing sketch animations. Also can create “monitors” whic…

---

## [Issues exporting sketch to PDF: sketch gets cropped!](https://discourse.processing.org/t/issues-exporting-sketch-to-pdf-sketch-gets-cropped/34344)

<div class="topic-metadata">

**Author:** [@tommsmoro](https://discourse.processing.org/u/tommsmoro)\
**Replies:** 15\
**Last updated:** [December 29, 2021, 5:54pm UTC](https://discourse.processing.org/t/issues-exporting-sketch-to-pdf-sketch-gets-cropped/34344 "2021-12-29T17:54:40Z")

</div>

UPDATE: PROBLEM SOLVED The issue is that I was using pixelDensity(2). See full solution to the problem here: java - Issues exporting Processing sketch to PDF: sketch gets cropped - Stack Overflow ######## ORIGINAL POS…

---

## [Rect() function not working when used inside of a function inside of a class](https://discourse.processing.org/t/rect-function-not-working-when-used-inside-of-a-function-inside-of-a-class/34347)

<div class="topic-metadata">

**Author:** [@A\_game\_programmer](https://discourse.processing.org/u/A_game_programmer)\
**Replies:** 1\
**Last updated:** [December 29, 2021, 8:04am UTC](https://discourse.processing.org/t/rect-function-not-working-when-used-inside-of-a-function-inside-of-a-class/34347 "2021-12-29T08:04:15Z")

</div>

Can someone please clarify why the rect() function is not being called? I have checked it and code in the if function is being executed as normal, just functions to do with drawing are not working. public class FadeCu…

---

## [G4P GSpinner number update order](https://discourse.processing.org/t/g4p-gspinner-number-update-order/34329)

<div class="topic-metadata">

**Author:** [@myupctoys](https://discourse.processing.org/u/myupctoys)\
**Replies:** 5\
**Last updated:** [December 28, 2021, 11:33pm UTC](https://discourse.processing.org/t/g4p-gspinner-number-update-order/34329 "2021-12-28T23:33:06Z")

</div>

Hi, I’ve been trying implement GSpinner but having an issue. Easily replicated in the G4P Example Numerical Input unmodified. Load and run the G4P\_NumericalInput example. Click on the up down spinner object. Number get…

---

## [Creating a floor plan! urgent! final assignment due](https://discourse.processing.org/t/creating-a-floor-plan-urgent-final-assignment-due/34132)

<div class="topic-metadata">

**Author:** [@ineedtosleep](https://discourse.processing.org/u/ineedtosleep)\
**Replies:** 11\
**Last updated:** [December 28, 2021, 1:22pm UTC](https://discourse.processing.org/t/creating-a-floor-plan-urgent-final-assignment-due/34132 "2021-12-28T13:22:00Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Please can someone help me create a floor plan!!! this is an elective course im no longer going to take it later on, however i have this final a…

---

## [Graphics quality compared to OpenFrameworks](https://discourse.processing.org/t/graphics-quality-compared-to-openframeworks/34308)

<div class="topic-metadata">

**Author:** [@woodwindblues](https://discourse.processing.org/u/woodwindblues)\
**Replies:** 11\
**Last updated:** [December 28, 2021, 9:10am UTC](https://discourse.processing.org/t/graphics-quality-compared-to-openframeworks/34308 "2021-12-28T09:10:28Z")

</div>

I am working on a sketch that is basically a very simple particle system, but the trails are drawn as lines. I wrote one version of the code in processing and one in openFrameworks. The code is nearly identical, but the …

---

## [Stroke doesn't look correct when using P3D in the 3rd argument of size()](https://discourse.processing.org/t/stroke-doesnt-look-correct-when-using-p3d-in-the-3rd-argument-of-size/34324)

<div class="topic-metadata">

**Author:** [@Dwight](https://discourse.processing.org/u/Dwight)\
**Replies:** 0\
**Last updated:** [December 27, 2021, 9:53pm UTC](https://discourse.processing.org/t/stroke-doesnt-look-correct-when-using-p3d-in-the-3rd-argument-of-size/34324 "2021-12-27T21:53:45Z")

</div>

When I make a rectangle with a strokeWeight of 20, and when I don’t use P3D in the 3rd argument of the size() function, it looks like this: But when I use P3D, the stroke is beveled a little bit: How do I remove …

---

## [3D Lidar point cloud to Blender](https://discourse.processing.org/t/3d-lidar-point-cloud-to-blender/34198)

<div class="topic-metadata">

**Author:** [@StainlessHolz](https://discourse.processing.org/u/StainlessHolz)\
**Replies:** 7\
**Last updated:** [December 27, 2021, 9:50pm UTC](https://discourse.processing.org/t/3d-lidar-point-cloud-to-blender/34198 "2021-12-27T21:50:03Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hi Everyone, I want to scan in 3D and mill these with CAM. I have access to some nice tools to do so: Livox Mid-40 LiDAR Fusion 360 and its …

---

## [Simple way to encode and decode a string according to a password?](https://discourse.processing.org/t/simple-way-to-encode-and-decode-a-string-according-to-a-password/34298)

<div class="topic-metadata">

**Author:** [@mungle](https://discourse.processing.org/u/mungle)\
**Replies:** 1\
**Last updated:** [December 27, 2021, 7:34pm UTC](https://discourse.processing.org/t/simple-way-to-encode-and-decode-a-string-according-to-a-password/34298 "2021-12-27T19:34:07Z")

</div>

Hello everyone, Does Processing have built-in functions, libraries or a simple way of encoding/decoding strings using a password? Something like this: encode('My String', password = 'mypass') //'ajdnfladfa739adl23' d…

---

## [How to fill indivdual shapes with different colours in a for loop](https://discourse.processing.org/t/how-to-fill-indivdual-shapes-with-different-colours-in-a-for-loop/34271)

<div class="topic-metadata">

**Author:** [@UltimateDoug9](https://discourse.processing.org/u/UltimateDoug9)\
**Replies:** 4\
**Last updated:** [December 26, 2021, 11:12pm UTC](https://discourse.processing.org/t/how-to-fill-indivdual-shapes-with-different-colours-in-a-for-loop/34271 "2021-12-26T23:12:28Z")

</div>

I’m making a drawing program and I want a sidebar that shows the colour options. How would I make each rectangle a different colour if there in a for loop? for (int j = 1; j\<= 3; j++) { for (int i = 1; i\<= 2; i++) { …

---

## [Simulate Mouse movement with Robot](https://discourse.processing.org/t/simulate-mouse-movement-with-robot/34301)

<div class="topic-metadata">

**Author:** [@pml](https://discourse.processing.org/u/pml)\
**Replies:** 0\
**Last updated:** [December 26, 2021, 4:53pm UTC](https://discourse.processing.org/t/simulate-mouse-movement-with-robot/34301 "2021-12-26T16:53:38Z")

</div>

Hello ! I’m attempting to simulate the movement of my mouse with Robot but it does not work : my mouse just jump between the points but the particles don’t follow it. Can you explain me what is wrong with my code ? im…

---

## [How to properly export this simple 3D sketch to PDF?](https://discourse.processing.org/t/how-to-properly-export-this-simple-3d-sketch-to-pdf/34290)

<div class="topic-metadata">

**Author:** [@sorenkirk](https://discourse.processing.org/u/sorenkirk)\
**Replies:** 1\
**Last updated:** [December 26, 2021, 9:16am UTC](https://discourse.processing.org/t/how-to-properly-export-this-simple-3d-sketch-to-pdf/34290 "2021-12-26T09:16:53Z")

</div>

I have a somewhat simple sketch but whenever I export to pdf it looks really bad. What is the best way to get a vector file for this sketch that will look like how it does when run in Processing? import processing.pdf.\*…

---

## [I am trying to express in real time by passing sound data](https://discourse.processing.org/t/i-am-trying-to-express-in-real-time-by-passing-sound-data/34291)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 0\
**Last updated:** [December 26, 2021, 12:30am UTC](https://discourse.processing.org/t/i-am-trying-to-express-in-real-time-by-passing-sound-data/34291 "2021-12-26T00:30:50Z")

</div>

I am trying to express in real time by passing sound data. Mode : JAVA Mode Library : minim //================================================================// import ddf.minim.\*; Minim minim; AudioInput in; Aud…

---

## [Checking Boolean variable breaks serial communication code with Arduino](https://discourse.processing.org/t/checking-boolean-variable-breaks-serial-communication-code-with-arduino/34149)

<div class="topic-metadata">

**Author:** [@grudovz](https://discourse.processing.org/u/grudovz)\
**Replies:** 3\
**Last updated:** [December 25, 2021, 3:45pm UTC](https://discourse.processing.org/t/checking-boolean-variable-breaks-serial-communication-code-with-arduino/34149 "2021-12-25T15:45:05Z")

</div>

I’m learning how to use processing to communicate via serial with arduino. Using the basic code below works, both variables are getting written to the arduino. And they then get printed to the processing console. (serial…

---

## [Drawing a board using GUI](https://discourse.processing.org/t/drawing-a-board-using-gui/34276)

<div class="topic-metadata">

**Author:** [@f.y](https://discourse.processing.org/u/f.y)\
**Replies:** 2\
**Last updated:** [December 25, 2021, 1:42pm UTC](https://discourse.processing.org/t/drawing-a-board-using-gui/34276 "2021-12-25T13:42:05Z")

</div>

Hello, below is a code I wrote to draw a board using GUI. I want to locate the board in the center of my screen but I don\`t know-how. Can someone help, please? And, can you tell me how can I get access to each of the ce…

---

## [Storing data into an array (processing.sound)](https://discourse.processing.org/t/storing-data-into-an-array-processing-sound/34150)

<div class="topic-metadata">

**Author:** [@rebeccajkaye](https://discourse.processing.org/u/rebeccajkaye)\
**Replies:** 13\
**Last updated:** [December 24, 2021, 5:34pm UTC](https://discourse.processing.org/t/storing-data-into-an-array-processing-sound/34150 "2021-12-24T17:34:36Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hello I’m trying to store data from a sound file into an array so that I can use it to draw with. I’ve come a bit further on with my problem bu…

---

## [Draw() inside a class](https://discourse.processing.org/t/draw-inside-a-class/34207)

<div class="topic-metadata">

**Author:** [@Skycstls](https://discourse.processing.org/u/Skycstls)\
**Replies:** 2\
**Last updated:** [December 24, 2021, 2:39pm UTC](https://discourse.processing.org/t/draw-inside-a-class/34207 "2021-12-24T14:39:16Z")

</div>

Hey Processing forum! I’ve been looking the Ani library for animation, was scrolling through the examples for using it and saw this class: class Cirlce { float x = random(0,width); float y = random(0,height); int…

---

## [Snake eating the apple](https://discourse.processing.org/t/snake-eating-the-apple/34275)

<div class="topic-metadata">

**Author:** [@f.y](https://discourse.processing.org/u/f.y)\
**Replies:** 0\
**Last updated:** [December 24, 2021, 8:08am UTC](https://discourse.processing.org/t/snake-eating-the-apple/34275 "2021-12-24T08:08:33Z")

</div>

Hello everyone, I need some help with the code I am writing. this is a simple snake game but I don\`t know how to make the snake eat the apples besides there is one more problem. whenever the snake moves from left to rig…

---

## [Need help with a health system in a game i'm making](https://discourse.processing.org/t/need-help-with-a-health-system-in-a-game-im-making/33687)

<div class="topic-metadata">

**Author:** [@UltimateDoug9](https://discourse.processing.org/u/UltimateDoug9)\
**Replies:** 5\
**Last updated:** [December 23, 2021, 11:23pm UTC](https://discourse.processing.org/t/need-help-with-a-health-system-in-a-game-im-making/33687 "2021-12-23T23:23:34Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Making a game of my computer studies class and i’m struggling to make a health system with just variables and if statement (that 's all were allowe…

---

## [Synthetic variable assignment -- this\[String+number\] (IntDict)](https://discourse.processing.org/t/synthetic-variable-assignment-this-string-number-intdict/34267)

<div class="topic-metadata">

**Author:** [@mrbbp](https://discourse.processing.org/u/mrbbp)\
**Replies:** 7\
**Last updated:** [December 23, 2021, 4:09pm UTC](https://discourse.processing.org/t/synthetic-variable-assignment-this-string-number-intdict/34267 "2021-12-23T16:09:33Z")

</div>

Hello, i suppose it’s a newb question and sorry for that. i don’t know how to qualify in english (no more in french)… a composite variable name, a synthetic variable name??? in js your can assign a “synthetic” var na…

---

## [Snake game eating the apples](https://discourse.processing.org/t/snake-game-eating-the-apples/34264)

<div class="topic-metadata">

**Author:** [@f.y](https://discourse.processing.org/u/f.y)\
**Replies:** 0\
**Last updated:** [December 23, 2021, 9:15am UTC](https://discourse.processing.org/t/snake-game-eating-the-apples/34264 "2021-12-23T09:15:00Z")

</div>

import processing.core.\*; public class Problem04 extends PApplet { float scale = height / 18f; float foodX; float foodY; float circleX; float circleY; float circleR; int score = 0; String scoreTxt = "Score: " + …

---

## [I want to sort many arrays in many different ways](https://discourse.processing.org/t/i-want-to-sort-many-arrays-in-many-different-ways/34249)

<div class="topic-metadata">

**Author:** [@jazz](https://discourse.processing.org/u/jazz)\
**Replies:** 3\
**Last updated:** [December 22, 2021, 9:22pm UTC](https://discourse.processing.org/t/i-want-to-sort-many-arrays-in-many-different-ways/34249 "2021-12-22T21:22:11Z")

</div>

for one of my projects, I have two arrays, one storing X coordinates, and one with Y coordinates. my goal is to sort the X coordinates from least to greatest using the “sort” function. the problem is, then none of the X…

---

## [5 Bit Barker Code](https://discourse.processing.org/t/5-bit-barker-code/31141)

<div class="topic-metadata">

**Author:** [@jafal](https://discourse.processing.org/u/jafal)\
**Replies:** 24\
**Last updated:** [December 22, 2021, 5:05pm UTC](https://discourse.processing.org/t/5-bit-barker-code/31141 "2021-12-22T17:05:24Z")

</div>

hi all I want to perform multiplication and addition for this array so that the result is as follows thanks in advance int \[\] intArray = new int\[\] {1, 1, 1,-1, 1}; println("Original Array:"); for (int i=0; i\<intArra…

---

## [How to change the icon of your application using PJOGL.setIcon()?](https://discourse.processing.org/t/how-to-change-the-icon-of-your-application-using-pjogl-seticon/34236)

<div class="topic-metadata">

**Author:** [@Dwight](https://discourse.processing.org/u/Dwight)\
**Replies:** 1\
**Last updated:** [December 22, 2021, 3:01pm UTC](https://discourse.processing.org/t/how-to-change-the-icon-of-your-application-using-pjogl-seticon/34236 "2021-12-22T15:01:50Z")

</div>

Hello there. I’m writing an application in processing, and I want to change application’s default icon on the taskbar. I know how this can be done by using surface.setIcon(PImage). But this doesn’t work when I’m using P…

---

## [Multiple transformations](https://discourse.processing.org/t/multiple-transformations/34243)

<div class="topic-metadata">

**Author:** [@Chihiro](https://discourse.processing.org/u/Chihiro)\
**Replies:** 3\
**Last updated:** [December 22, 2021, 12:23pm UTC](https://discourse.processing.org/t/multiple-transformations/34243 "2021-12-22T12:23:29Z")

</div>

Hi! I’m pretty new to coding, and am having an issue with the transformations in my code. My program is quite long so I’ve just used a rectangle as an example here. I’m trying to make the object spiral in a small circle …

---

## [Processing 4 crashes when trying to open file](https://discourse.processing.org/t/processing-4-crashes-when-trying-to-open-file/34239)

<div class="topic-metadata">

**Author:** [@MythicalSora](https://discourse.processing.org/u/MythicalSora)\
**Replies:** 0\
**Last updated:** [December 22, 2021, 8:57am UTC](https://discourse.processing.org/t/processing-4-crashes-when-trying-to-open-file/34239 "2021-12-22T08:57:40Z")

</div>

Hello folks! I’ve encountered a strange problem while trying to setup Processing on my machine. I managed to install and launch it, but whenever I try to open a file, it freezes for about 3 seconds and quits. System spe…

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

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