# Processing

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

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

**Page:** 156

---

## [Issue with a sorting program](https://discourse.processing.org/t/issue-with-a-sorting-program/27163)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 7\
**Last updated:** [January 18, 2021, 6:28pm UTC](https://discourse.processing.org/t/issue-with-a-sorting-program/27163 "2021-01-18T18:28:50Z")

</div>

Hi! I started created a sorting algorithm, that inserts the highest value on first place (and swaps them) codeArrayList\<Float\> values = new ArrayList\<Float\>(); int n = 600, min = 0, max = 600, it = 0; void …

---

## [Processing 4a3 Release](https://discourse.processing.org/t/processing-4a3-release/27166)

<div class="topic-metadata">

**Author:** [@ProcessingOrg](https://discourse.processing.org/u/ProcessingOrg)\
**Replies:** 0\
**Last updated:** [January 18, 2021, 5:25pm UTC](https://discourse.processing.org/t/processing-4a3-release/27166 "2021-01-18T17:25:11Z")

</div>

We just posted another pre-release of Processing 4! Includes OpenGL updates, video working again on macOS, and lots of other fixes for reliability (link at the bottom of the page): https://processing.org/download/ Plea…

---

## [How should i create a permanent reference to an object](https://discourse.processing.org/t/how-should-i-create-a-permanent-reference-to-an-object/27162)

<div class="topic-metadata">

**Author:** [@canslp](https://discourse.processing.org/u/canslp)\
**Replies:** 5\
**Last updated:** [January 18, 2021, 4:46pm UTC](https://discourse.processing.org/t/how-should-i-create-a-permanent-reference-to-an-object/27162 "2021-01-18T16:46:53Z")

</div>

okay so i’ve recently learned that there are no formal pointers in javascript(??) what’s the best way to create a permanent reference to a dynamic object? i have a class in a game called ‘level’ that has all the informat…

---

## [Beginner question, changing background in pong when ball hits paddle](https://discourse.processing.org/t/beginner-question-changing-background-in-pong-when-ball-hits-paddle/27158)

<div class="topic-metadata">

**Author:** [@lucyteio](https://discourse.processing.org/u/lucyteio)\
**Replies:** 2\
**Last updated:** [January 18, 2021, 2:59pm UTC](https://discourse.processing.org/t/beginner-question-changing-background-in-pong-when-ball-hits-paddle/27158 "2021-01-18T14:59:00Z")

</div>

Hello to all I have an assignment for art school. we have been given the pong game and we must change the code to create a story… I wish to change the background each time the pong hits a paddle. any help would be grat…

---

## [Process folder of PNGs after quicksorting pixels?](https://discourse.processing.org/t/process-folder-of-pngs-after-quicksorting-pixels/27104)

<div class="topic-metadata">

**Author:** [@polokus](https://discourse.processing.org/u/polokus)\
**Replies:** 1\
**Last updated:** [January 18, 2021, 10:33am UTC](https://discourse.processing.org/t/process-folder-of-pngs-after-quicksorting-pixels/27104 "2021-01-18T10:33:18Z")

</div>

Hi everyone! So I’m sort of new to Processing / coding and am having a great time, but stuck at a bit of a hurdle here. I’ve made a modified version of one of these pixel sorting projects by volfegan (specifically the …

---

## [OutOfMemory error after loading many gifs](https://discourse.processing.org/t/outofmemory-error-after-loading-many-gifs/27156)

<div class="topic-metadata">

**Author:** [@AbleYudada](https://discourse.processing.org/u/AbleYudada)\
**Replies:** 3\
**Last updated:** [January 18, 2021, 9:44am UTC](https://discourse.processing.org/t/outofmemory-error-after-loading-many-gifs/27156 "2021-01-18T09:44:59Z")

</div>

import gifAnimation.\*;// ArrayList\<Gif\> loopingGifs;// void setup() { //size(512, 414, P3D); fullScreen(P3D,2); frameRate(60); loopingGifs = new ArrayList\<Gif\>(); } void draw() { if(t&&frameCount…

---

## [\[NOOB\] Making a sinewave clock](https://discourse.processing.org/t/noob-making-a-sinewave-clock/27154)

<div class="topic-metadata">

**Author:** [@arazym](https://discourse.processing.org/u/arazym)\
**Replies:** 0\
**Last updated:** [January 18, 2021, 5:08am UTC](https://discourse.processing.org/t/noob-making-a-sinewave-clock/27154 "2021-01-18T05:08:03Z")

</div>

Hi there, i am trying to make a clock that displays time in an abstract way, I want to use sine waves that resemble seconds,minutes,hours,day,month,year. I wanted to display this via various frequencies. I found follow…

---

## [Fruit is not being eaten by Snake](https://discourse.processing.org/t/fruit-is-not-being-eaten-by-snake/27132)

<div class="topic-metadata">

**Author:** [@Learning-Everyday](https://discourse.processing.org/u/Learning-Everyday)\
**Replies:** 3\
**Last updated:** [January 17, 2021, 10:05pm UTC](https://discourse.processing.org/t/fruit-is-not-being-eaten-by-snake/27132 "2021-01-17T22:05:43Z")

</div>

Hi, I am a beginner in Processing and am having an issue where snakes isn’t eating the fruit. Could you assist with fixing this bug. Thanks in advance Provided below is the code =====================================…

---

## [Checking for a point within a 2D shape (v3.5)](https://discourse.processing.org/t/checking-for-a-point-within-a-2d-shape-v3-5/26874)

<div class="topic-metadata">

**Author:** [@Anon0908](https://discourse.processing.org/u/Anon0908)\
**Replies:** 17\
**Last updated:** [January 17, 2021, 9:59pm UTC](https://discourse.processing.org/t/checking-for-a-point-within-a-2d-shape-v3-5/26874 "2021-01-17T21:59:50Z")

</div>

Say I have a convex polygon and the coordinates of its vertices. Say I wish to check if a coordinate point is within that polygon. How do I do this without an absurd amount of rectangles? My idea is adding the coordinat…

---

## [I press the Russian key, and keyCode does not change](https://discourse.processing.org/t/i-press-the-russian-key-and-keycode-does-not-change/27136)

<div class="topic-metadata">

**Author:** [@Naik\_Trofimov](https://discourse.processing.org/u/Naik_Trofimov)\
**Replies:** 8\
**Last updated:** [January 17, 2021, 9:36pm UTC](https://discourse.processing.org/t/i-press-the-russian-key-and-keycode-does-not-change/27136 "2021-01-17T21:36:34Z")

</div>

When using the Russian keyboard layout, not all letters have their own keyCode, such as: Б Ю Ж Э Х Ъ. On the English keyboard layout they are in the punctuation areas. However key displays them fine. the problem with …

---

## [Use millis to display real time](https://discourse.processing.org/t/use-millis-to-display-real-time/27144)

<div class="topic-metadata">

**Author:** [@saaqib.m](https://discourse.processing.org/u/saaqib.m)\
**Replies:** 7\
**Last updated:** [January 17, 2021, 8:38pm UTC](https://discourse.processing.org/t/use-millis-to-display-real-time/27144 "2021-01-17T20:38:04Z")

</div>

please format code with \</\> button \* homework policy \* asking questions How do I use millis() to display a real time clock? Just a simple hh:mm:ss:ms time display. ms is the milliseconds for every second. If it works…

---

## [Why is frameRate limited when Processing runs in a window?](https://discourse.processing.org/t/why-is-framerate-limited-when-processing-runs-in-a-window/23719)

<div class="topic-metadata">

**Author:** [@Shwaa](https://discourse.processing.org/u/Shwaa)\
**Replies:** 0\
**Last updated:** [September 6, 2020, 10:55pm UTC](https://discourse.processing.org/t/why-is-framerate-limited-when-processing-runs-in-a-window/23719 "2020-09-06T22:55:19Z")

</div>

I’m working on a project in P3D, and I noticed something about performance when the window isn’t focused: the framerate immediately jumps up. I’m working on a relatively beefy PC, so I don’t consider myself limited by pe…

---

## [Utilize Touchpad Scrolling (vertical & horizontal) on Windows?](https://discourse.processing.org/t/utilize-touchpad-scrolling-vertical-horizontal-on-windows/27148)

<div class="topic-metadata">

**Author:** [@Shwaa](https://discourse.processing.org/u/Shwaa)\
**Replies:** 0\
**Last updated:** [January 17, 2021, 8:17pm UTC](https://discourse.processing.org/t/utilize-touchpad-scrolling-vertical-horizontal-on-windows/27148 "2021-01-17T20:17:20Z")

</div>

I recently started a project that wasn’t a game, but a drawing application. With a mouse, the canvas can be moved by dragging the middle mouse button, but on a laptop, even with the gesture to use three fingers to use th…

---

## [Write lines in random sizes one below the other](https://discourse.processing.org/t/write-lines-in-random-sizes-one-below-the-other/27139)

<div class="topic-metadata">

**Author:** [@Ida](https://discourse.processing.org/u/Ida)\
**Replies:** 4\
**Last updated:** [January 17, 2021, 5:28pm UTC](https://discourse.processing.org/t/write-lines-in-random-sizes-one-below-the-other/27139 "2021-01-17T17:28:40Z")

</div>

Hey, I am having trouble with my code. I split my text into lines, which should be drawn in random sizes to the screen. Now, there are two problems: First of all splitTokens deletes all my delimiters, but also ', – and …

---

## [Drawing Portraits](https://discourse.processing.org/t/drawing-portraits/27124)

<div class="topic-metadata">

**Author:** [@cfeldman](https://discourse.processing.org/u/cfeldman)\
**Replies:** 2\
**Last updated:** [January 17, 2021, 2:59pm UTC](https://discourse.processing.org/t/drawing-portraits/27124 "2021-01-17T14:59:23Z")

</div>

Hellow i am searching for differents “Codes” to work with “Portraits”(human, or images) in Processing. I am trying to do differents solutions, differents techniques. ----if you have some advies, please,send to me— Tha…

---

## [Creating collision with unusual shapes](https://discourse.processing.org/t/creating-collision-with-unusual-shapes/27142)

<div class="topic-metadata">

**Author:** [@DeidaraLP](https://discourse.processing.org/u/DeidaraLP)\
**Replies:** 2\
**Last updated:** [January 17, 2021, 12:49pm UTC](https://discourse.processing.org/t/creating-collision-with-unusual-shapes/27142 "2021-01-17T12:49:12Z")

</div>

Hello. Im currently working on my first processing project, and im trying to create a very simple game. In the game you move an airplane with your mouse and have to avoid projectiles coming towards you. The airplane is …

---

## [Need Help with a Pong AI clone](https://discourse.processing.org/t/need-help-with-a-pong-ai-clone/27126)

<div class="topic-metadata">

**Author:** [@SNICKRS](https://discourse.processing.org/u/SNICKRS)\
**Replies:** 1\
**Last updated:** [January 17, 2021, 10:24am UTC](https://discourse.processing.org/t/need-help-with-a-pong-ai-clone/27126 "2021-01-17T10:24:07Z")

</div>

Hello everyone, I made a small pong game a couple of months back, and I decided to revisit it. However, the AI is unbeatable, thus making the game useless. It’s because the AI can cheat in the game, where it can have any…

---

## [Apply methods to a specific object from ArrayList/indexes question](https://discourse.processing.org/t/apply-methods-to-a-specific-object-from-arraylist-indexes-question/27135)

<div class="topic-metadata">

**Author:** [@Elmpt](https://discourse.processing.org/u/Elmpt)\
**Replies:** 1\
**Last updated:** [January 17, 2021, 9:44am UTC](https://discourse.processing.org/t/apply-methods-to-a-specific-object-from-arraylist-indexes-question/27135 "2021-01-17T09:44:09Z")

</div>

Good morning, everyone! I have a new question regarding processing programming. What I am working on: I have an image object that is resized by user, then there is a lot of logic defining what happens with the object n…

---

## [How get image clipboard to PImage](https://discourse.processing.org/t/how-get-image-clipboard-to-pimage/27129)

<div class="topic-metadata">

**Author:** [@molo32](https://discourse.processing.org/u/molo32)\
**Replies:** 0\
**Last updated:** [January 17, 2021, 3:07am UTC](https://discourse.processing.org/t/how-get-image-clipboard-to-pimage/27129 "2021-01-17T03:07:13Z")

</div>

I have this code to get an image from the clipboard when pressing imprt. but it returns Image how do I convert it to PImage? public Image getImageFromClipboard( ) { Transferable transferable = Toolkit.getDefaultToolk…

---

## [Processing, P5\*js, the Web and Apps](https://discourse.processing.org/t/processing-p5-js-the-web-and-apps/27127)

<div class="topic-metadata">

**Author:** [@GeorgeRoland](https://discourse.processing.org/u/GeorgeRoland)\
**Replies:** 2\
**Last updated:** [January 17, 2021, 5:48am UTC](https://discourse.processing.org/t/processing-p5-js-the-web-and-apps/27127 "2021-01-17T05:48:53Z")

</div>

I have been away for several years, and the landscape seems to have changed a lot! I write to clarify and verify some information. I used to make Processing sketches and post them on the Web with processing.js. Is it t…

---

## [Displaying Skeleton from Array on Each Key Press](https://discourse.processing.org/t/displaying-skeleton-from-array-on-each-key-press/27130)

<div class="topic-metadata">

**Author:** [@alenmartel](https://discourse.processing.org/u/alenmartel)\
**Replies:** 0\
**Last updated:** [January 17, 2021, 4:55am UTC](https://discourse.processing.org/t/displaying-skeleton-from-array-on-each-key-press/27130 "2021-01-17T04:55:19Z")

</div>

Hi folks; I am expanding on a previous project that was displaying a 2D shape overtop of live video, but as I learn Processing, I’ve expanded to trying 3D shapes. In particular, I’m using the ISO Skeleton. Now, the issu…

---

## [Is there a way to get the index of an item in array](https://discourse.processing.org/t/is-there-a-way-to-get-the-index-of-an-item-in-array/27113)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 2\
**Last updated:** [January 17, 2021, 2:57am UTC](https://discourse.processing.org/t/is-there-a-way-to-get-the-index-of-an-item-in-array/27113 "2021-01-17T02:57:29Z")

</div>

Is there a way to get the index of an item in an array of a given ArrayList? I know you could use int test(String item) { for(int i = 0; i \< items.size() && items.contains(item); i++) if(item == items.get(i)) retur…

---

## [Intersecting objects in a processing game](https://discourse.processing.org/t/intersecting-objects-in-a-processing-game/27117)

<div class="topic-metadata">

**Author:** [@tryingtocode](https://discourse.processing.org/u/tryingtocode)\
**Replies:** 1\
**Last updated:** [January 17, 2021, 1:04am UTC](https://discourse.processing.org/t/intersecting-objects-in-a-processing-game/27117 "2021-01-17T01:04:03Z")

</div>

I’m making a game, in which when the asteroid hits the spaceship the image should be portrayed on the screen. Below the whole code I pasted a loop, which is wrong and I have no idea how to fix it in order to make the int…

---

## [Printing the band with the highest amplitude (fft)](https://discourse.processing.org/t/printing-the-band-with-the-highest-amplitude-fft/27086)

<div class="topic-metadata">

**Author:** [@Hangmansraven](https://discourse.processing.org/u/Hangmansraven)\
**Replies:** 2\
**Last updated:** [January 16, 2021, 11:00pm UTC](https://discourse.processing.org/t/printing-the-band-with-the-highest-amplitude-fft/27086 "2021-01-16T23:00:31Z")

</div>

Hello, I am currently trying to get into the sound library and especially fft analysis. I want to print the number of the band with the highest amplitude in the console for each draw loop. I used the following code but …

---

## [Can't keep shape overlayed on top of video](https://discourse.processing.org/t/cant-keep-shape-overlayed-on-top-of-video/26867)

<div class="topic-metadata">

**Author:** [@alenmartel](https://discourse.processing.org/u/alenmartel)\
**Replies:** 2\
**Last updated:** [January 16, 2021, 9:27pm UTC](https://discourse.processing.org/t/cant-keep-shape-overlayed-on-top-of-video/26867 "2021-01-16T21:27:03Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hi all - I am trying to have shapes overlay on top of live video whenever I press certain keys; however, I cannot get the shapes to stay overlay…

---

## [How to make a slider](https://discourse.processing.org/t/how-to-make-a-slider/27073)

<div class="topic-metadata">

**Author:** [@Prxt.3k](https://discourse.processing.org/u/Prxt.3k)\
**Replies:** 7\
**Last updated:** [January 16, 2021, 6:57pm UTC](https://discourse.processing.org/t/how-to-make-a-slider/27073 "2021-01-16T18:57:45Z")

</div>

I would like to know how to create 2 sliders, one for the thickness of stroke and the other one for opacity. I am planning to create 5 types of brushstrokes, I hope to make the program, so every time I select a brushst…

---

## [Play files related to words in the order of a text](https://discourse.processing.org/t/play-files-related-to-words-in-the-order-of-a-text/26966)

<div class="topic-metadata">

**Author:** [@Sophie](https://discourse.processing.org/u/Sophie)\
**Replies:** 2\
**Last updated:** [January 12, 2021, 8:03am UTC](https://discourse.processing.org/t/play-files-related-to-words-in-the-order-of-a-text/26966 "2021-01-12T08:03:26Z")

</div>

Hello, My goal is to translate text into sounds and videos according to sound files and video material. I splitted the text into words but I just could not figure out how to correctly search for my words in the text and…

---

## [Some problems with 2d array](https://discourse.processing.org/t/some-problems-with-2d-array/27109)

<div class="topic-metadata">

**Author:** [@deiwy](https://discourse.processing.org/u/deiwy)\
**Replies:** 4\
**Last updated:** [January 16, 2021, 2:01pm UTC](https://discourse.processing.org/t/some-problems-with-2d-array/27109 "2021-01-16T14:01:08Z")

</div>

i create 2d array of map, to create a platformer game, and map is not render correctly platform pl; FloatList plx, ply; int\[\]\[\] map = { {0, 1, 1, 0}, {0, 0, 0, 1}, {0, 1, 1, 0}, {0, 0, 0, 1} }; void setup(…

---

## [Change Image object size with mouse](https://discourse.processing.org/t/change-image-object-size-with-mouse/27077)

<div class="topic-metadata">

**Author:** [@Elmpt](https://discourse.processing.org/u/Elmpt)\
**Replies:** 3\
**Last updated:** [January 16, 2021, 1:42pm UTC](https://discourse.processing.org/t/change-image-object-size-with-mouse/27077 "2021-01-16T13:42:55Z")

</div>

Hi! I’m here again with the question. I have an image object that I would like to display firstly small, but I want that when the user clicks and holds mouse pressed on the image and than starts to move mouse, the image…

---

## [Fast image cropping in Processing](https://discourse.processing.org/t/fast-image-cropping-in-processing/27091)

<div class="topic-metadata">

**Author:** [@r.jaoui](https://discourse.processing.org/u/r.jaoui)\
**Replies:** 6\
**Last updated:** [January 16, 2021, 12:34pm UTC](https://discourse.processing.org/t/fast-image-cropping-in-processing/27091 "2021-01-16T12:34:09Z")

</div>

Hello ! I am currently working on a project that is quite large and I would like to optimize parts of it as soon as possible. In the course of this project, I need to crop some quite large images (around 2K) to a size …

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

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