# Coding Questions

**URL:** https://discourse.processing.org/c/processing/processing-questions/15.md

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

---

## [About the Processing / Coding Questions category](https://discourse.processing.org/t/about-the-processing-coding-questions-category/26)

<div class="topic-metadata">

**Author:** [@ProcessingOrg](https://discourse.processing.org/u/ProcessingOrg)\
**Replies:** 0\
**Last updated:** [May 12, 2018, 4:52am UTC](https://discourse.processing.org/t/about-the-processing-coding-questions-category/26 "2018-05-12T04:52:02Z")

</div>

Questions about a Processing example, found code, or some code you’re writing

---

## [Backspace not detecting](https://discourse.processing.org/t/backspace-not-detecting/49405)

<div class="topic-metadata">

**Author:** [@IrohaSakayori168](https://discourse.processing.org/u/IrohaSakayori168)\
**Replies:** 1\
**Last updated:** [September 21, 2026, 7:31am UTC](https://discourse.processing.org/t/backspace-not-detecting/49405 "2026-09-21T07:31:22Z")

</div>

public void keyPressed(){ if(key == CODED){ if(keyCode == LEFT){val--;} if(keyCode == RIGHT){val++;} if(keyCode == BACKSPACE) {System.out.println("Backspace Pressed");editManag…

---

## [Question about a simple code using lines and rectangles](https://discourse.processing.org/t/question-about-a-simple-code-using-lines-and-rectangles/49402)

<div class="topic-metadata">

**Author:** [@JamesP](https://discourse.processing.org/u/JamesP)\
**Replies:** 6\
**Last updated:** [September 20, 2026, 7:19pm UTC](https://discourse.processing.org/t/question-about-a-simple-code-using-lines-and-rectangles/49402 "2026-09-20T19:19:18Z")

</div>

Why is it that I have to use (100,40,400,210) to make the rectangle the same size as the lines? I would have thought I could use (100,40,500,250). It doesn’t make sense to me that 400, 210 is at the same spot as where my…

---

## [Drawing 2D GUI over a 3D sketch](https://discourse.processing.org/t/drawing-2d-gui-over-a-3d-sketch/22819)

<div class="topic-metadata">

**Author:** [@Shwaa](https://discourse.processing.org/u/Shwaa)\
**Replies:** 3\
**Last updated:** [August 18, 2026, 1:49am UTC](https://discourse.processing.org/t/drawing-2d-gui-over-a-3d-sketch/22819 "2026-08-18T01:49:38Z")

</div>

I’m making a 3D game, and a problem I ran into was drawing a 2D GUI over top of the main 3D sketch. The solution I found is pretty simple, but it works really well: //IMPORTANT: make sure to use textMode(SHAPE) befor…

---

## [How to 3D flow field?](https://discourse.processing.org/t/how-to-3d-flow-field/49135)

<div class="topic-metadata">

**Author:** [@alecz](https://discourse.processing.org/u/alecz)\
**Replies:** 2\
**Last updated:** [August 11, 2026, 8:17pm UTC](https://discourse.processing.org/t/how-to-3d-flow-field/49135 "2026-08-11T20:17:44Z")

</div>

Hi all, I’m playing around with Dan Shiffmann Perlin noise flow field with Processing 4 and I wondered how to upgrade his example to use it to move particles in a 3D flow field. Currently my code is : import peasy.\*; …

---

## [Generating txt.file in real time](https://discourse.processing.org/t/generating-txt-file-in-real-time/49116)

<div class="topic-metadata">

**Author:** [@stephan](https://discourse.processing.org/u/stephan)\
**Replies:** 3\
**Last updated:** [August 6, 2026, 12:48am UTC](https://discourse.processing.org/t/generating-txt-file-in-real-time/49116 "2026-08-06T00:48:20Z")

</div>

Hi Forum, greetings from Holland. I want to check all random HSB-values the Mac Book is generating for me in Processing 3.5.4. So I inserted the next lines: // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -…

---

## [fullScreen(P3D) not fullscreening on Windows](https://discourse.processing.org/t/fullscreen-p3d-not-fullscreening-on-windows/49065)

<div class="topic-metadata">

**Author:** [@cjkcjk](https://discourse.processing.org/u/cjkcjk)\
**Replies:** 2\
**Last updated:** [July 28, 2026, 4:53pm UTC](https://discourse.processing.org/t/fullscreen-p3d-not-fullscreening-on-windows/49065 "2026-07-28T16:53:28Z")

</div>

Any help or advice on this is welcomed. When I use fullScreen(P2D) or fullScreen(P3D) I do not get a full screen, rather I get a window in the top left with the same aspect ratio as the screen. If I use fullScreen() then…

---

## [Subtracting a curveVertex() hole from a blob](https://discourse.processing.org/t/subtracting-a-curvevertex-hole-from-a-blob/48949)

<div class="topic-metadata">

**Author:** [@tareksobh](https://discourse.processing.org/u/tareksobh)\
**Replies:** 5\
**Last updated:** [July 5, 2026, 6:11pm UTC](https://discourse.processing.org/t/subtracting-a-curvevertex-hole-from-a-blob/48949 "2026-07-05T18:11:51Z")

</div>

Hello everyone! I’m trying to make a donut-like shape in Processing using curveVertex(). The outer shape is a blob, and I want to subtract a smaller blob from the middle to create a hole. It works reliably with vertex() …

---

## [Performance issues with PGraphics layers and image() calls](https://discourse.processing.org/t/performance-issues-with-pgraphics-layers-and-image-calls/48929)

<div class="topic-metadata">

**Author:** [@Braunstein](https://discourse.processing.org/u/Braunstein)\
**Replies:** 7\
**Last updated:** [July 3, 2026, 4:21pm UTC](https://discourse.processing.org/t/performance-issues-with-pgraphics-layers-and-image-calls/48929 "2026-07-03T16:21:34Z")

</div>

Hello! I am working on a Falling Sand + Artillery game. TL;DR: Why is stretching images over a higher resolution significantly more expensive, even if the original image res stays the same? Is there a smart way to render…

---

## [keyPressed() only works sometimes](https://discourse.processing.org/t/keypressed-only-works-sometimes/22340)

<div class="topic-metadata">

**Author:** [@beckerc](https://discourse.processing.org/u/beckerc)\
**Replies:** 5\
**Last updated:** [April 23, 2026, 11:36pm UTC](https://discourse.processing.org/t/keypressed-only-works-sometimes/22340 "2026-04-23T23:36:41Z")

</div>

I have not seen this particular problem addressed here but maybe I have missed it despite searching. When I try to capture keyboard inputs in Processing (such as with the keyPressed function), the code works about 2/3 of…

---

## [Using surface.setLocation does not do same thing every time](https://discourse.processing.org/t/using-surface-setlocation-does-not-do-same-thing-every-time/11871)

<div class="topic-metadata">

**Author:** [@DerekCresswell](https://discourse.processing.org/u/DerekCresswell)\
**Replies:** 12\
**Last updated:** [April 15, 2026, 12:56am UTC](https://discourse.processing.org/t/using-surface-setlocation-does-not-do-same-thing-every-time/11871 "2026-04-15T00:56:55Z")

</div>

I’m using surface.setLocation to position my windows. With the arguments passed into my two windows they should be at the same X and one height difference in the Y. The Y seems ok but the X is off by about 10 or so pixel…

---

## [How do I create a fullscreen window with title bar on my second monitor?](https://discourse.processing.org/t/how-do-i-create-a-fullscreen-window-with-title-bar-on-my-second-monitor/41474)

<div class="topic-metadata">

**Author:** [@esc746](https://discourse.processing.org/u/esc746)\
**Replies:** 8\
**Last updated:** [April 14, 2026, 7:26pm UTC](https://discourse.processing.org/t/how-do-i-create-a-fullscreen-window-with-title-bar-on-my-second-monitor/41474 "2026-04-14T19:26:46Z")

</div>

The title describes the problem. I can use fullScreen() to cover the screen with a window on any monitor. But it doesn’t have a title bar. The following code creates a window with a title bar that covers the screen. Bu…

---

## [P2D transparency issue](https://discourse.processing.org/t/p2d-transparency-issue/48421)

<div class="topic-metadata">

**Author:** [@AniManOtaku](https://discourse.processing.org/u/AniManOtaku)\
**Replies:** 3\
**Last updated:** [April 12, 2026, 2:27pm UTC](https://discourse.processing.org/t/p2d-transparency-issue/48421 "2026-04-12T14:27:19Z")

</div>

I’ve run into a problem with transparency in the P2D renderer. When rendering an image in PG, the transparent pixels somehow blend into the background. I know I can use blendMode(REPLACE), but then the transparent pixels…

---

## [Texture sampling NEAREST in P2D render](https://discourse.processing.org/t/texture-sampling-nearest-in-p2d-render/48399)

<div class="topic-metadata">

**Author:** [@AniManOtaku](https://discourse.processing.org/u/AniManOtaku)\
**Replies:** 9\
**Last updated:** [April 5, 2026, 9:39am UTC](https://discourse.processing.org/t/texture-sampling-nearest-in-p2d-render/48399 "2026-04-05T09:39:15Z")

</div>

Hi i work with PShader and i really want to get not smoothed pixels from texture2D. How do i set texture sampling NEAREST in PGraphics in P2D render?

---

## [How move the penguin without the arms flying off?](https://discourse.processing.org/t/how-move-the-penguin-without-the-arms-flying-off/48065)

<div class="topic-metadata">

**Author:** [@False](https://discourse.processing.org/u/False)\
**Replies:** 2\
**Last updated:** [March 24, 2026, 8:02am UTC](https://discourse.processing.org/t/how-move-the-penguin-without-the-arms-flying-off/48065 "2026-03-24T08:02:52Z")

</div>

‘’‘processing’‘’ //position float xorigin, yorigin; //origin position float xPos, yPos; //penguin position //wing animation float wingangle; float wingspeed; float upperwinglimit; float lowerwinglimit; boolean…

---

## [10 print chr$(205.5+rnd(1)); : goto 10](https://discourse.processing.org/t/10-print-chr-205-5-rnd-1-goto-10/15483)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 76\
**Last updated:** [March 15, 2026, 9:46pm UTC](https://discourse.processing.org/t/10-print-chr-205-5-rnd-1-goto-10/15483 "2026-03-15T21:46:55Z")

</div>

10 PRINT CHR$(205.5+RND(1)); : GOTO 10 Can this be done in Processing? :grin: @jeremydouglass

---

## [JFXHighlighter in Processing](https://discourse.processing.org/t/jfxhighlighter-in-processing/48070)

<div class="topic-metadata">

**Author:** [@swp791](https://discourse.processing.org/u/swp791)\
**Replies:** 6\
**Last updated:** [March 11, 2026, 11:07pm UTC](https://discourse.processing.org/t/jfxhighlighter-in-processing/48070 "2026-03-11T23:07:27Z")

</div>

Hello. Has anyone used the JFoenix library with Processing. I am trying to make a text highlighter in a JavaFX TextArea. Since JavaFX doesn’t have one I tried using the JFoenix library without much success. After some r…

---

## [Need some help with a whack-a-mole](https://discourse.processing.org/t/need-some-help-with-a-whack-a-mole/48017)

<div class="topic-metadata">

**Author:** [@Lumine](https://discourse.processing.org/u/Lumine)\
**Replies:** 5\
**Last updated:** [March 11, 2026, 6:23pm UTC](https://discourse.processing.org/t/need-some-help-with-a-whack-a-mole/48017 "2026-03-11T18:23:06Z")

</div>

I need help because I’m new to Processing and I was wondering how to create a timer for a little game (a whack-a-mole game with cubes instead of moles). I need to finish the code quickly (in less than a week) and I REAL…

---

## [Umlaute is an Invalid character constant?](https://discourse.processing.org/t/umlaute-is-an-invalid-character-constant/47857)

<div class="topic-metadata">

**Author:** [@u.strautz](https://discourse.processing.org/u/u.strautz)\
**Replies:** 6\
**Last updated:** [February 11, 2026, 2:14am UTC](https://discourse.processing.org/t/umlaute-is-an-invalid-character-constant/47857 "2026-02-11T02:14:40Z")

</div>

I am checking if there are some Umlaute in my text. The error message is “Invalid character constant” \`\`\` if (text.charAt(0) == 'ä') println("Hallo"); \`\`\` The same happens IMHO with every char above #127. This only hap…

---

## [Drawing a heart](https://discourse.processing.org/t/drawing-a-heart/8608)

<div class="topic-metadata">

**Author:** [@Unstavle](https://discourse.processing.org/u/Unstavle)\
**Replies:** 12\
**Last updated:** [February 8, 2026, 8:16am UTC](https://discourse.processing.org/t/drawing-a-heart/8608 "2026-02-08T08:16:55Z")

</div>

Is it possible to draw a heart shape using the ellipse command and setting the diameter to a function of x?

---

## [How do I get the circle head behind the pages to look like the second photo](https://discourse.processing.org/t/how-do-i-get-the-circle-head-behind-the-pages-to-look-like-the-second-photo/47840)

<div class="topic-metadata">

**Author:** [@pam](https://discourse.processing.org/u/pam)\
**Replies:** 8\
**Last updated:** [February 4, 2026, 1:41am UTC](https://discourse.processing.org/t/how-do-i-get-the-circle-head-behind-the-pages-to-look-like-the-second-photo/47840 "2026-02-04T01:41:03Z")

</div>

---

## [How to make a program windowless/frameless?](https://discourse.processing.org/t/how-to-make-a-program-windowless-frameless/22321)

<div class="topic-metadata">

**Author:** [@qewer3322](https://discourse.processing.org/u/qewer3322)\
**Replies:** 12\
**Last updated:** [January 25, 2026, 2:32am UTC](https://discourse.processing.org/t/how-to-make-a-program-windowless-frameless/22321 "2026-01-25T02:32:35Z")

</div>

So lets say I have this; void setup(){ size(200, 200); surface.setAlwaysOnTop(true); } void draw(){ fill(255); textSize(35); text("Hello",50,75); } How can I get rid of the window frame and the background be…

---

## [Making a program without a window border (and no background, just the shape)](https://discourse.processing.org/t/making-a-program-without-a-window-border-and-no-background-just-the-shape/41260)

<div class="topic-metadata">

**Author:** [@ctremblay](https://discourse.processing.org/u/ctremblay)\
**Replies:** 18\
**Last updated:** [January 25, 2026, 2:31am UTC](https://discourse.processing.org/t/making-a-program-without-a-window-border-and-no-background-just-the-shape/41260 "2026-01-25T02:31:05Z")

</div>

ok, I was wondering if there a way to make a program using processing let say I’m making a stick figure, but I want the figure to appear on my screen instead of in the display box. what usually happens what i want t…

---

## [Copying a PShape?](https://discourse.processing.org/t/copying-a-pshape/1081)

<div class="topic-metadata">

**Author:** [@Carmine](https://discourse.processing.org/u/Carmine)\
**Replies:** 13\
**Last updated:** [January 18, 2026, 10:09pm UTC](https://discourse.processing.org/t/copying-a-pshape/1081 "2026-01-18T22:09:20Z")

</div>

If I want to have several of the same 3D model (.obj file loaded), is there a way to to load it once and then copy that PShape. I want to avoid several calls to loadFile. -Carmine

---

## [Rendering animation issue](https://discourse.processing.org/t/rendering-animation-issue/47755)

<div class="topic-metadata">

**Author:** [@AniManOtaku](https://discourse.processing.org/u/AniManOtaku)\
**Replies:** 7\
**Last updated:** [January 18, 2026, 10:20am UTC](https://discourse.processing.org/t/rendering-animation-issue/47755 "2026-01-18T10:20:33Z")

</div>

Hello. I am developing a small application for creating animations just for myself. I want to create the following structure: the program has folders, and those folders have layers. The program has a main folder, to whi…

---

## [Processing in a Java IDE (i.e. Netbeans)?](https://discourse.processing.org/t/processing-in-a-java-ide-i-e-netbeans/47731)

<div class="topic-metadata">

**Author:** [@EricRogerGarcia](https://discourse.processing.org/u/EricRogerGarcia)\
**Replies:** 1\
**Last updated:** [January 9, 2026, 8:33pm UTC](https://discourse.processing.org/t/processing-in-a-java-ide-i-e-netbeans/47731 "2026-01-09T20:33:52Z")

</div>

I’d like to be able to run Processing code in a java IDE (Netbeans) to see how it’d be possible to use Java Libraries with a processing sketch (or to use Java ways to run Java code in a browser). I know there are posts …

---

## [Need Help for clipping lane](https://discourse.processing.org/t/need-help-for-clipping-lane/47702)

<div class="topic-metadata">

**Author:** [@picar](https://discourse.processing.org/u/picar)\
**Replies:** 8\
**Last updated:** [January 7, 2026, 12:24pm UTC](https://discourse.processing.org/t/need-help-for-clipping-lane/47702 "2026-01-07T12:24:03Z")

</div>

Hallo, when i use perspective(fovy, aspect, zNear, zFar) \> favy & aspect works as it should but zNear & zFar change nothing. I use Processing 4.4.10 setup() \>P3D & PGraphics matrix... . . matrix.beginDraw(); matrix.b…

---

## [How to send an argument when using processing-java](https://discourse.processing.org/t/how-to-send-an-argument-when-using-processing-java/47691)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 9\
**Last updated:** [January 5, 2026, 6:11pm UTC](https://discourse.processing.org/t/how-to-send-an-argument-when-using-processing-java/47691 "2026-01-05T18:11:27Z")

</div>

I can run a Processing sketch from the command line using processing-java --sketch=pathtosketchfolder --run But, how do I send an argument, such as the value of a variable, at the same time?

---

## [Transformation d'ECG en image ou son](https://discourse.processing.org/t/transformation-decg-en-image-ou-son/47590)

<div class="topic-metadata">

**Author:** [@Clem](https://discourse.processing.org/u/Clem)\
**Replies:** 3\
**Last updated:** [December 5, 2025, 10:59am UTC](https://discourse.processing.org/t/transformation-decg-en-image-ou-son/47590 "2025-12-05T10:59:04Z")

</div>

Est-il possible de créer une images / animation , a parti de données d’ECG (electrocardioramme) grâce au code ? (j’ai un projet artistique dessus je ne sais pas faire de code j’ai besoin d’aide )

---

## [Processing Exception](https://discourse.processing.org/t/processing-exception/47566)

<div class="topic-metadata">

**Author:** [@Frank](https://discourse.processing.org/u/Frank)\
**Replies:** 3\
**Last updated:** [December 4, 2025, 3:44am UTC](https://discourse.processing.org/t/processing-exception/47566 "2025-12-04T03:44:32Z")

</div>

Hello. I want to start an external program in Processing and Processing should detect whether this program has also been started. How can I realize this? I’m not familiar with these exceptions. Thanks…Frank

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