# Coding Questions

**URL:** https://discourse.processing.org/c/processing/processing-questions/15.md?page=13

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

**Page:** 14

---

## [Weird ArrayOutOfBound issue, using PShape](https://discourse.processing.org/t/weird-arrayoutofbound-issue-using-pshape/41529)

<div class="topic-metadata">

**Author:** [@jokoko](https://discourse.processing.org/u/jokoko)\
**Replies:** 4\
**Last updated:** [March 31, 2023, 2:58pm UTC](https://discourse.processing.org/t/weird-arrayoutofbound-issue-using-pshape/41529 "2023-03-31T14:58:02Z")

</div>

Hi there, I’m working on a project, involving video, svg and createdShape, displayed in 3 “sub-window” (actually 3 “rectangles” drawn in the main window canva) -the aim is to map it on 3 screen surfaces. I’d like to us…

---

## [Delta between two decibel signal](https://discourse.processing.org/t/delta-between-two-decibel-signal/41442)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 7\
**Last updated:** [March 26, 2023, 3:17pm UTC](https://discourse.processing.org/t/delta-between-two-decibel-signal/41442 "2023-03-26T15:17:29Z")

</div>

Hi, I’m trying to return the difference between to signal. The difference is L1 I tried this but the problem is with pow Thanks for helping :wink: float splitTimeLfo, oldSplitTimeLfo; void setup() { int i = 12…

---

## [Image not loading in draw method](https://discourse.processing.org/t/image-not-loading-in-draw-method/41511)

<div class="topic-metadata">

**Author:** [@Random\_Ghost](https://discourse.processing.org/u/Random_Ghost)\
**Replies:** 3\
**Last updated:** [March 29, 2023, 12:39pm UTC](https://discourse.processing.org/t/image-not-loading-in-draw-method/41511 "2023-03-29T12:39:42Z")

</div>

I tried creating an image array in the setup method, but no matter what I do, the images won’t show up if I try to draw it in the draw method. It works fine in setup but I need to use it in draw. Any suggestions. void s…

---

## [Blank SVG export](https://discourse.processing.org/t/blank-svg-export/41460)

<div class="topic-metadata">

**Author:** [@asymmetric](https://discourse.processing.org/u/asymmetric)\
**Replies:** 3\
**Last updated:** [March 28, 2023, 6:42pm UTC](https://discourse.processing.org/t/blank-svg-export/41460 "2023-03-28T18:42:18Z")

</div>

Hi, I’m trying to export the following code output vis processing.js, but the .SVG file is blank white whenever I do so. What am I doing wrong?

---

## [Access array using composite symbol name](https://discourse.processing.org/t/access-array-using-composite-symbol-name/41462)

<div class="topic-metadata">

**Author:** [@jmmmp](https://discourse.processing.org/u/jmmmp)\
**Replies:** 2\
**Last updated:** [March 28, 2023, 9:51am UTC](https://discourse.processing.org/t/access-array-using-composite-symbol-name/41462 "2023-03-28T09:51:29Z")

</div>

Hello, I have several arrays which are loaded from text files, e.g. array1 = loadStrings(“marker-energy-sc2.txt”); , then array2, array3, etc. I would need to access values in those arrays based on another value coming…

---

## [What is padding offset and roundness? What do you use it for?](https://discourse.processing.org/t/what-is-padding-offset-and-roundness-what-do-you-use-it-for/41465)

<div class="topic-metadata">

**Author:** [@Rvy](https://discourse.processing.org/u/Rvy)\
**Replies:** 1\
**Last updated:** [March 28, 2023, 8:00am UTC](https://discourse.processing.org/t/what-is-padding-offset-and-roundness-what-do-you-use-it-for/41465 "2023-03-28T08:00:25Z")

</div>

I don’t quite understand about padding offset and roundness in java What does we use it for? Can anyone please kindly explain it to me?

---

## [Change sketch window color?](https://discourse.processing.org/t/change-sketch-window-color/41481)

<div class="topic-metadata">

**Author:** [@Aryszin](https://discourse.processing.org/u/Aryszin)\
**Replies:** 1\
**Last updated:** [March 27, 2023, 11:56pm UTC](https://discourse.processing.org/t/change-sketch-window-color/41481 "2023-03-27T23:56:44Z")

</div>

Is it possible to change the windowcolor from the sketch to black? probably is but i dont know anything about java awt. please if anyone knows give me the smallest code possible! ty :smiley:

---

## [Sort PVector array by distance](https://discourse.processing.org/t/sort-pvector-array-by-distance/4737)

<div class="topic-metadata">

**Author:** [@Darkar25](https://discourse.processing.org/u/Darkar25)\
**Replies:** 9\
**Last updated:** [October 24, 2018, 4:51pm UTC](https://discourse.processing.org/t/sort-pvector-array-by-distance/4737 "2018-10-24T16:51:57Z")

</div>

I want to sort PVector\[\] array by distance between points…but idk how to do that correctly…i tried to make that by myself but stuck a tsorting…i can calculate distance but sort…idk how…help pls… UPD:solution: void sort…

---

## [Creating and disposing of PApplet windows](https://discourse.processing.org/t/creating-and-disposing-of-papplet-windows/41476)

<div class="topic-metadata">

**Author:** [@esc746](https://discourse.processing.org/u/esc746)\
**Replies:** 0\
**Last updated:** [March 27, 2023, 3:06pm UTC](https://discourse.processing.org/t/creating-and-disposing-of-papplet-windows/41476 "2023-03-27T15:06:02Z")

</div>

In Processing 4 the sample code shows how to create multiple windows, but not how to destroy them. All help threads are old and the code I found does not function in version 4. I do not merely wish to hide a window, but …

---

## [Read and edit a text file (Editor)](https://discourse.processing.org/t/read-and-edit-a-text-file-editor/38301)

<div class="topic-metadata">

**Author:** [@jensemand](https://discourse.processing.org/u/jensemand)\
**Replies:** 10\
**Last updated:** [March 26, 2023, 4:15am UTC](https://discourse.processing.org/t/read-and-edit-a-text-file-editor/38301 "2023-03-26T04:15:48Z")

</div>

Hi everyone, I was wondering if anyone has a simple program that can read each line of a txt-file and edit a specific line if you want to. Thank you to everyone who can help!

---

## [Help: Loop/While with millis](https://discourse.processing.org/t/help-loop-while-with-millis/41433)

<div class="topic-metadata">

**Author:** [@xnainie](https://discourse.processing.org/u/xnainie)\
**Replies:** 2\
**Last updated:** [March 24, 2023, 5:52pm UTC](https://discourse.processing.org/t/help-loop-while-with-millis/41433 "2023-03-24T17:52:38Z")

</div>

Hi, i want to make an disco room and it has too keep chaning in the meanwhile you are there. i have it with millis but then i have to make a lot of codes

---

## [Scrolling shape not closing](https://discourse.processing.org/t/scrolling-shape-not-closing/41407)

<div class="topic-metadata">

**Author:** [@eltrem](https://discourse.processing.org/u/eltrem)\
**Replies:** 3\
**Last updated:** [March 24, 2023, 8:55am UTC](https://discourse.processing.org/t/scrolling-shape-not-closing/41407 "2023-03-24T08:55:21Z")

</div>

Hi everyone! I’m fighting with a problem with shapes that i can’t solve. I want to draw scrolling shapes based on external data i receive through OSC (imagine this like some kind of data oscilloscope). I’m simulating t…

---

## [Interpolation between two radian angle. Circular movement and Perfect arabesque to reach ;)](https://discourse.processing.org/t/interpolation-between-two-radian-angle-circular-movement-and-perfect-arabesque-to-reach/41395)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 0\
**Last updated:** [March 21, 2023, 7:04pm UTC](https://discourse.processing.org/t/interpolation-between-two-radian-angle-circular-movement-and-perfect-arabesque-to-reach/41395 "2023-03-21T19:04:35Z")

</div>

Hi ! I’m trying to sample movements on a motor position sensor. This movement goes more or less quickly and always in the same direction. The first goal is: To repeat these circular movements and ensure that there is…

---

## [Create an intermediate point](https://discourse.processing.org/t/create-an-intermediate-point/41318)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 26\
**Last updated:** [March 22, 2023, 1:10pm UTC](https://discourse.processing.org/t/create-an-intermediate-point/41318 "2023-03-22T13:10:31Z")

</div>

Hello all! For an artistic project, I sample for two seconds a pseudo circle (not entirely finished) drawn with the mouse. Then this shape repeats itself. I would like to add between the last and the first point drawn…

---

## [I am building a game, and I'm having trouble with borders](https://discourse.processing.org/t/i-am-building-a-game-and-im-having-trouble-with-borders/41299)

<div class="topic-metadata">

**Author:** [@DividedRabbit](https://discourse.processing.org/u/DividedRabbit)\
**Replies:** 1\
**Last updated:** [March 21, 2023, 5:43pm UTC](https://discourse.processing.org/t/i-am-building-a-game-and-im-having-trouble-with-borders/41299 "2023-03-21T17:43:16Z")

</div>

Hello, I am making a small game and the borders are not working correctly. void move() { if (w) { if (a) { if (direction \> 1 && direction \<= 5) { turn += .03; } else { …

---

## [How do i make a crash handler?](https://discourse.processing.org/t/how-do-i-make-a-crash-handler/41387)

<div class="topic-metadata">

**Author:** [@Aryszin](https://discourse.processing.org/u/Aryszin)\
**Replies:** 2\
**Last updated:** [March 21, 2023, 6:03pm UTC](https://discourse.processing.org/t/how-do-i-make-a-crash-handler/41387 "2023-03-21T18:03:55Z")

</div>

Possible to make a crash handler that displays error logs?

---

## [Interception function not working](https://discourse.processing.org/t/interception-function-not-working/41351)

<div class="topic-metadata">

**Author:** [@Fey-Lyn](https://discourse.processing.org/u/Fey-Lyn)\
**Replies:** 3\
**Last updated:** [March 20, 2023, 4:48pm UTC](https://discourse.processing.org/t/interception-function-not-working/41351 "2023-03-20T16:48:42Z")

</div>

I can’t figure out why my intercept function is not working… It isn’t being ignored completely, just going off in the wrong spot and consistently, not just when it intersects. No code please. Basket gold; Basket pink; S…

---

## [Calculating if a dot is on a drawn line](https://discourse.processing.org/t/calculating-if-a-dot-is-on-a-drawn-line/41221)

<div class="topic-metadata">

**Author:** [@Ingo](https://discourse.processing.org/u/Ingo)\
**Replies:** 3\
**Last updated:** [March 20, 2023, 11:14am UTC](https://discourse.processing.org/t/calculating-if-a-dot-is-on-a-drawn-line/41221 "2023-03-20T11:14:32Z")

</div>

Hi everyone, I’d like to program a game in processing (Java) in which the player draws a possibly curved line and next makes a dot on this line. I think, I would draw the line only with pixels, not lines oder bezier-cur…

---

## [Pong Game: Trying to add a "Press Space"-key to play the game again in the same playermode in winnerAnnouncer() without going to the home menu again](https://discourse.processing.org/t/pong-game-trying-to-add-a-press-space-key-to-play-the-game-again-in-the-same-playermode-in-winnerannouncer-without-going-to-the-home-menu-again/41325)

<div class="topic-metadata">

**Author:** [@sabisiiuuu](https://discourse.processing.org/u/sabisiiuuu)\
**Replies:** 7\
**Last updated:** [March 16, 2023, 10:33pm UTC](https://discourse.processing.org/t/pong-game-trying-to-add-a-press-space-key-to-play-the-game-again-in-the-same-playermode-in-winnerannouncer-without-going-to-the-home-menu-again/41325 "2023-03-16T22:33:34Z")

</div>

Hello everyone: The game is complete btw, but I just wanted to add this little feature mentioned in the title before presenting it. So when the game’s over, it opens the winnerAnnouncer() function saying who won and to…

---

## [Help: scenes in Processing](https://discourse.processing.org/t/help-scenes-in-processing/41330)

<div class="topic-metadata">

**Author:** [@xnainie](https://discourse.processing.org/u/xnainie)\
**Replies:** 2\
**Last updated:** [March 16, 2023, 9:46pm UTC](https://discourse.processing.org/t/help-scenes-in-processing/41330 "2023-03-16T21:46:03Z")

</div>

hello, I am working on an interactive story in processing only I am running into some things. I am quite new and I don’t understand everything yet but would like to learn. I have made my codes very basic, now comes the …

---

## [How to check if a search for a table row is successful](https://discourse.processing.org/t/how-to-check-if-a-search-for-a-table-row-is-successful/41320)

<div class="topic-metadata">

**Author:** [@proc8888](https://discourse.processing.org/u/proc8888)\
**Replies:** 2\
**Last updated:** [March 16, 2023, 3:12pm UTC](https://discourse.processing.org/t/how-to-check-if-a-search-for-a-table-row-is-successful/41320 "2023-03-16T15:12:37Z")

</div>

I am looking for a table row to retrieve some column values. The table row may or may not be there. How do I code to check if the ‘findRow’ is successful? Currrently I get an error ‘NullPointerException’ in the coding…

---

## [Pong Game: Trying to make 4 different messages for when a different player wins: "You won", "bot won", "player 1 won" and "player 2 won". Could only make 2: "Player 1 won" and "Player 2 or Bot won"](https://discourse.processing.org/t/pong-game-trying-to-make-4-different-messages-for-when-a-different-player-wins-you-won-bot-won-player-1-won-and-player-2-won-could-only-make-2-player-1-won-and-player-2-or-bot-won/41310)

<div class="topic-metadata">

**Author:** [@sabisiiuuu](https://discourse.processing.org/u/sabisiiuuu)\
**Replies:** 1\
**Last updated:** [March 16, 2023, 8:58am UTC](https://discourse.processing.org/t/pong-game-trying-to-make-4-different-messages-for-when-a-different-player-wins-you-won-bot-won-player-1-won-and-player-2-won-could-only-make-2-player-1-won-and-player-2-or-bot-won/41310 "2023-03-16T08:58:28Z")

</div>

Hello everyone! Basically the question. I am making a Pong Game and it is actually finished, but I just want to make it more perfect. I am only lacking these particular messages for when a winner has to be announced. I …

---

## [Problems with old code in Processing 3.0](https://discourse.processing.org/t/problems-with-old-code-in-processing-3-0/41276)

<div class="topic-metadata">

**Author:** [@aespona](https://discourse.processing.org/u/aespona)\
**Replies:** 4\
**Last updated:** [March 15, 2023, 8:14pm UTC](https://discourse.processing.org/t/problems-with-old-code-in-processing-3-0/41276 "2023-03-15T20:14:03Z")

</div>

Hello everyone, I’m new here. Sorry for my english, I’m from Spain. I have problems displaying a code that was written on a Imac 2009 in processing 3.0. Now I work with Mac Air with an M1 processor and when I run th…

---

## [Easier way for saving image in thread?](https://discourse.processing.org/t/easier-way-for-saving-image-in-thread/41270)

<div class="topic-metadata">

**Author:** [@Aryszin](https://discourse.processing.org/u/Aryszin)\
**Replies:** 6\
**Last updated:** [March 15, 2023, 2:11pm UTC](https://discourse.processing.org/t/easier-way-for-saving-image-in-thread/41270 "2023-03-15T14:11:20Z")

</div>

So I have a drawing programm, that needs to load in images & save them. Is there something that makes it faster. For example I have an 4k image, that needs to be saved. It takes like 3 seconds. And I do not want to use p…

---

## [Create advanced shot](https://discourse.processing.org/t/create-advanced-shot/41245)

<div class="topic-metadata">

**Author:** [@hokuto](https://discourse.processing.org/u/hokuto)\
**Replies:** 6\
**Last updated:** [March 14, 2023, 7:02pm UTC](https://discourse.processing.org/t/create-advanced-shot/41245 "2023-03-14T19:02:24Z")

</div>

I know it’s a bit excessive, but how can you program these types of shots? https://youtu.be/3G3aKt7by0A

---

## [Keyboard detect if not focused?](https://discourse.processing.org/t/keyboard-detect-if-not-focused/41248)

<div class="topic-metadata">

**Author:** [@Aryszin](https://discourse.processing.org/u/Aryszin)\
**Replies:** 1\
**Last updated:** [March 12, 2023, 7:34pm UTC](https://discourse.processing.org/t/keyboard-detect-if-not-focused/41248 "2023-03-12T19:34:54Z")

</div>

Am i able to detect key input even if the window is not focused?

---

## [Align the arrows with the route or how to follow a path (planes)](https://discourse.processing.org/t/align-the-arrows-with-the-route-or-how-to-follow-a-path-planes/41188)

<div class="topic-metadata">

**Author:** [@hokuto](https://discourse.processing.org/u/hokuto)\
**Replies:** 17\
**Last updated:** [March 12, 2023, 12:56pm UTC](https://discourse.processing.org/t/align-the-arrows-with-the-route-or-how-to-follow-a-path-planes/41188 "2023-03-12T12:56:52Z")

</div>

This question is specially for “quark”, but anyone can answer it. I have seen a video on the quark youtube channel where some arrows move along some paths, I would like to know how you did that and if you could show me …

---

## [Shader output to Processing](https://discourse.processing.org/t/shader-output-to-processing/41189)

<div class="topic-metadata">

**Author:** [@JohnC](https://discourse.processing.org/u/JohnC)\
**Replies:** 4\
**Last updated:** [March 11, 2023, 2:35am UTC](https://discourse.processing.org/t/shader-output-to-processing/41189 "2023-03-11T02:35:45Z")

</div>

Is there a way to get the shader out value back to the CPU thread (processing)?

---

## [If statement with keyboard keyPressed()](https://discourse.processing.org/t/if-statement-with-keyboard-keypressed/41226)

<div class="topic-metadata">

**Author:** [@Dave](https://discourse.processing.org/u/Dave)\
**Replies:** 1\
**Last updated:** [March 10, 2023, 10:54pm UTC](https://discourse.processing.org/t/if-statement-with-keyboard-keypressed/41226 "2023-03-10T22:54:32Z")

</div>

I have included the code just to make it easier to explain what i am trying to do as i am now thinking scrap most of this code and do it a different way so if someone could point me in the right direction i would be grat…

---

## [Load file from google drive?](https://discourse.processing.org/t/load-file-from-google-drive/41211)

<div class="topic-metadata">

**Author:** [@Aryszin](https://discourse.processing.org/u/Aryszin)\
**Replies:** 3\
**Last updated:** [March 10, 2023, 12:20pm UTC](https://discourse.processing.org/t/load-file-from-google-drive/41211 "2023-03-10T12:20:36Z")

</div>

I have an sfdat or sftext (txt but more options) file in drive & want to load it into my software. How could this be done? :£ Arys

[Previous page](https://discourse.processing.org/c/processing/processing-questions/15.md?page=12)

[Next page](https://discourse.processing.org/c/processing/processing-questions/15.md?page=14)
