# Coding Questions

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

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

**Page:** 4

---

## [Mover on a force-controlled circular orbit](https://discourse.processing.org/t/mover-on-a-force-controlled-circular-orbit/45632)

<div class="topic-metadata">

**Author:** [@eightohnine](https://discourse.processing.org/u/eightohnine)\
**Replies:** 1\
**Last updated:** [January 29, 2025, 2:51pm UTC](https://discourse.processing.org/t/mover-on-a-force-controlled-circular-orbit/45632 "2025-01-29T14:51:14Z")

</div>

Hi all, This particular issue has been bugging me far longer than I’d like to admit. Essentially I’m trying to put a Mover onto a circular path around a centerpoint. I know how to do this using an incrementing angle a…

---

## [Make Z axis alternate between 'growing' and 'shrinking'...?](https://discourse.processing.org/t/make-z-axis-alternate-between-growing-and-shrinking/45661)

<div class="topic-metadata">

**Author:** [@RevAustin](https://discourse.processing.org/u/RevAustin)\
**Replies:** 7\
**Last updated:** [January 29, 2025, 1:20am UTC](https://discourse.processing.org/t/make-z-axis-alternate-between-growing-and-shrinking/45661 "2025-01-29T01:20:31Z")

</div>

Hi all! I’m new to Processing and, in short, I’d like the Z axis of an object to keep ‘growing’ and ‘shrinking’ but I don’t know the best way to do this. I thought maybe having two alternating timers might work, but th…

---

## [Language translation](https://discourse.processing.org/t/language-translation/45668)

<div class="topic-metadata">

**Author:** [@humano](https://discourse.processing.org/u/humano)\
**Replies:** 3\
**Last updated:** [January 27, 2025, 2:44pm UTC](https://discourse.processing.org/t/language-translation/45668 "2025-01-27T14:44:13Z")

</div>

I am working with an old open processing sktech I translated to processing. It used to work but it does not, coul you please help me? color\[\] colors = { color(#edb218), color(#029cc2), color(#6b8c87), color(#a5…

---

## [File not found using surface.setIcon(icon) in public class test extends PApplet](https://discourse.processing.org/t/file-not-found-using-surface-seticon-icon-in-public-class-test-extends-papplet/45622)

<div class="topic-metadata">

**Author:** [@cola](https://discourse.processing.org/u/cola)\
**Replies:** 7\
**Last updated:** [January 23, 2025, 2:38am UTC](https://discourse.processing.org/t/file-not-found-using-surface-seticon-icon-in-public-class-test-extends-papplet/45622 "2025-01-23T02:38:44Z")

</div>

hello,everyone. I can’t find the file when using surface.setIcon(icon) in public class test extends PApplet. I am using the processing4 version. My pictures are saved in data. The file structure is as follows: MySketch/ …

---

## [How to sort coordinates?](https://discourse.processing.org/t/how-to-sort-coordinates/45599)

<div class="topic-metadata">

**Author:** [@AniManOtaku](https://discourse.processing.org/u/AniManOtaku)\
**Replies:** 23\
**Last updated:** [January 20, 2025, 9:44pm UTC](https://discourse.processing.org/t/how-to-sort-coordinates/45599 "2025-01-20T21:44:07Z")

</div>

Is there any way to quickly sort the cordinates of dots? I have an array of Vertex dots\[ \] I need to sort it so that the index neighbors are also neighboring dots. Example: Input: (5,5)(3,4)(2,5)(4,4)(5,4) Output: (2…

---

## [Bold and italic text styles](https://discourse.processing.org/t/bold-and-italic-text-styles/45586)

<div class="topic-metadata">

**Author:** [@Gadger](https://discourse.processing.org/u/Gadger)\
**Replies:** 2\
**Last updated:** [January 14, 2025, 6:08pm UTC](https://discourse.processing.org/t/bold-and-italic-text-styles/45586 "2025-01-14T18:08:16Z")

</div>

How can I get bold and italic styling for text using the default font? I need the rendered text to be (approximately) the same whether the sketch is run on Windows, Mac or Linux.

---

## [PShape setFill() issue](https://discourse.processing.org/t/pshape-setfill-issue/45536)

<div class="topic-metadata">

**Author:** [@svan](https://discourse.processing.org/u/svan)\
**Replies:** 9\
**Last updated:** [January 12, 2025, 1:42am UTC](https://discourse.processing.org/t/pshape-setfill-issue/45536 "2025-01-12T01:42:27Z")

</div>

setFill(indx,color) may be used to set vertex colors for a PShape. However, it appears to be able to do this only once as shown in the following demo. It will change the colors if the triangle is redrawn, but the desir…

---

## [Having a problem with zero length arrays](https://discourse.processing.org/t/having-a-problem-with-zero-length-arrays/45555)

<div class="topic-metadata">

**Author:** [@tajvirsingh](https://discourse.processing.org/u/tajvirsingh)\
**Replies:** 6\
**Last updated:** [January 9, 2025, 9:47pm UTC](https://discourse.processing.org/t/having-a-problem-with-zero-length-arrays/45555 "2025-01-09T21:47:27Z")

</div>

I’ve formatted all my vectors to be 1 column and 4 rows, but apparently I’m putting a vector of length 0 into my function? Why might this happen? Thanks,

---

## [Target VM failed to initialize error](https://discourse.processing.org/t/target-vm-failed-to-initialize-error/45553)

<div class="topic-metadata">

**Author:** [@joshhumphris](https://discourse.processing.org/u/joshhumphris)\
**Replies:** 2\
**Last updated:** [January 8, 2025, 12:11pm UTC](https://discourse.processing.org/t/target-vm-failed-to-initialize-error/45553 "2025-01-08T12:11:42Z")

</div>

Hello, I am going through this tutorial and I have gotten an error despite copying the code exactly. Is it because my computer can’t compute the complextiy of the program? The console says; IndexOutofBo…

---

## [keyPressed() combos - How can I check if ctrl and other key are pressed?](https://discourse.processing.org/t/keypressed-combos-how-can-i-check-if-ctrl-and-other-key-are-pressed/45495)

<div class="topic-metadata">

**Author:** [@Proyecto\_Zeus](https://discourse.processing.org/u/Proyecto_Zeus)\
**Replies:** 2\
**Last updated:** [December 21, 2024, 9:19am UTC](https://discourse.processing.org/t/keypressed-combos-how-can-i-check-if-ctrl-and-other-key-are-pressed/45495 "2024-12-21T09:19:29Z")

</div>

Hello, I want to run some code and then quit the program from running when I press ctrl+x. I tried the next code: boolean ctrl; boolean x; void setup() { //Some code } void draw(){ //More code } void keyPressed(…

---

## [Help creating a constellation!](https://discourse.processing.org/t/help-creating-a-constellation/45482)

<div class="topic-metadata">

**Author:** [@Sorayamasd](https://discourse.processing.org/u/Sorayamasd)\
**Replies:** 1\
**Last updated:** [December 18, 2024, 1:06pm UTC](https://discourse.processing.org/t/help-creating-a-constellation/45482 "2024-12-18T13:06:02Z")

</div>

Hello! I work on processing and i would like to do an interactive constelation or astrology chart, i have a reference photo, my idea is that it completes itselfs in the inside with a interaction, it could be audio recati…

---

## [Building a tape spaghetti simulation](https://discourse.processing.org/t/building-a-tape-spaghetti-simulation/45461)

<div class="topic-metadata">

**Author:** [@eightohnine](https://discourse.processing.org/u/eightohnine)\
**Replies:** 18\
**Last updated:** [December 17, 2024, 6:01am UTC](https://discourse.processing.org/t/building-a-tape-spaghetti-simulation/45461 "2024-12-17T06:01:13Z")

</div>

Hi all, In the middle of a recent Youtube rabbit hole, inspiration struck. The best description I can come up with for what we’re seeing is “writhing tape spaghetti”. I now want to recreate this in code. Watch it in…

---

## [Trying to make an array of 'positions' draw from an array of images at random](https://discourse.processing.org/t/trying-to-make-an-array-of-positions-draw-from-an-array-of-images-at-random/45467)

<div class="topic-metadata">

**Author:** [@WarMomPT](https://discourse.processing.org/u/WarMomPT)\
**Replies:** 1\
**Last updated:** [December 16, 2024, 3:21pm UTC](https://discourse.processing.org/t/trying-to-make-an-array-of-positions-draw-from-an-array-of-images-at-random/45467 "2024-12-16T15:21:59Z")

</div>

I’m really struggling with something that I think has got to be obvious. In a sketch I’m making, once you click in a certain area, 20 PNGs will fall down the screen, from random starting positions along the X axis, going…

---

## [Adding a svg image to a box side](https://discourse.processing.org/t/adding-a-svg-image-to-a-box-side/25321)

<div class="topic-metadata">

**Author:** [@raboytniksings](https://discourse.processing.org/u/raboytniksings)\
**Replies:** 5\
**Last updated:** [December 6, 2024, 3:04pm UTC](https://discourse.processing.org/t/adding-a-svg-image-to-a-box-side/25321 "2024-12-06T15:04:34Z")

</div>

I am using 3D and have created a chessboard made of 64 box(). So far so good (the full code is very long, it is very hard for me to create a MWE). Now, I am too lazy to create a 3D chess set, and I am tempted to use lich…

---

## [Calculate the next point along a line](https://discourse.processing.org/t/calculate-the-next-point-along-a-line/45425)

<div class="topic-metadata">

**Author:** [@travis.stdenis](https://discourse.processing.org/u/travis.stdenis)\
**Replies:** 6\
**Last updated:** [December 4, 2024, 2:16am UTC](https://discourse.processing.org/t/calculate-the-next-point-along-a-line/45425 "2024-12-04T02:16:54Z")

</div>

Per the diagram, I have points A & B and want to know how to get C which is a straight continuation of the —\>AB. This is part of a larger shape I’m drawing so I can’t change the origin, which is what is throwing me o…

---

## [Processing with SuperCollider (using oscP5 library)](https://discourse.processing.org/t/processing-with-supercollider-using-oscp5-library/45426)

<div class="topic-metadata">

**Author:** [@thedurf18](https://discourse.processing.org/u/thedurf18)\
**Replies:** 0\
**Last updated:** [December 3, 2024, 4:46am UTC](https://discourse.processing.org/t/processing-with-supercollider-using-oscp5-library/45426 "2024-12-03T04:46:04Z")

</div>

I’m trying to get SuperCollider to control animations in Processing through OSC. Whenever a certain frequency is played from a synth, a shape appears in the Processing window, but when the frequency is not being played, …

---

## [I need quick help with my codes](https://discourse.processing.org/t/i-need-quick-help-with-my-codes/45372)

<div class="topic-metadata">

**Author:** [@cain](https://discourse.processing.org/u/cain)\
**Replies:** 7\
**Last updated:** [November 29, 2024, 2:03pm UTC](https://discourse.processing.org/t/i-need-quick-help-with-my-codes/45372 "2024-11-29T14:03:44Z")

</div>

I need 2 different images to fall from the top (not bounce!) And when the image1 comes up user should press enter or they lose. If image2 comes up they shouldn’t press the enter button or they will lose again. Can i atle…

---

## [Using pixelfont](https://discourse.processing.org/t/using-pixelfont/45364)

<div class="topic-metadata">

**Author:** [@mrbbp](https://discourse.processing.org/u/mrbbp)\
**Replies:** 0\
**Last updated:** [November 20, 2024, 3:55pm UTC](https://discourse.processing.org/t/using-pixelfont/45364 "2024-11-20T15:55:25Z")

</div>

I designed a pixelfont that works well in 8px or 16px height, in which unit does the font is digitized? px or pt? the refernce is unclear about unit. Loads a .vlw formatted font into a PFont object. Create a .vlw font …

---

## [getResource() idiosyncracy](https://discourse.processing.org/t/getresource-idiosyncracy/45356)

<div class="topic-metadata">

**Author:** [@svan](https://discourse.processing.org/u/svan)\
**Replies:** 0\
**Last updated:** [November 18, 2024, 5:22pm UTC](https://discourse.processing.org/t/getresource-idiosyncracy/45356 "2024-11-18T17:22:01Z")

</div>

When porting java code to Processing sometimes it is necessary to use getResource() even though Processing does not have a ‘resources’ folder. In order to get a valid url in the following demo it is necessary to have th…

---

## [Animations don’t work](https://discourse.processing.org/t/animations-don-t-work/45304)

<div class="topic-metadata">

**Author:** [@Student87](https://discourse.processing.org/u/Student87)\
**Replies:** 3\
**Last updated:** [November 12, 2024, 5:38pm UTC](https://discourse.processing.org/t/animations-don-t-work/45304 "2024-11-12T17:38:39Z")

</div>

None of the animations made for the Processing program are working. I was given a correct code to animate a small rectangle gliding across the screen. When I wrote out the code, copying it, I was told that there was a ;…

---

## [JavaFX Unable to add modules to Processing IDE](https://discourse.processing.org/t/javafx-unable-to-add-modules-to-processing-ide/41272)

<div class="topic-metadata">

**Author:** [@svan](https://discourse.processing.org/u/svan)\
**Replies:** 34\
**Last updated:** [November 11, 2024, 12:12pm UTC](https://discourse.processing.org/t/javafx-unable-to-add-modules-to-processing-ide/41272 "2024-11-11T12:12:06Z")

</div>

The following JavaFX code will not run in Processing 4 due to absence of JavaFX modules (runs ok in version 3.5.4 minus the first line). I have tried many times adding the modules to the libraries folder or drag 'n drop…

---

## [Pong paddle glitch](https://discourse.processing.org/t/pong-paddle-glitch/13980)

<div class="topic-metadata">

**Author:** [@XxChaoticStrike](https://discourse.processing.org/u/XxChaoticStrike)\
**Replies:** 8\
**Last updated:** [November 9, 2024, 3:55am UTC](https://discourse.processing.org/t/pong-paddle-glitch/13980 "2024-11-09T03:55:11Z")

</div>

Hello all! First post on this forum! I’ve built a cute little pong game using previous knowledge, however moving collision was not something I wanted to spend a lot of time on (I have made a bouncing ball example). Usin…

---

## [Optimizing Performance on M3 Max Pro?](https://discourse.processing.org/t/optimizing-performance-on-m3-max-pro/45278)

<div class="topic-metadata">

**Author:** [@thatshems](https://discourse.processing.org/u/thatshems)\
**Replies:** 0\
**Last updated:** [November 5, 2024, 3:46am UTC](https://discourse.processing.org/t/optimizing-performance-on-m3-max-pro/45278 "2024-11-05T03:46:56Z")

</div>

Dear Processing community, i hope this finds you well. I’m Working on an infinite image sequence slider that’s currently not hitting desired performance, despite having a super powerful hardware it stays below the desir…

---

## [Cuadro 1 ines 123456789](https://discourse.processing.org/t/cuadro-1-ines-123456789/45195)

<div class="topic-metadata">

**Author:** [@averges](https://discourse.processing.org/u/averges)\
**Replies:** 3\
**Last updated:** [October 25, 2024, 2:40pm UTC](https://discourse.processing.org/t/cuadro-1-ines-123456789/45195 "2024-10-25T14:40:53Z")

</div>

void setup() { size(600,600) ; background (#69C2FC) ; } void draw() { fill(#FF7164); circle(300,500,700); stroke(0); fill(#FFA064); circle(300,500,650); stroke(0); …

---

## [I need help for scrolling buttons in the game (I'm a beginner, I need help please)](https://discourse.processing.org/t/i-need-help-for-scrolling-buttons-in-the-game-im-a-beginner-i-need-help-please/45198)

<div class="topic-metadata">

**Author:** [@paudealba](https://discourse.processing.org/u/paudealba)\
**Replies:** 2\
**Last updated:** [October 24, 2024, 12:49pm UTC](https://discourse.processing.org/t/i-need-help-for-scrolling-buttons-in-the-game-im-a-beginner-i-need-help-please/45198 "2024-10-24T12:49:13Z")

</div>

I am currently developing a cookie clicker-type game using Processing, and I’m facing a challenge with the user interface. In the section where I have multiple buttons for purchasing different structures, the design requ…

---

## [SVG width and height](https://discourse.processing.org/t/svg-width-and-height/45199)

<div class="topic-metadata">

**Author:** [@mrbbp](https://discourse.processing.org/u/mrbbp)\
**Replies:** 3\
**Last updated:** [October 19, 2024, 10:05am UTC](https://discourse.processing.org/t/svg-width-and-height/45199 "2024-10-19T10:05:04Z")

</div>

Hello i’m currently playing with few svg loading in a an array. The svgs have different height but when i use it, they have all the same size! the bigger are scaled to have the same height as the smaller! is it a bug? …

---

## [Launch() exec() command on linux](https://discourse.processing.org/t/launch-exec-command-on-linux/45174)

<div class="topic-metadata">

**Author:** [@Seamiki](https://discourse.processing.org/u/Seamiki)\
**Replies:** 1\
**Last updated:** [October 13, 2024, 10:26am UTC](https://discourse.processing.org/t/launch-exec-command-on-linux/45174 "2024-10-13T10:26:59Z")

</div>

I want to send a terminal command from my sketch using launch() or exec() but i am facing issues in both cases: when i use launch("echo \\"Hai\\" \>\> /dev/usb/lp0"); looks like it tries to open a folder instead of execut…

---

## [Can you type text on the displayed screen and make Processing use the date to change a variable](https://discourse.processing.org/t/can-you-type-text-on-the-displayed-screen-and-make-processing-use-the-date-to-change-a-variable/45126)

<div class="topic-metadata">

**Author:** [@Istimereal](https://discourse.processing.org/u/Istimereal)\
**Replies:** 2\
**Last updated:** [October 2, 2024, 9:14pm UTC](https://discourse.processing.org/t/can-you-type-text-on-the-displayed-screen-and-make-processing-use-the-date-to-change-a-variable/45126 "2024-10-02T21:14:57Z")

</div>

Hi Is it possible to to make a input box on the screen that run the sketch where I can type text or numbers that will influence a variable from the initial run. So the new input is read by processing. One variable is in…

---

## [Map SVG is appearing black in colour](https://discourse.processing.org/t/map-svg-is-appearing-black-in-colour/45118)

<div class="topic-metadata">

**Author:** [@Valiullah](https://discourse.processing.org/u/Valiullah)\
**Replies:** 0\
**Last updated:** [October 1, 2024, 2:23pm UTC](https://discourse.processing.org/t/map-svg-is-appearing-black-in-colour/45118 "2024-10-01T14:23:26Z")

</div>

Hi! I am trying to import an Africa SVG map via processing but the when I run the program, it loads the Africa map in a black colour as opposed to the gray colour of the original SVG where the states are clearly demarcat…

---

## [Is this even solvable? Animation changes look after some seconds... Help](https://discourse.processing.org/t/is-this-even-solvable-animation-changes-look-after-some-seconds-help/45097)

<div class="topic-metadata">

**Author:** [@JamOne](https://discourse.processing.org/u/JamOne)\
**Replies:** 3\
**Last updated:** [September 26, 2024, 10:58am UTC](https://discourse.processing.org/t/is-this-even-solvable-animation-changes-look-after-some-seconds-help/45097 "2024-09-26T10:58:50Z")

</div>

Hello, I am not able to solve this and need some help. This animation of a ring is just fine in the beginning and I like everything about it, but after some seconds it becomes wilder and wilder and looses its nice appea…

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

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