# Processing

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

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

**Page:** 112

---

## [How can I turn an image or svg into Basic Shapes?](https://discourse.processing.org/t/how-can-i-turn-an-image-or-svg-into-basic-shapes/32465)

<div class="topic-metadata">

**Author:** [@Violet](https://discourse.processing.org/u/Violet)\
**Replies:** 1\
**Last updated:** [September 30, 2021, 11:53am UTC](https://discourse.processing.org/t/how-can-i-turn-an-image-or-svg-into-basic-shapes/32465 "2021-09-30T11:53:16Z")

</div>

How to intelligently recognize graphics and extract the outer contour of the icon, especially the third change in the figure. I can’t do it with my current level of knowledge, so I would like to ask if processing can…

---

## [ControlP5 contol toggles](https://discourse.processing.org/t/controlp5-contol-toggles/32514)

<div class="topic-metadata">

**Author:** [@PaladinBobcat](https://discourse.processing.org/u/PaladinBobcat)\
**Replies:** 1\
**Last updated:** [September 30, 2021, 8:48am UTC](https://discourse.processing.org/t/controlp5-contol-toggles/32514 "2021-09-30T08:48:51Z")

</div>

please format code with \</\> button \* homework policy \* asking questions I’m trying to make a panel of toggles that can be affected/changed by buttons, like setting multiple toggles’ state from false to true using one…

---

## [How to lock a variable?](https://discourse.processing.org/t/how-to-lock-a-variable/32515)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 5\
**Last updated:** [September 29, 2021, 8:57pm UTC](https://discourse.processing.org/t/how-to-lock-a-variable/32515 "2021-09-29T20:57:33Z")

</div>

how to make a variable unchangeable so it can’t be changed anymore?

---

## [Char, lower/upper case](https://discourse.processing.org/t/char-lower-upper-case/32505)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 4\
**Last updated:** [September 29, 2021, 10:19am UTC](https://discourse.processing.org/t/char-lower-upper-case/32505 "2021-09-29T10:19:00Z")

</div>

Hi! Is there a way to check if a char is uppercase / lowercase other than: (char+"").toLowerCase().charAt(0) == char ? I saw this method but it didn’t seem to work. I tried using: println(a.isUpperCase(), isUpper…

---

## [Feeling completely lost regarding problem solving?](https://discourse.processing.org/t/feeling-completely-lost-regarding-problem-solving/32483)

<div class="topic-metadata">

**Author:** [@HasarangaWanindu](https://discourse.processing.org/u/HasarangaWanindu)\
**Replies:** 3\
**Last updated:** [September 29, 2021, 5:57am UTC](https://discourse.processing.org/t/feeling-completely-lost-regarding-problem-solving/32483 "2021-09-29T05:57:50Z")

</div>

Hi, I feel incredibly lost and I don’t think that programming is for me after all. I’m doing the MIT Python for beginners course and I can’t do any of the midterm exam problems. I understand the lectures but when I am fa…

---

## [Rect following mouseX slowing speed problem](https://discourse.processing.org/t/rect-following-mousex-slowing-speed-problem/32491)

<div class="topic-metadata">

**Author:** [@Kenga123456](https://discourse.processing.org/u/Kenga123456)\
**Replies:** 2\
**Last updated:** [September 28, 2021, 9:05pm UTC](https://discourse.processing.org/t/rect-following-mousex-slowing-speed-problem/32491 "2021-09-28T21:05:30Z")

</div>

I have tried changing this line -xVel = xVel\*0,999- here but I can’t find a way to make the ellipse more gradually lose speed. Here is my code float ellipseXPos = 300; float ellipseYPos = 300; float xVel = 1; float yVe…

---

## [I want to draw pixels in bigger sizes with more simple methods](https://discourse.processing.org/t/i-want-to-draw-pixels-in-bigger-sizes-with-more-simple-methods/32485)

<div class="topic-metadata">

**Author:** [@R1S8K](https://discourse.processing.org/u/R1S8K)\
**Replies:** 1\
**Last updated:** [September 28, 2021, 8:39pm UTC](https://discourse.processing.org/t/i-want-to-draw-pixels-in-bigger-sizes-with-more-simple-methods/32485 "2021-09-28T20:39:14Z")

</div>

Hi, I want a simple way to draw pixels in bigger shapes. I want to test basic pixel draw functions; like, lines, circles, rectangles … etc. With small resolutions like 128 x 64. Even if you know a simple library that c…

---

## [Why does the square stay in the previous position](https://discourse.processing.org/t/why-does-the-square-stay-in-the-previous-position/32487)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 4\
**Last updated:** [September 28, 2021, 8:29pm UTC](https://discourse.processing.org/t/why-does-the-square-stay-in-the-previous-position/32487 "2021-09-28T20:29:07Z")

</div>

when the square moves it also stays in the previous position. noStroke(); dit not solve it PVector pos1; PVector pos2; PVector pos3; PVector pos4; PVector pos5; PVector pos6; PVector pos7; PVector pos8; PVector pos9; i…

---

## [Processing 3 and 4 Compatibility](https://discourse.processing.org/t/processing-3-and-4-compatibility/32446)

<div class="topic-metadata">

**Author:** [@reProcessing](https://discourse.processing.org/u/reProcessing)\
**Replies:** 2\
**Last updated:** [September 28, 2021, 3:34pm UTC](https://discourse.processing.org/t/processing-3-and-4-compatibility/32446 "2021-09-28T15:34:35Z")

</div>

For the last few months I’ve been cobbling together a really cool system in Processing 3. In fact it is so cool I really don’t know what its ultimate purpose or capabilities will be. A first for me! I’d like to instal…

---

## [Block does not move when button is pressed](https://discourse.processing.org/t/block-does-not-move-when-button-is-pressed/32456)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 6\
**Last updated:** [September 28, 2021, 3:12pm UTC](https://discourse.processing.org/t/block-does-not-move-when-button-is-pressed/32456 "2021-09-28T15:12:25Z")

</div>

float\[\] blockx= new float\[9\]; float\[\] blocky= new float\[9\]; int i=1; void setup(){ size(400,300); blockx\[1\]= 0; blocky\[1\]=0; } void draw(){ if(keyPressed){ if(key=='d'){ blockx\[i\]=blockx\[i\]+100;}} …

---

## [Making Box appear in random locations](https://discourse.processing.org/t/making-box-appear-in-random-locations/32458)

<div class="topic-metadata">

**Author:** [@zack10](https://discourse.processing.org/u/zack10)\
**Replies:** 2\
**Last updated:** [September 28, 2021, 10:18am UTC](https://discourse.processing.org/t/making-box-appear-in-random-locations/32458 "2021-09-28T10:18:17Z")

</div>

class Box{ float z = 50; float dz = 2; void moveBox() { z += dz; } void show() { lights(); pushMatrix(); translate(130, 220, z); noStroke(); fill(10, 98, 240); rotateX(fra…

---

## [How can I light up separate circles instead of them all](https://discourse.processing.org/t/how-can-i-light-up-separate-circles-instead-of-them-all/32468)

<div class="topic-metadata">

**Author:** [@Caprisunny](https://discourse.processing.org/u/Caprisunny)\
**Replies:** 2\
**Last updated:** [September 28, 2021, 10:08am UTC](https://discourse.processing.org/t/how-can-i-light-up-separate-circles-instead-of-them-all/32468 "2021-09-28T10:08:14Z")

</div>

int\[\]\[\] cirkels = { {10, 15}, {100, 130}, {77, 43}, {30, 145}, {185, 17}, {99, 76} }; final int DIAMETER = 20; final int STRAAL = 10; final int GEEL = #FFFF00; final int ROOD = #FF0000; int kleur; void setup() { size(…

---

## [Does anyone know what type of game this is?](https://discourse.processing.org/t/does-anyone-know-what-type-of-game-this-is/32466)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 0\
**Last updated:** [September 28, 2021, 8:12am UTC](https://discourse.processing.org/t/does-anyone-know-what-type-of-game-this-is/32466 "2021-09-28T08:12:28Z")

</div>

(I have no idea what flare to set this as, so yeah. Maybe community?) You rotate the shapes in order to fill the white shape in the background. Once you stop holding a shape, the game ends. The large black dots are …

---

## [Adjust text size based on length of text](https://discourse.processing.org/t/adjust-text-size-based-on-length-of-text/32411)

<div class="topic-metadata">

**Author:** [@Naison](https://discourse.processing.org/u/Naison)\
**Replies:** 8\
**Last updated:** [September 28, 2021, 2:41am UTC](https://discourse.processing.org/t/adjust-text-size-based-on-length-of-text/32411 "2021-09-28T02:41:44Z")

</div>

Hello, I am coding a game and for this, I tryna write code that sizes the text based on the length of the text. My goal is to scale the text (the bigger the text width / the longer the text, the smaller the text size) t…

---

## [Problem with OSC send from Max For Live?](https://discourse.processing.org/t/problem-with-osc-send-from-max-for-live/32455)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 0\
**Last updated:** [September 27, 2021, 8:56pm UTC](https://discourse.processing.org/t/problem-with-osc-send-from-max-for-live/32455 "2021-09-27T20:56:17Z")

</div>

Hi there, I can read OSC midi from max for live but I can’t read OSC data from max for Live while it is the same port. I give you a screenshot with Live and OSC “object” of M4Live just that you can see I send good data…

---

## [SVG exception thrown on loadShape()](https://discourse.processing.org/t/svg-exception-thrown-on-loadshape/32422)

<div class="topic-metadata">

**Author:** [@strfry](https://discourse.processing.org/u/strfry)\
**Replies:** 6\
**Last updated:** [September 27, 2021, 5:52pm UTC](https://discourse.processing.org/t/svg-exception-thrown-on-loadshape/32422 "2021-09-27T17:52:33Z")

</div>

Hi, I’m new to processing, and I’m having an issue with loading a .svg saved in Adobe Illustrator using image trace. I get an error that looks like: RuntimeException: shape command not handled: .49 I believe the iss…

---

## [Problem with a loop](https://discourse.processing.org/t/problem-with-a-loop/3415)

<div class="topic-metadata">

**Author:** [@vincentstrebelle](https://discourse.processing.org/u/vincentstrebelle)\
**Replies:** 31\
**Last updated:** [September 11, 2018, 1:01pm UTC](https://discourse.processing.org/t/problem-with-a-loop/3415 "2018-09-11T13:01:32Z")

</div>

Hi i tried to use the code i recieve from my post “a pathfinding solution” to make my creatur find food. here is the case : my creatures walk randomly and when they are hungry they go to the closest food, but my foods …

---

## [How to add a target to a pong simulator game?](https://discourse.processing.org/t/how-to-add-a-target-to-a-pong-simulator-game/32427)

<div class="topic-metadata">

**Author:** [@Lulua](https://discourse.processing.org/u/Lulua)\
**Replies:** 1\
**Last updated:** [September 26, 2021, 8:38pm UTC](https://discourse.processing.org/t/how-to-add-a-target-to-a-pong-simulator-game/32427 "2021-09-26T20:38:05Z")

</div>

I have made a pong simulator game. I added a circle as a target but need to make it so that when the ball hits the target, the player wins and the game restarts. Help!!! PImage dragon; PFont font; int base=40; int x,…

---

## [Intermittent ArrayIndexOutOfBoundsException reading thermopile over serial](https://discourse.processing.org/t/intermittent-arrayindexoutofboundsexception-reading-thermopile-over-serial/32361)

<div class="topic-metadata">

**Author:** [@The\_Wolf\_of\_Walmart](https://discourse.processing.org/u/The_Wolf_of_Walmart)\
**Replies:** 9\
**Last updated:** [September 26, 2021, 5:09pm UTC](https://discourse.processing.org/t/intermittent-arrayindexoutofboundsexception-reading-thermopile-over-serial/32361 "2021-09-26T17:09:10Z")

</div>

Hello all. I’m trying to integrate the heatcam example sketches(Github) related to the Grid Eye Qwiik breakout from Sparkfun, into a bigger project, but am not able to it running reliably on it’s own. When it works, it w…

---

## [randomSeed() reuse](https://discourse.processing.org/t/randomseed-reuse/32154)

<div class="topic-metadata">

**Author:** [@Hermes](https://discourse.processing.org/u/Hermes)\
**Replies:** 15\
**Last updated:** [September 26, 2021, 8:36am UTC](https://discourse.processing.org/t/randomseed-reuse/32154 "2021-09-26T08:36:03Z")

</div>

hello I’m a noob to Processing, I’ve figured out how to generate a seed for each image output but I can’t figure out how to reuse the same seed to generate the same image… I just need to know the format and where to put …

---

## [Can't call simple function - missing semicolon syntax error](https://discourse.processing.org/t/cant-call-simple-function-missing-semicolon-syntax-error/32420)

<div class="topic-metadata">

**Author:** [@Chadmeistr](https://discourse.processing.org/u/Chadmeistr)\
**Replies:** 1\
**Last updated:** [September 26, 2021, 5:23am UTC](https://discourse.processing.org/t/cant-call-simple-function-missing-semicolon-syntax-error/32420 "2021-09-26T05:23:52Z")

</div>

Here is some code I am playing with, but it keeps giving me an error 'Syntax error - missin operator, semicolon or"}" near 2 void setup() { size(200, 200); } void sum(int a, int b, int c) { int total = a + b + c; …

---

## [setJSONArray should start a new line when inserting an array into a JSON object](https://discourse.processing.org/t/setjsonarray-should-start-a-new-line-when-inserting-an-array-into-a-json-object/32417)

<div class="topic-metadata">

**Author:** [@seanbetts](https://discourse.processing.org/u/seanbetts)\
**Replies:** 2\
**Last updated:** [September 25, 2021, 9:17pm UTC](https://discourse.processing.org/t/setjsonarray-should-start-a-new-line-when-inserting-an-array-into-a-json-object/32417 "2021-09-25T21:17:09Z")

</div>

I am trying to output a JSON file from my code which include some JSON objects and also a JSON array but the JSON array is not starting on a new line in the output JSON file, which causes problems when using the file. C…

---

## [Oval with straight edges](https://discourse.processing.org/t/oval-with-straight-edges/32390)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 3\
**Last updated:** [September 25, 2021, 5:58pm UTC](https://discourse.processing.org/t/oval-with-straight-edges/32390 "2021-09-25T17:58:05Z")

</div>

is there a way to create this shape as a single thing instead of having an ellipse and a rect?

---

## [Alpha of Zero in first pixel makes whole image opaque](https://discourse.processing.org/t/alpha-of-zero-in-first-pixel-makes-whole-image-opaque/32400)

<div class="topic-metadata">

**Author:** [@stevensrmiller](https://discourse.processing.org/u/stevensrmiller)\
**Replies:** 1\
**Last updated:** [September 24, 2021, 9:31pm UTC](https://discourse.processing.org/t/alpha-of-zero-in-first-pixel-makes-whole-image-opaque/32400 "2021-09-24T21:31:26Z")

</div>

When I use an image as a background, then set the alpha values for all pixels in a second image to something low, then draw that image, I can see “through” the second image to the background, just as I would expect. Here…

---

## [Disable ESC from exiting program in fullscreen?](https://discourse.processing.org/t/disable-esc-from-exiting-program-in-fullscreen/32383)

<div class="topic-metadata">

**Author:** [@jonnyetiz](https://discourse.processing.org/u/jonnyetiz)\
**Replies:** 3\
**Last updated:** [September 24, 2021, 4:27pm UTC](https://discourse.processing.org/t/disable-esc-from-exiting-program-in-fullscreen/32383 "2021-09-24T16:27:36Z")

</div>

I’m trying to use fullscreen and also bind escape to a button. Relevant code below (not complete obviously) void setup() { fullScreen(P2D); ... }

---

## [Getting error while build with processing one simple code in sublime](https://discourse.processing.org/t/getting-error-while-build-with-processing-one-simple-code-in-sublime/32357)

<div class="topic-metadata">

**Author:** [@meanderquest](https://discourse.processing.org/u/meanderquest)\
**Replies:** 2\
**Last updated:** [September 22, 2021, 7:26pm UTC](https://discourse.processing.org/t/getting-error-while-build-with-processing-one-simple-code-in-sublime/32357 "2021-09-22T19:26:38Z")

</div>

\[WinError 2\] The system cannot find the file specified \[cmd: \['processing-java', '--force', '--sketch=C:\\\\Users\\\\supriya\\\\Desktop\\\\test1\\\\build', '--output=C:\\\\Users\\\\supriya\\\\Desktop\\\\test1\\\\build/build-tmp', '--run'\]\] …

---

## [Processing in style with Java 11](https://discourse.processing.org/t/processing-in-style-with-java-11/13776)

<div class="topic-metadata">

**Author:** [@sampottinger](https://discourse.processing.org/u/sampottinger)\
**Replies:** 76\
**Last updated:** [September 23, 2021, 1:16pm UTC](https://discourse.processing.org/t/processing-in-style-with-java-11/13776 "2021-09-23T13:16:05Z")

</div>

Hello there! I have been working with some folks on a solution to https://github.com/processing/processing/issues/5750 that includes a bunch of fun things (support for generics, lambdas, local type inference, move to mo…

---

## [PShape Error Fatal Error :1:1:](https://discourse.processing.org/t/pshape-error-fatal-error-1/32285)

<div class="topic-metadata">

**Author:** [@TomLeVeritable](https://discourse.processing.org/u/TomLeVeritable)\
**Replies:** 2\
**Last updated:** [September 23, 2021, 8:18am UTC](https://discourse.processing.org/t/pshape-error-fatal-error-1/32285 "2021-09-23T08:18:45Z")

</div>

Hi I’m trying to use Pshape with this code PShape planet; void setup(){ size(600,600); planet = loadShape("sphere.svg"); } void draw(){ background(0); shape(planet, 250,250,150,100); } and I’ve got this error …

---

## [How do i make gradient lines?](https://discourse.processing.org/t/how-do-i-make-gradient-lines/32377)

<div class="topic-metadata">

**Author:** [@BAE](https://discourse.processing.org/u/BAE)\
**Replies:** 5\
**Last updated:** [September 23, 2021, 8:09am UTC](https://discourse.processing.org/t/how-do-i-make-gradient-lines/32377 "2021-09-23T08:09:30Z")

</div>

Sorry guys. I can’t English well So, I want to know How to make gradient line like this picture? I made shape size(600,600); background(255); fill(255); for(int a=1; a\<6; ++a) for(int b=1; b\<6; ++b) for(int c=1; c\<…

---

## [Get position of PShape](https://discourse.processing.org/t/get-position-of-pshape/32362)

<div class="topic-metadata">

**Author:** [@shishironeal](https://discourse.processing.org/u/shishironeal)\
**Replies:** 3\
**Last updated:** [September 23, 2021, 1:13am UTC](https://discourse.processing.org/t/get-position-of-pshape/32362 "2021-09-23T01:13:00Z")

</div>

I’m loading an SVG using loadShape and I want to get the position of a child PShape so I can draw a bounding box around it. I tried looking through the PShape class and also tried getVertexX (which results in a NPE since…

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

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