# Latest

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

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

**Page:** 366

---

## [Can anyone help me shorten my code? or less heavy? (plus how to make a restart button)](https://discourse.processing.org/t/can-anyone-help-me-shorten-my-code-or-less-heavy-plus-how-to-make-a-restart-button/19729)

<div class="topic-metadata">

**Author:** [@haree2000](https://discourse.processing.org/u/haree2000)\
**Replies:** 3\
**Last updated:** [April 15, 2020, 2:55pm UTC](https://discourse.processing.org/t/can-anyone-help-me-shorten-my-code-or-less-heavy-plus-how-to-make-a-restart-button/19729 "2020-04-15T14:55:53Z")

</div>

hey! I’m still really new to processing TT but I’m getting there!! right now I want to make a short interactive story using processing(IDK if that’s a good idea or not but I’m trying!) so I got it down pretty well!! b…

---

## [P3D crashes on start](https://discourse.processing.org/t/p3d-crashes-on-start/2169)

<div class="topic-metadata">

**Author:** [@madbrine](https://discourse.processing.org/u/madbrine)\
**Replies:** 3\
**Last updated:** [April 15, 2020, 10:41am UTC](https://discourse.processing.org/t/p3d-crashes-on-start/2169 "2020-04-15T10:41:28Z")

</div>

I’m trying to work on a project… I ran size(854,480,P3D) and it crashed while loading. Then I took off the P3D and it ran fine… Errors: Nativewindow X11 IOError: Display 0x7fc0f80f3cb0 (:0): Resource temporarily unavail…

---

## [PDF renderer drawing shapes in different order then the Sketch](https://discourse.processing.org/t/pdf-renderer-drawing-shapes-in-different-order-then-the-sketch/19747)

<div class="topic-metadata">

**Author:** [@LuisFerreira](https://discourse.processing.org/u/LuisFerreira)\
**Replies:** 5\
**Last updated:** [April 15, 2020, 9:57am UTC](https://discourse.processing.org/t/pdf-renderer-drawing-shapes-in-different-order-then-the-sketch/19747 "2020-04-15T09:57:06Z")

</div>

Hi everyone, i am having a problem exporting my sketch to PDF. As you can see on the Sketch’s screenshot, everything looks as it should. However the result i get on PDF, the other screenshot, is missing some elements, n…

---

## [Calculator plus sign will not show on the display screen, Any ideas?](https://discourse.processing.org/t/calculator-plus-sign-will-not-show-on-the-display-screen-any-ideas/19790)

<div class="topic-metadata">

**Author:** [@WeeBoEtte](https://discourse.processing.org/u/WeeBoEtte)\
**Replies:** 6\
**Last updated:** [April 15, 2020, 8:31am UTC](https://discourse.processing.org/t/calculator-plus-sign-will-not-show-on-the-display-screen-any-ideas/19790 "2020-04-15T08:31:16Z")

</div>

Hello, I am trying to make a simple calculator in processing, but when I click the plus sign, it does not display, instead, a little box displays. Any ideas? Calculator tab Keypad keyPad; color backgroundC = color(200…

---

## [How to make grids of shapes react differently from each other?](https://discourse.processing.org/t/how-to-make-grids-of-shapes-react-differently-from-each-other/19751)

<div class="topic-metadata">

**Author:** [@358sebastian](https://discourse.processing.org/u/358sebastian)\
**Replies:** 7\
**Last updated:** [April 15, 2020, 7:47am UTC](https://discourse.processing.org/t/how-to-make-grids-of-shapes-react-differently-from-each-other/19751 "2020-04-15T07:47:37Z")

</div>

Hi. I’m wondering how, if possible, to have grids of shapes react to audio in different times from each other? I have grids of Ellipses reacting to an audio input at the exact same time, but I want some Ellipses to rea…

---

## [How would I condense this code into classes, objects etc?](https://discourse.processing.org/t/how-would-i-condense-this-code-into-classes-objects-etc/19791)

<div class="topic-metadata">

**Author:** [@WeeBoEtte](https://discourse.processing.org/u/WeeBoEtte)\
**Replies:** 2\
**Last updated:** [April 15, 2020, 7:25am UTC](https://discourse.processing.org/t/how-would-i-condense-this-code-into-classes-objects-etc/19791 "2020-04-15T07:25:33Z")

</div>

I stumbled across this online, and I want to use it for reference, but it seems really jumbled. Any idea how I can organize this better into objects, classes, etc? color background\_color = color(58, 250, 94); color entr…

---

## [Fixed navigation menu](https://discourse.processing.org/t/fixed-navigation-menu/19766)

<div class="topic-metadata">

**Author:** [@Rahulm2310](https://discourse.processing.org/u/Rahulm2310)\
**Replies:** 4\
**Last updated:** [April 15, 2020, 7:25am UTC](https://discourse.processing.org/t/fixed-navigation-menu/19766 "2020-04-15T07:25:16Z")

</div>

I propose this feature to have a fixed menu on the p5.js website. This will surely increase the accessibility and ease navigation on website. The menu should fix after little scroll and the webpage content should be scr…

---

## [Web parsing through a Harvey Norman](https://discourse.processing.org/t/web-parsing-through-a-harvey-norman/19638)

<div class="topic-metadata">

**Author:** [@Water99](https://discourse.processing.org/u/Water99)\
**Replies:** 2\
**Last updated:** [April 15, 2020, 3:42am UTC](https://discourse.processing.org/t/web-parsing-through-a-harvey-norman/19638 "2020-04-15T03:42:23Z")

</div>

Hello everyone, so I am pretty young and just getting into processing 2 years ago. I am doing this competition where I am planning to do some web scraping/parsing through Harvey Norman’s website. The project needs to be …

---

## [Using defined colors from an array](https://discourse.processing.org/t/using-defined-colors-from-an-array/19781)

<div class="topic-metadata">

**Author:** [@debxyz](https://discourse.processing.org/u/debxyz)\
**Replies:** 12\
**Last updated:** [April 15, 2020, 12:06am UTC](https://discourse.processing.org/t/using-defined-colors-from-an-array/19781 "2020-04-15T00:06:22Z")

</div>

I am trying to figure out how to access the 5 grays in the array randomly to fill() the arc shape and rectangle. Seems like it should be pretty easy to do but… And haven’t been able to find anything in my books or onli…

---

## [How to get the colour of a PShape?](https://discourse.processing.org/t/how-to-get-the-colour-of-a-pshape/19787)

<div class="topic-metadata">

**Author:** [@Cybernet](https://discourse.processing.org/u/Cybernet)\
**Replies:** 1\
**Last updated:** [April 14, 2020, 11:05pm UTC](https://discourse.processing.org/t/how-to-get-the-colour-of-a-pshape/19787 "2020-04-14T23:05:30Z")

</div>

I have a Pshape like this: PShape s; s.setFill(0); if (s colour == color(0)) How do I detect the PShape colour? Do I have to create my own PShape class?

---

## [How to detect if two lines are intersecting?](https://discourse.processing.org/t/how-to-detect-if-two-lines-are-intersecting/19636)

<div class="topic-metadata">

**Author:** [@Cybernet](https://discourse.processing.org/u/Cybernet)\
**Replies:** 7\
**Last updated:** [April 14, 2020, 10:38pm UTC](https://discourse.processing.org/t/how-to-detect-if-two-lines-are-intersecting/19636 "2020-04-14T22:38:16Z")

</div>

So if you have two lines, and they both can be curvy or straight, how do you tell if they are intersecting? Is there a way to do it with colours?

---

## [I have to create a program](https://discourse.processing.org/t/i-have-to-create-a-program/19783)

<div class="topic-metadata">

**Author:** [@mcaaaalvo](https://discourse.processing.org/u/mcaaaalvo)\
**Replies:** 3\
**Last updated:** [April 14, 2020, 10:25pm UTC](https://discourse.processing.org/t/i-have-to-create-a-program/19783 "2020-04-14T22:25:39Z")

</div>

THANKS EVERYONE :smile: :smile: :smile: :smile: :smile: :smile: :smile: :smile: :smile:

---

## [For loop structure for arrays](https://discourse.processing.org/t/for-loop-structure-for-arrays/19250)

<div class="topic-metadata">

**Author:** [@SheCurvesMobius](https://discourse.processing.org/u/SheCurvesMobius)\
**Replies:** 12\
**Last updated:** [April 14, 2020, 10:00pm UTC](https://discourse.processing.org/t/for-loop-structure-for-arrays/19250 "2020-04-14T22:00:42Z")

</div>

Hello, I’m trying to wrap my head around the for loop structure for arrays. Is there a way to assign values to the elements in the array using the array for loop structure: for(int i : arrayName)? I’ve done this but it…

---

## [How to use switch() in a custom function?](https://discourse.processing.org/t/how-to-use-switch-in-a-custom-function/19753)

<div class="topic-metadata">

**Author:** [@codebodger](https://discourse.processing.org/u/codebodger)\
**Replies:** 5\
**Last updated:** [April 14, 2020, 9:40pm UTC](https://discourse.processing.org/t/how-to-use-switch-in-a-custom-function/19753 "2020-04-14T21:40:54Z")

</div>

I need to create a function called tpc, taking in one integer argument, and returning an integer based on a switch function. I have already written the switch function, and it is quite simple. The return function autom…

---

## [Simple ArrayIndex problem](https://discourse.processing.org/t/simple-arrayindex-problem/19434)

<div class="topic-metadata">

**Author:** [@vjjv](https://discourse.processing.org/u/vjjv)\
**Replies:** 8\
**Last updated:** [April 14, 2020, 9:21pm UTC](https://discourse.processing.org/t/simple-arrayindex-problem/19434 "2020-04-14T21:21:20Z")

</div>

Hi! I\`ve a simple problem, but i couldnt find a solution. Im building a function that generate points, and i want to draw a line between those points, building a triangle: float size = 200; ArrayList\<PVector\>positions…

---

## [Can 2 buttons call the same function and detect which button was pressed?](https://discourse.processing.org/t/can-2-buttons-call-the-same-function-and-detect-which-button-was-pressed/19654)

<div class="topic-metadata">

**Author:** [@Bassam](https://discourse.processing.org/u/Bassam)\
**Replies:** 2\
**Last updated:** [April 11, 2020, 4:16pm UTC](https://discourse.processing.org/t/can-2-buttons-call-the-same-function-and-detect-which-button-was-pressed/19654 "2020-04-11T16:16:59Z")

</div>

I have 2 images on a canvas and each image has it’s own button. When the first button is pressed, the first image is selected. When the second button is pressed, the second image is selected. button1 = createButton("S…

---

## [Make this code better](https://discourse.processing.org/t/make-this-code-better/19770)

<div class="topic-metadata">

**Author:** [@gurki](https://discourse.processing.org/u/gurki)\
**Replies:** 8\
**Last updated:** [April 14, 2020, 7:21pm UTC](https://discourse.processing.org/t/make-this-code-better/19770 "2020-04-14T19:21:28Z")

</div>

Hello again, I made an code for one task of the exam. But it is not 100% correct. Can sameone give me an hint to make this code better? This is the task in the exam ( it is in german); Schreiben Sie zwei Funktionen:…

---

## [Length won't work in a function](https://discourse.processing.org/t/length-wont-work-in-a-function/19780)

<div class="topic-metadata">

**Author:** [@codebodger](https://discourse.processing.org/u/codebodger)\
**Replies:** 2\
**Last updated:** [April 14, 2020, 6:21pm UTC](https://discourse.processing.org/t/length-wont-work-in-a-function/19780 "2020-04-14T18:21:48Z")

</div>

I have a fairly simple custom function. It takes two inputs (an int\[\] and an int) and returns an int\[\]. It takes the length of the int\[\] input, however it gives the error The variable "length" does not exist Here is a…

---

## [Has anyone here ever tried handtracking with a Kinect before?(On macOs)](https://discourse.processing.org/t/has-anyone-here-ever-tried-handtracking-with-a-kinect-before-on-macos/19388)

<div class="topic-metadata">

**Author:** [@farukhcasy2](https://discourse.processing.org/u/farukhcasy2)\
**Replies:** 4\
**Last updated:** [April 14, 2020, 5:04pm UTC](https://discourse.processing.org/t/has-anyone-here-ever-tried-handtracking-with-a-kinect-before-on-macos/19388 "2020-04-14T17:04:48Z")

</div>

Hey there! My name is Sam and I am writing my thesis surrounding the subject of deformable displays and 3D interactions. My setup (at the moment) has a Kinect behind a textile screen that tracks one point on the screen a…

---

## [Why does it happen?](https://discourse.processing.org/t/why-does-it-happen/19772)

<div class="topic-metadata">

**Author:** [@Orlando](https://discourse.processing.org/u/Orlando)\
**Replies:** 2\
**Last updated:** [April 14, 2020, 5:37pm UTC](https://discourse.processing.org/t/why-does-it-happen/19772 "2020-04-14T17:37:55Z")

</div>

Hello. Why my program doesn’t return the sequel 0.0, 0.1, 0.2, 0.3, 0.4, 0.5… and so on ??? Take a look: var c; function setup() { createCanvas(400, 400); c = 0; } function draw() { c += 0.1 print(c); } And t…

---

## [How to draw a hexagon from a line?](https://discourse.processing.org/t/how-to-draw-a-hexagon-from-a-line/19768)

<div class="topic-metadata">

**Author:** [@Tauter](https://discourse.processing.org/u/Tauter)\
**Replies:** 2\
**Last updated:** [April 14, 2020, 2:15pm UTC](https://discourse.processing.org/t/how-to-draw-a-hexagon-from-a-line/19768 "2020-04-14T14:15:24Z")

</div>

With given 2 point for example: (200,100) and (245,200), how can i make a hexagon out of this ? The hexagon should be drawn to the left side of the line. I can’t figure it out, no matter how i try. I can’t use anything…

---

## [Making a shape face the mouse](https://discourse.processing.org/t/making-a-shape-face-the-mouse/19735)

<div class="topic-metadata">

**Author:** [@poppyseeds](https://discourse.processing.org/u/poppyseeds)\
**Replies:** 3\
**Last updated:** [April 14, 2020, 10:30am UTC](https://discourse.processing.org/t/making-a-shape-face-the-mouse/19735 "2020-04-14T10:30:15Z")

</div>

In this sketch, I have two ellipses that look like a fish. It follows the position of the invisible cursor. Along with moving as it currently is, I want to make the fish face the cursor at all times which means if i move…

---

## [P5.sound problem with chrome and opera](https://discourse.processing.org/t/p5-sound-problem-with-chrome-and-opera/19500)

<div class="topic-metadata">

**Author:** [@iana](https://discourse.processing.org/u/iana)\
**Replies:** 2\
**Last updated:** [April 14, 2020, 10:22am UTC](https://discourse.processing.org/t/p5-sound-problem-with-chrome-and-opera/19500 "2020-04-14T10:22:57Z")

</div>

function setup(){ } It seems that any p5.js code (as above) in combination with loading any p5.sound library results in an error in latest versions of Chrome and Opera when run on a http web server (Apache linux). Run…

---

## [Changing target positions of vehicles](https://discourse.processing.org/t/changing-target-positions-of-vehicles/19738)

<div class="topic-metadata">

**Author:** [@poppyseeds](https://discourse.processing.org/u/poppyseeds)\
**Replies:** 4\
**Last updated:** [April 14, 2020, 9:42am UTC](https://discourse.processing.org/t/changing-target-positions-of-vehicles/19738 "2020-04-14T09:42:26Z")

</div>

In this project, I have used the text to point function to create vehicles which exhibit the seek, arrive and flee behaviours. Currently, the vehicles form the word ‘SWIMMY’ which is the start and target position. On cli…

---

## [Text seems jittery when moving in a circular pattern](https://discourse.processing.org/t/text-seems-jittery-when-moving-in-a-circular-pattern/19548)

<div class="topic-metadata">

**Author:** [@ottenm](https://discourse.processing.org/u/ottenm)\
**Replies:** 10\
**Last updated:** [April 14, 2020, 7:53am UTC](https://discourse.processing.org/t/text-seems-jittery-when-moving-in-a-circular-pattern/19548 "2020-04-14T07:53:55Z")

</div>

I’m struggling to get an ellipse-with-text moving around the screen smoothly. Is it just me or is the text jittering a lot more than the ellipse? It seems like the ellipse shake is minimal/tolerable, but the text shake…

---

## [How far can p5js projects be pushed with imported images?](https://discourse.processing.org/t/how-far-can-p5js-projects-be-pushed-with-imported-images/19446)

<div class="topic-metadata">

**Author:** [@mnoble](https://discourse.processing.org/u/mnoble)\
**Replies:** 3\
**Last updated:** [April 14, 2020, 4:31am UTC](https://discourse.processing.org/t/how-far-can-p5js-projects-be-pushed-with-imported-images/19446 "2020-04-14T04:31:40Z")

</div>

Hello Coders, Artists, and Educators, I am a high school teacher in California and I am about to convert my class to remote because of the virus spread. We have worked exclusively with Processing in the classroom but I …

---

## [Can not load images/files easily like before?!](https://discourse.processing.org/t/can-not-load-images-files-easily-like-before/19760)

<div class="topic-metadata">

**Author:** [@megarou](https://discourse.processing.org/u/megarou)\
**Replies:** 2\
**Last updated:** [April 14, 2020, 1:38am UTC](https://discourse.processing.org/t/can-not-load-images-files-easily-like-before/19760 "2020-04-14T01:38:22Z")

</div>

Hello there, i’m having an big issues/problems in loading & inserting images in to p5.js, lately the new editing of the program, it ask you to enter the file’s name, & when i entered the file/image’s name; it doesn’t acc…

---

## [Is it possible to run files in the same folder (sketch) separately?](https://discourse.processing.org/t/is-it-possible-to-run-files-in-the-same-folder-sketch-separately/19756)

<div class="topic-metadata">

**Author:** [@codebodger](https://discourse.processing.org/u/codebodger)\
**Replies:** 1\
**Last updated:** [April 13, 2020, 9:43pm UTC](https://discourse.processing.org/t/is-it-possible-to-run-files-in-the-same-folder-sketch-separately/19756 "2020-04-13T21:43:46Z")

</div>

Is it possible to run files in the same folder (sketch) separately? I have two files (\*.pde) in one sketch folder. I need to open them separately and run them separately. Is there a way to do this? If so, what is it? …

---

## [Text box of points Nr. 2](https://discourse.processing.org/t/text-box-of-points-nr-2/19755)

<div class="topic-metadata">

**Author:** [@gurki](https://discourse.processing.org/u/gurki)\
**Replies:** 3\
**Last updated:** [April 13, 2020, 7:23pm UTC](https://discourse.processing.org/t/text-box-of-points-nr-2/19755 "2020-04-13T19:23:15Z")

</div>

Hello again, I have this task. It is in german: Schreiben Sie die FunkQon makeX() mit dem Parameter size. Ihre FunkQon sollte einen (Text-)Kasten der entsprechenden Höhe und Breite zeichnen, bestehend aus Punkten un…

---

## [Text box of points / Textkasten, bestehend aus Punkten](https://discourse.processing.org/t/text-box-of-points-textkasten-bestehend-aus-punkten/19754)

<div class="topic-metadata">

**Author:** [@gurki](https://discourse.processing.org/u/gurki)\
**Replies:** 21\
**Last updated:** [April 13, 2020, 6:59pm UTC](https://discourse.processing.org/t/text-box-of-points-textkasten-bestehend-aus-punkten/19754 "2020-04-13T18:59:14Z")

</div>

The next task is this one (also in german): Schreiben Sie eine Funktion kreuz() mit vier den Parametern: hoehe, breite, zeile, spalte. Ihre Funktion sollte einen (Text-)Kasten der entsprechenden Höhe und Breite zeichne…

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

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