# Processing

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

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

**Page:** 90

---

## [Moving ellipse to opposite side of canvas](https://discourse.processing.org/t/moving-ellipse-to-opposite-side-of-canvas/35517)

<div class="topic-metadata">

**Author:** [@processingArthur](https://discourse.processing.org/u/processingArthur)\
**Replies:** 4\
**Last updated:** [March 2, 2022, 11:17pm UTC](https://discourse.processing.org/t/moving-ellipse-to-opposite-side-of-canvas/35517 "2022-03-02T23:17:34Z")

</div>

Hi. I was wondering how I can make a moving ellipse reappear on the opposite side of the canvas when it reaches the edge. I understand how to get it to reappear on the x axis and y axis individually ie if the xpos is gre…

---

## [Can you help me fix problem in the code](https://discourse.processing.org/t/can-you-help-me-fix-problem-in-the-code/35512)

<div class="topic-metadata">

**Author:** [@Cuber1](https://discourse.processing.org/u/Cuber1)\
**Replies:** 4\
**Last updated:** [March 2, 2022, 10:18pm UTC](https://discourse.processing.org/t/can-you-help-me-fix-problem-in-the-code/35512 "2022-03-02T22:18:57Z")

</div>

\<\> please format code with \</\> button \* homework policy \* asking questions When my ball goes to the top of the rect, It will be put in the center rect. However, I want it bouncing. I don’t know how to fix it. Someone ca…

---

## [Why is this just creating a straight line from my CSV data?](https://discourse.processing.org/t/why-is-this-just-creating-a-straight-line-from-my-csv-data/35268)

<div class="topic-metadata">

**Author:** [@JennyMcCreadie](https://discourse.processing.org/u/JennyMcCreadie)\
**Replies:** 13\
**Last updated:** [March 2, 2022, 10:17pm UTC](https://discourse.processing.org/t/why-is-this-just-creating-a-straight-line-from-my-csv-data/35268 "2022-03-02T22:17:56Z")

</div>

Hello! I am using data from my CSV file to plot ellipses. It is working when I do it one by one, but when I add an array in to create ellipses from every row of the data, I’m just getting a straight line from them. Here…

---

## [Keeping track of previous position for collision detection](https://discourse.processing.org/t/keeping-track-of-previous-position-for-collision-detection/35515)

<div class="topic-metadata">

**Author:** [@tillmanjex](https://discourse.processing.org/u/tillmanjex)\
**Replies:** 3\
**Last updated:** [March 2, 2022, 7:56pm UTC](https://discourse.processing.org/t/keeping-track-of-previous-position-for-collision-detection/35515 "2022-03-02T19:56:36Z")

</div>

Hello all. So far all the gracious answers on this forum have kept me from posting, but this one is stumping me too hard. I have a class “Root”, which is an ellipse that gets drawn following a random and varying directi…

---

## [Two windows (Default and P3D) on macOS](https://discourse.processing.org/t/two-windows-default-and-p3d-on-macos/35509)

<div class="topic-metadata">

**Author:** [@Devostated](https://discourse.processing.org/u/Devostated)\
**Replies:** 5\
**Last updated:** [March 2, 2022, 5:49pm UTC](https://discourse.processing.org/t/two-windows-default-and-p3d-on-macos/35509 "2022-03-02T17:49:09Z")

</div>

Hello, I made a simple model viewer and wanted to use a Drop library for drag and drop. I had to use a second 2D window with default renderer in order to drag and drop. It works great on windows, but not on macOS. I us…

---

## [Adding automatic enemy behaviour to static sprite](https://discourse.processing.org/t/adding-automatic-enemy-behaviour-to-static-sprite/35398)

<div class="topic-metadata">

**Author:** [@RafaDuarte](https://discourse.processing.org/u/RafaDuarte)\
**Replies:** 11\
**Last updated:** [March 1, 2022, 9:41pm UTC](https://discourse.processing.org/t/adding-automatic-enemy-behaviour-to-static-sprite/35398 "2022-03-01T21:41:21Z")

</div>

I have included an enemy sprite in my game and I was wondering what I should do to make it behave as an enemy and bounce offensively towards the player sprite. My wondering is about the structure of the code and not only…

---

## [Exported sketch from IOS much bigger than exported sketch from Windows 10](https://discourse.processing.org/t/exported-sketch-from-ios-much-bigger-than-exported-sketch-from-windows-10/35481)

<div class="topic-metadata">

**Author:** [@zerohstudio](https://discourse.processing.org/u/zerohstudio)\
**Replies:** 2\
**Last updated:** [March 1, 2022, 9:17pm UTC](https://discourse.processing.org/t/exported-sketch-from-ios-much-bigger-than-exported-sketch-from-windows-10/35481 "2022-03-01T21:17:56Z")

</div>

Hello, when I export from a mac my sketch is nearly 300 times bigger than the same sketch on Windows. Is this correct? If so, what is the reason for this?

---

## [Why does my program crash sometimes?](https://discourse.processing.org/t/why-does-my-program-crash-sometimes/35497)

<div class="topic-metadata">

**Author:** [@Coder1](https://discourse.processing.org/u/Coder1)\
**Replies:** 7\
**Last updated:** [March 1, 2022, 4:44pm UTC](https://discourse.processing.org/t/why-does-my-program-crash-sometimes/35497 "2022-03-01T16:44:58Z")

</div>

Hello, I made a Clan system where you get different advantages based on your clan. However my code does work but sometimes it just crashes and I don’t know why. Please help me int clanRoll; String clanName; int clanC…

---

## [How do I detect "enter" from a string loaded from a text document variable](https://discourse.processing.org/t/how-do-i-detect-enter-from-a-string-loaded-from-a-text-document-variable/35446)

<div class="topic-metadata">

**Author:** [@TT3overnot](https://discourse.processing.org/u/TT3overnot)\
**Replies:** 6\
**Last updated:** [March 1, 2022, 4:09pm UTC](https://discourse.processing.org/t/how-do-i-detect-enter-from-a-string-loaded-from-a-text-document-variable/35446 "2022-03-01T16:09:12Z")

</div>

Help! I’m trying to simulate specific key presses from a text document, the problem is that when ever there is a new line in the document it reads that as nothing. Specifcly " ‘’ ", here’s my code, please help: import j…

---

## [Question About Home Made Timer Function](https://discourse.processing.org/t/question-about-home-made-timer-function/35480)

<div class="topic-metadata">

**Author:** [@BruceTheWayneJohnson](https://discourse.processing.org/u/BruceTheWayneJohnson)\
**Replies:** 3\
**Last updated:** [March 1, 2022, 3:50pm UTC](https://discourse.processing.org/t/question-about-home-made-timer-function/35480 "2022-03-01T15:50:12Z")

</div>

Hello Processing friends! In order to practice creating modular functions I created a timer function that uses milli() to determine if a specific number of seconds have passed. I added some code that I expected to run…

---

## [curveVertex are wrong on a PGraphics](https://discourse.processing.org/t/curvevertex-are-wrong-on-a-pgraphics/35499)

<div class="topic-metadata">

**Author:** [@DrHooDoo](https://discourse.processing.org/u/DrHooDoo)\
**Replies:** 2\
**Last updated:** [March 1, 2022, 2:57pm UTC](https://discourse.processing.org/t/curvevertex-are-wrong-on-a-pgraphics/35499 "2022-03-01T14:57:51Z")

</div>

Hello to all, I’m trying to put a PShape containing curveVertex on a PGraphics. The image i’m getting is wrong and all the curveVertex are displayed as vertex instead … I have no clue of what is wrong. Thank you for y…

---

## [Code for cycling through specified colour values](https://discourse.processing.org/t/code-for-cycling-through-specified-colour-values/35418)

<div class="topic-metadata">

**Author:** [@zerohstudio](https://discourse.processing.org/u/zerohstudio)\
**Replies:** 11\
**Last updated:** [February 28, 2022, 12:57pm UTC](https://discourse.processing.org/t/code-for-cycling-through-specified-colour-values/35418 "2022-02-28T12:57:53Z")

</div>

Hello, I am new to Processing and my first personal challenge is to write a small program that cycles through 50 specific colour values and then loops. I managed to write something that displays and changes colour from …

---

## [Recreating pong, I need help though](https://discourse.processing.org/t/recreating-pong-i-need-help-though/35166)

<div class="topic-metadata">

**Author:** [@Adrian\_vargas42](https://discourse.processing.org/u/Adrian_vargas42)\
**Replies:** 6\
**Last updated:** [March 1, 2022, 9:53am UTC](https://discourse.processing.org/t/recreating-pong-i-need-help-though/35166 "2022-03-01T09:53:13Z")

</div>

Hello, I need help with recreating the game, “Pong”. I have gotten both of the paddles and the divider betwen which side is which, I need to get help with getting, the score, and the ball to move on its own, the mouse mo…

---

## [Is there a way to use a command that draws what I want instead of using e.g. rect or ellipses very much?](https://discourse.processing.org/t/is-there-a-way-to-use-a-command-that-draws-what-i-want-instead-of-using-e-g-rect-or-ellipses-very-much/35402)

<div class="topic-metadata">

**Author:** [@Coder1](https://discourse.processing.org/u/Coder1)\
**Replies:** 4\
**Last updated:** [March 1, 2022, 9:46am UTC](https://discourse.processing.org/t/is-there-a-way-to-use-a-command-that-draws-what-i-want-instead-of-using-e-g-rect-or-ellipses-very-much/35402 "2022-03-01T09:46:15Z")

</div>

Hello. I would like to know if there is a way to use a command or a function instead of using e.g. ellipse or rect very very often to create an animation? Here is an example: rect(x,y -= g,g,g); rect(x,y -= g,g,g); re…

---

## [Can you help me change the Speed of the ball?](https://discourse.processing.org/t/can-you-help-me-change-the-speed-of-the-ball/35470)

<div class="topic-metadata">

**Author:** [@Cuber1](https://discourse.processing.org/u/Cuber1)\
**Replies:** 8\
**Last updated:** [February 28, 2022, 11:44am UTC](https://discourse.processing.org/t/can-you-help-me-change-the-speed-of-the-ball/35470 "2022-02-28T11:44:10Z")

</div>

Reset the velocity back to its initial value once the ball collides with an edge of the internal wall or the canvas boundary. Note that the sign of the velocity will depend on the edge the ball hits. For example, after …

---

## [Cómo darle un valor fijo a la última posición de mouseX](https://discourse.processing.org/t/como-darle-un-valor-fijo-a-la-ultima-posicion-de-mousex/35467)

<div class="topic-metadata">

**Author:** [@Amju\_Rubi](https://discourse.processing.org/u/Amju_Rubi)\
**Replies:** 1\
**Last updated:** [February 27, 2022, 10:47pm UTC](https://discourse.processing.org/t/como-darle-un-valor-fijo-a-la-ultima-posicion-de-mousex/35467 "2022-02-27T22:47:52Z")

</div>

necesito que la posición en x tome un valor estático al cumplir con cierta condición y esta posición debe ser la última que tuvo mouseX

---

## [How to import the Blob class?](https://discourse.processing.org/t/how-to-import-the-blob-class/35452)

<div class="topic-metadata">

**Author:** [@jamshark70](https://discourse.processing.org/u/jamshark70)\
**Replies:** 1\
**Last updated:** [February 27, 2022, 12:59am UTC](https://discourse.processing.org/t/how-to-import-the-blob-class/35452 "2022-02-27T00:59:57Z")

</div>

Apologies for what is probably a painfully basic question. I’m new to Processing, but I’m not new to media programming (19+ year user of SuperCollider, 2-3 years teaching with Pure Data). Processing 3.5.4. I am seeing a…

---

## [Saving Current Frame on Mouse Click](https://discourse.processing.org/t/saving-current-frame-on-mouse-click/35427)

<div class="topic-metadata">

**Author:** [@eoinfen](https://discourse.processing.org/u/eoinfen)\
**Replies:** 7\
**Last updated:** [February 27, 2022, 12:33am UTC](https://discourse.processing.org/t/saving-current-frame-on-mouse-click/35427 "2022-02-27T00:33:50Z")

</div>

I am trying to save the current frame when the mouse is clicked. I have tried using save() and saveFrame(), but both are saving the next frame that will be displayed instead of the current frame being displayed. Is there…

---

## [Stuck java processes, draw() doesn't run](https://discourse.processing.org/t/stuck-java-processes-draw-doesnt-run/35461)

<div class="topic-metadata">

**Author:** [@fastfourier](https://discourse.processing.org/u/fastfourier)\
**Replies:** 0\
**Last updated:** [February 26, 2022, 4:02pm UTC](https://discourse.processing.org/t/stuck-java-processes-draw-doesnt-run/35461 "2022-02-26T16:02:50Z")

</div>

Hi all, I’m having some problems with Processing 3.5.4 on Mac 10.14.6. I can edit/run/edit/run etc. a sketch a bunch of times (20 or more times) and then this will happen. It finishes executing setup(), but doesn’t reac…

---

## [How would you do this?](https://discourse.processing.org/t/how-would-you-do-this/35456)

<div class="topic-metadata">

**Author:** [@anonymous-54](https://discourse.processing.org/u/anonymous-54)\
**Replies:** 2\
**Last updated:** [February 26, 2022, 12:23pm UTC](https://discourse.processing.org/t/how-would-you-do-this/35456 "2022-02-26T12:23:16Z")

</div>

New to processing as I’ve just started it in uni and there’s a question I don’t really know how to do after doing the 8x8 grid in blue. Here is the question (Imgur: The magic of the Internet) thank you for any help.

---

## [PSurfaceAWT.SmoothCanvas\_SquareNuisance](https://discourse.processing.org/t/psurfaceawt-smoothcanvas-squarenuisance/35447)

<div class="topic-metadata">

**Author:** [@svan](https://discourse.processing.org/u/svan)\
**Replies:** 1\
**Last updated:** [February 25, 2022, 9:16pm UTC](https://discourse.processing.org/t/psurfaceawt-smoothcanvas-squarenuisance/35447 "2022-02-25T21:16:39Z")

</div>

Other than setting the canvas bounds outside of the frame is there any way to get rid of this pesky colored square? import java.awt.\*; import java.awt.event.\*; import javax.swing.\*; javax.swing.JFrame frame; java.awt.C…

---

## [Adding Functionality to Extended Code Completion](https://discourse.processing.org/t/adding-functionality-to-extended-code-completion/32962)

<div class="topic-metadata">

**Author:** [@MundaneMonkeys](https://discourse.processing.org/u/MundaneMonkeys)\
**Replies:** 2\
**Last updated:** [October 21, 2021, 2:57pm UTC](https://discourse.processing.org/t/adding-functionality-to-extended-code-completion/32962 "2021-10-21T14:57:20Z")

</div>

Hello! As a learning exercise, I was exploring Jonathan Dahlberg’s Extended Code Completion. I changed it to read a .json file to allow users to add their own macros. I think it is stable enough and useful enough to w…

---

## [How to export frames as layers to an ico file](https://discourse.processing.org/t/how-to-export-frames-as-layers-to-an-ico-file/35448)

<div class="topic-metadata">

**Author:** [@Fred-Sheppard](https://discourse.processing.org/u/Fred-Sheppard)\
**Replies:** 0\
**Last updated:** [February 25, 2022, 7:57pm UTC](https://discourse.processing.org/t/how-to-export-frames-as-layers-to-an-ico-file/35448 "2022-02-25T19:57:54Z")

</div>

I want to be able to export the processing window across several frames, using saveFrames() or similar, to a single ico file with one layer per frame. It might work similar to the code shown. PImage img; void setup() {…

---

## [AWT Components in Default Processing Window](https://discourse.processing.org/t/awt-components-in-default-processing-window/35401)

<div class="topic-metadata">

**Author:** [@svan](https://discourse.processing.org/u/svan)\
**Replies:** 8\
**Last updated:** [February 25, 2022, 4:29pm UTC](https://discourse.processing.org/t/awt-components-in-default-processing-window/35401 "2022-02-25T16:29:16Z")

</div>

With a little help from a StackOverflow thread we are able to get the frame for Processing’s default window (https://stackoverflow.com/questions/39107750/java-and-processing-3-0-frame-class-deprecated-is-there-an-alterna…

---

## [Automatic calendar](https://discourse.processing.org/t/automatic-calendar/35412)

<div class="topic-metadata">

**Author:** [@Malleat](https://discourse.processing.org/u/Malleat)\
**Replies:** 2\
**Last updated:** [February 24, 2022, 1:41pm UTC](https://discourse.processing.org/t/automatic-calendar/35412 "2022-02-24T13:41:48Z")

</div>

Hello everyone ! I want to create an interractive calendar for my projects, with the years / month / day and weeks number. Like i will use the excel librairy to set up every dates, and target dates, then it will automa…

---

## [Need help with really old code](https://discourse.processing.org/t/need-help-with-really-old-code/35248)

<div class="topic-metadata">

**Author:** [@lois](https://discourse.processing.org/u/lois)\
**Replies:** 5\
**Last updated:** [February 24, 2022, 1:27pm UTC](https://discourse.processing.org/t/need-help-with-really-old-code/35248 "2022-02-24T13:27:48Z")

</div>

Hello, I need to transition code in Processing 1.5.1 running on Solaris to a current version running on Linux. I am new to Processing but I have years of programming experience in other languages. At the moment I am …

---

## [Multi-output audio interface?](https://discourse.processing.org/t/multi-output-audio-interface/34873)

<div class="topic-metadata">

**Author:** [@fastfourier](https://discourse.processing.org/u/fastfourier)\
**Replies:** 17\
**Last updated:** [February 23, 2022, 10:33pm UTC](https://discourse.processing.org/t/multi-output-audio-interface/34873 "2022-02-23T22:33:02Z")

</div>

Hi all, I would like to use a certain output (or output pair) on the sound card. Sound.list() reports that my device has 14 “max inputs” and 14 “max outputs” which is correct, but I see no way to access them. All sound…

---

## [JFrame\_example\_](https://discourse.processing.org/t/jframe-example/35370)

<div class="topic-metadata">

**Author:** [@svan](https://discourse.processing.org/u/svan)\
**Replies:** 0\
**Last updated:** [February 22, 2022, 4:40am UTC](https://discourse.processing.org/t/jframe-example/35370 "2022-02-22T04:40:13Z")

</div>

Before I waste too much time on this, would someone please remind me why this is a bad idea and shouldn’t be pursued. Other than the fact that I have two windows (one of which I didn’t ask for) it seems to work ok. Act…

---

## [Sphere-Sphere Intersect](https://discourse.processing.org/t/sphere-sphere-intersect/35364)

<div class="topic-metadata">

**Author:** [@Divitiacus](https://discourse.processing.org/u/Divitiacus)\
**Replies:** 3\
**Last updated:** [February 22, 2022, 5:41pm UTC](https://discourse.processing.org/t/sphere-sphere-intersect/35364 "2022-02-22T17:41:31Z")

</div>

When two spheres overlap in 3D, they create a circle, where they intersect. I would like to be able to create a (random) point on this circle. Here is what I have so far: Axis a through the center of the circle (long b…

---

## [Image movement management - Donkey Kong Game](https://discourse.processing.org/t/image-movement-management-donkey-kong-game/35374)

<div class="topic-metadata">

**Author:** [@cisky](https://discourse.processing.org/u/cisky)\
**Replies:** 1\
**Last updated:** [February 22, 2022, 11:50am UTC](https://discourse.processing.org/t/image-movement-management-donkey-kong-game/35374 "2022-02-22T11:50:20Z")

</div>

please format code with \</\> button \* homework policy \* asking questions We need help with the image movement management of a Mario image in our game (see how it’s managed in this game freekong org). We don’t know how…

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

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