# Coding Questions

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

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

**Page:** 27

---

## [Try to program a pointless texbox](https://discourse.processing.org/t/try-to-program-a-pointless-texbox/37921)

<div class="topic-metadata">

**Author:** [@lousshe](https://discourse.processing.org/u/lousshe)\
**Replies:** 4\
**Last updated:** [July 24, 2022, 2:21pm UTC](https://discourse.processing.org/t/try-to-program-a-pointless-texbox/37921 "2022-07-24T14:21:29Z")

</div>

Hello. this is a small mini project. I am already so far that it is a normal interpretation of a text box with mouse tracking. Now I try to modify the text if you move the red button around (textbox size). By modify…

---

## [Cannot understand PImage](https://discourse.processing.org/t/cannot-understand-pimage/38070)

<div class="topic-metadata">

**Author:** [@MSousa](https://discourse.processing.org/u/MSousa)\
**Replies:** 1\
**Last updated:** [July 24, 2022, 1:40pm UTC](https://discourse.processing.org/t/cannot-understand-pimage/38070 "2022-07-24T13:40:27Z")

</div>

//Pimage test /\* Trying to undersand Pimage created a Pimage object named img the idea is to acquire data from the Teensy microcontroller and fill the img area. line 27 fills the image with a stored jpg image line …

---

## [Getting a NullPointerException when trying to simply display an image in draw()](https://discourse.processing.org/t/getting-a-nullpointerexception-when-trying-to-simply-display-an-image-in-draw/38015)

<div class="topic-metadata">

**Author:** [@amundsen](https://discourse.processing.org/u/amundsen)\
**Replies:** 2\
**Last updated:** [July 22, 2022, 5:15pm UTC](https://discourse.processing.org/t/getting-a-nullpointerexception-when-trying-to-simply-display-an-image-in-draw/38015 "2022-07-22T17:15:18Z")

</div>

Hello, I have this issue with Processing 4.0b6/Windows. This ultrasimple sketch triggers a NullPointerException when trying to display the image within draw(). Otherwise when displaying it within setup() it works fine.…

---

## [Pulsating PGraphics used as mask only updated in one direction](https://discourse.processing.org/t/pulsating-pgraphics-used-as-mask-only-updated-in-one-direction/38030)

<div class="topic-metadata">

**Author:** [@amundsen](https://discourse.processing.org/u/amundsen)\
**Replies:** 5\
**Last updated:** [July 20, 2022, 9:56pm UTC](https://discourse.processing.org/t/pulsating-pgraphics-used-as-mask-only-updated-in-one-direction/38030 "2022-07-20T21:56:18Z")

</div>

Hello, I have a PGraphics with random rectangles appearing and disappearing progressively using changing value of fill(). It functions as expected. However, when used as a mask, the rectangles appear progressively but …

---

## [I Can't export pdf](https://discourse.processing.org/t/i-cant-export-pdf/38013)

<div class="topic-metadata">

**Author:** [@airobit](https://discourse.processing.org/u/airobit)\
**Replies:** 14\
**Last updated:** [July 19, 2022, 7:57pm UTC](https://discourse.processing.org/t/i-cant-export-pdf/38013 "2022-07-19T19:57:09Z")

</div>

Hi, i would like export in pdf the mycelium project “https://github.com/rspt/processing-mycelium.git” by many frames into one file, but the pde don’t start for this error in the last line of code ( } ) : Bad identifier? …

---

## [Issues with defining a frustum/perspective](https://discourse.processing.org/t/issues-with-defining-a-frustum-perspective/38019)

<div class="topic-metadata">

**Author:** [@graph100](https://discourse.processing.org/u/graph100)\
**Replies:** 3\
**Last updated:** [July 19, 2022, 5:54am UTC](https://discourse.processing.org/t/issues-with-defining-a-frustum-perspective/38019 "2022-07-19T05:54:19Z")

</div>

I’m working on a game and I’m currently trying to extend the render distance of the camera. I tried using the frustum() and perspective() functions, but they didn’t work. I tried again, this time using the default values…

---

## [How to minimize Processing Sketch window?](https://discourse.processing.org/t/how-to-minimize-processing-sketch-window/35061)

<div class="topic-metadata">

**Author:** [@CaseyJ](https://discourse.processing.org/u/CaseyJ)\
**Replies:** 3\
**Last updated:** [July 18, 2022, 2:22am UTC](https://discourse.processing.org/t/how-to-minimize-processing-sketch-window/35061 "2022-07-18T02:22:55Z")

</div>

Is there a way to run a line of code similar to exit(); that will minimize the window instead of closing it like exit(); does? I need the window to go away so another can take its place. It just still needs to exist to …

---

## [Painting/revealing a layer](https://discourse.processing.org/t/painting-revealing-a-layer/38000)

<div class="topic-metadata">

**Author:** [@bringmeflowers](https://discourse.processing.org/u/bringmeflowers)\
**Replies:** 1\
**Last updated:** [July 17, 2022, 11:32am UTC](https://discourse.processing.org/t/painting-revealing-a-layer/38000 "2022-07-17T11:32:46Z")

</div>

I want to create this effect in processing - where the mouse goes, the bottom painting layer is revealed. I try to loop through the pixels to the right of the mouseX to get the pixels for an area, but it does not wor…

---

## [2D surface growth: how to make my code run faster?](https://discourse.processing.org/t/2d-surface-growth-how-to-make-my-code-run-faster/37992)

<div class="topic-metadata">

**Author:** [@amundsen](https://discourse.processing.org/u/amundsen)\
**Replies:** 3\
**Last updated:** [July 17, 2022, 7:25am UTC](https://discourse.processing.org/t/2d-surface-growth-how-to-make-my-code-run-faster/37992 "2022-07-17T07:25:23Z")

</div>

Hello, I am programming some pixel-based 2d growth on a PImage from a random point. However I would like the code to run faster, especially the addNeighbour() function. On an i7-7820HQ/2.90GHz I need something like 5s …

---

## [java.lang.NoSuchMethodException from a Class.forName instantiation](https://discourse.processing.org/t/java-lang-nosuchmethodexception-from-a-class-forname-instantiation/37961)

<div class="topic-metadata">

**Author:** [@rowanmcnitt](https://discourse.processing.org/u/rowanmcnitt)\
**Replies:** 5\
**Last updated:** [July 16, 2022, 11:42pm UTC](https://discourse.processing.org/t/java-lang-nosuchmethodexception-from-a-class-forname-instantiation/37961 "2022-07-16T23:42:58Z")

</div>

Hello all, have been trying to debug this issue for hours with no luck, I’m trying to instantiate classes using a csv file: (I’ve also tried using getDeclaredConstructor) \*for this example, gun\_name = "m4"\* Object n…

---

## [Tint() in for loop doesn't work](https://discourse.processing.org/t/tint-in-for-loop-doesnt-work/37976)

<div class="topic-metadata">

**Author:** [@Andry](https://discourse.processing.org/u/Andry)\
**Replies:** 10\
**Last updated:** [July 16, 2022, 1:47pm UTC](https://discourse.processing.org/t/tint-in-for-loop-doesnt-work/37976 "2022-07-16T13:47:58Z")

</div>

Hi, I have this code that doesn’t work, why? PImage img; void setup() { size(400, 300); img= loadImage("myimage.jpg"); image(img,0,0,width, height); } void draw() { } float transparency = 255; void keyPres…

---

## [Can't make image rotate around it's own axis](https://discourse.processing.org/t/cant-make-image-rotate-around-its-own-axis/37956)

<div class="topic-metadata">

**Author:** [@ultimakey](https://discourse.processing.org/u/ultimakey)\
**Replies:** 1\
**Last updated:** [July 15, 2022, 3:08am UTC](https://discourse.processing.org/t/cant-make-image-rotate-around-its-own-axis/37956 "2022-07-15T03:08:23Z")

</div>

Hello! I want to make a 2D game with a top view where you control a car and you have to park it. But I can’t make the car rotate around it’s axis. I’ve tried placing in the translate the car coordinates, but I can’t make…

---

## [Pixel sorting on an angle](https://discourse.processing.org/t/pixel-sorting-on-an-angle/34206)

<div class="topic-metadata">

**Author:** [@synthetick](https://discourse.processing.org/u/synthetick)\
**Replies:** 3\
**Last updated:** [July 14, 2022, 9:45am UTC](https://discourse.processing.org/t/pixel-sorting-on-an-angle/34206 "2022-07-14T09:45:22Z")

</div>

Is there anyone who can help me understand how to change the angle of sorted pixels? Instead of sorting in horizontal lines, how would I implement something like this 45 degree angle?

---

## [3D Perlin noise in Processing](https://discourse.processing.org/t/3d-perlin-noise-in-processing/37770)

<div class="topic-metadata">

**Author:** [@asymmetric](https://discourse.processing.org/u/asymmetric)\
**Replies:** 30\
**Last updated:** [July 12, 2022, 2:43pm UTC](https://discourse.processing.org/t/3d-perlin-noise-in-processing/37770 "2022-07-12T14:43:28Z")

</div>

Hello! I just finished the coding train’s coding challenge #11 : 3D generation with perlin noise on YouTube! I have a question. How would I make a similar image but with my own image of noise that is responsive to the g…

---

## [Split Background Colour](https://discourse.processing.org/t/split-background-colour/9251)

<div class="topic-metadata">

**Author:** [@mayathebee](https://discourse.processing.org/u/mayathebee)\
**Replies:** 6\
**Last updated:** [July 11, 2022, 4:58pm UTC](https://discourse.processing.org/t/split-background-colour/9251 "2022-07-11T16:58:55Z")

</div>

Hello, I am very new to processing, but I have an assignment that requires me to split the screen with blue on top and green on the bottom. I know it’s very basic, but I can’t find anything about it in the processing ref…

---

## [How to get rid of flotation point calculation errors?](https://discourse.processing.org/t/how-to-get-rid-of-flotation-point-calculation-errors/37859)

<div class="topic-metadata">

**Author:** [@TT3overnot](https://discourse.processing.org/u/TT3overnot)\
**Replies:** 7\
**Last updated:** [July 8, 2022, 4:09pm UTC](https://discourse.processing.org/t/how-to-get-rid-of-flotation-point-calculation-errors/37859 "2022-07-08T16:09:10Z")

</div>

Help! I recently started the work of a space game similar to Space Flight Simulator or Kerbal space program but 2D. I ran into a problem where if I zoom into a smaller celestial body like deimos (one of the moons of mars…

---

## [Show website in Processing Java app](https://discourse.processing.org/t/show-website-in-processing-java-app/37846)

<div class="topic-metadata">

**Author:** [@LucaP](https://discourse.processing.org/u/LucaP)\
**Replies:** 5\
**Last updated:** [July 10, 2022, 5:03pm UTC](https://discourse.processing.org/t/show-website-in-processing-java-app/37846 "2022-07-10T17:03:21Z")

</div>

Hi, I would like to show a website inside of my processing java app. Is this possible?

---

## [Loading a 100MB PNG and draw it on the canvas but it eats 1GB of RAM :(](https://discourse.processing.org/t/loading-a-100mb-png-and-draw-it-on-the-canvas-but-it-eats-1gb-of-ram/37791)

<div class="topic-metadata">

**Author:** [@Enda](https://discourse.processing.org/u/Enda)\
**Replies:** 5\
**Last updated:** [July 8, 2022, 12:38am UTC](https://discourse.processing.org/t/loading-a-100mb-png-and-draw-it-on-the-canvas-but-it-eats-1gb-of-ram/37791 "2022-07-08T00:38:17Z")

</div>

Hello all This is a big problem for my university assignment and im the only girl in my class so I cant really ask for help from others there :frowning: When I load a PNG (100MB in size) and draw it on the canvas. The …

---

## [Title bar with close only](https://discourse.processing.org/t/title-bar-with-close-only/37839)

<div class="topic-metadata">

**Author:** [@Andry](https://discourse.processing.org/u/Andry)\
**Replies:** 5\
**Last updated:** [July 7, 2022, 7:46am UTC](https://discourse.processing.org/t/title-bar-with-close-only/37839 "2022-07-07T07:46:31Z")

</div>

Hello, there is a code to display only the close button on the title bar of the sketch

---

## [How do I use a method in other Processing projects?](https://discourse.processing.org/t/how-do-i-use-a-method-in-other-processing-projects/37863)

<div class="topic-metadata">

**Author:** [@Random\_Ghost](https://discourse.processing.org/u/Random_Ghost)\
**Replies:** 1\
**Last updated:** [July 6, 2022, 9:39pm UTC](https://discourse.processing.org/t/how-do-i-use-a-method-in-other-processing-projects/37863 "2022-07-06T21:39:50Z")

</div>

I created a function that takes an image and returns a similar version of the image but with Gameboy graphics. Is there a way I can sort of save the function so I can use it in other projects similar to the way we use fu…

---

## [Combining the copy and blend functions into a 'brush'](https://discourse.processing.org/t/combining-the-copy-and-blend-functions-into-a-brush/37830)

<div class="topic-metadata">

**Author:** [@JonoCES](https://discourse.processing.org/u/JonoCES)\
**Replies:** 6\
**Last updated:** [July 6, 2022, 7:26am UTC](https://discourse.processing.org/t/combining-the-copy-and-blend-functions-into-a-brush/37830 "2022-07-06T07:26:08Z")

</div>

Hi, Processing beginner here! Go easy on me. I’m interested in making images with Processing and have an idea I’d like to try out, but I’m stuggling to find existing examples where it’s been done before. Here’s what I’m…

---

## [How to make tilemap/tileset from .png file?](https://discourse.processing.org/t/how-to-make-tilemap-tileset-from-png-file/37837)

<div class="topic-metadata">

**Author:** [@StasPovaliaevUkraine](https://discourse.processing.org/u/StasPovaliaevUkraine)\
**Replies:** 4\
**Last updated:** [July 5, 2022, 2:21pm UTC](https://discourse.processing.org/t/how-to-make-tilemap-tileset-from-png-file/37837 "2022-07-05T14:21:58Z")

</div>

Hello. Glory to Ukraine. I want to make a class that will render and display a tilemap, but I didn’t find any example how to this can be done, how to display part of the picture?

---

## [Cellular Automata without Animation](https://discourse.processing.org/t/cellular-automata-without-animation/37789)

<div class="topic-metadata">

**Author:** [@bcabc](https://discourse.processing.org/u/bcabc)\
**Replies:** 6\
**Last updated:** [July 2, 2022, 8:23pm UTC](https://discourse.processing.org/t/cellular-automata-without-animation/37789 "2022-07-02T20:23:32Z")

</div>

I’ve been following along with Daniel Shiffman’s Cellular Automata tutorials (the code is here: noc-examples-processing/chp07\_CA at master · arianatri/noc-examples-processing · GitHub). And I’ve noticed that most CA see…

---

## [Problem with acceptance of displayWidth/displayHeight in iPhone app](https://discourse.processing.org/t/problem-with-acceptance-of-displaywidth-displayheight-in-iphone-app/37765)

<div class="topic-metadata">

**Author:** [@anrui71](https://discourse.processing.org/u/anrui71)\
**Replies:** 2\
**Last updated:** [July 1, 2022, 10:24am UTC](https://discourse.processing.org/t/problem-with-acceptance-of-displaywidth-displayheight-in-iphone-app/37765 "2022-07-01T10:24:36Z")

</div>

Hello everyone, I hope I did not miss an earlier post with the same question: I ran into a problem trying to use displayWidth/displayHeight within the iPhone app. The code is: void settings() { fullScreen(); cwh = mi…

---

## [Rotating text "|" vs rotating line](https://discourse.processing.org/t/rotating-text-vs-rotating-line/37762)

<div class="topic-metadata">

**Author:** [@Erif](https://discourse.processing.org/u/Erif)\
**Replies:** 10\
**Last updated:** [June 30, 2022, 9:02pm UTC](https://discourse.processing.org/t/rotating-text-vs-rotating-line/37762 "2022-06-30T21:02:40Z")

</div>

Hi all, I’ve been playing with rotating and looping the keyboard vertical bar, however when trying to replicate that by using a regular line I’m struggling with what it would be the equivalent to the textSize() function…

---

## [Why this Graham Scan algorithm of convex hull works wrong when number of points more than 10k](https://discourse.processing.org/t/why-this-graham-scan-algorithm-of-convex-hull-works-wrong-when-number-of-points-more-than-10k/37749)

<div class="topic-metadata">

**Author:** [@obry](https://discourse.processing.org/u/obry)\
**Replies:** 6\
**Last updated:** [June 30, 2022, 9:38am UTC](https://discourse.processing.org/t/why-this-graham-scan-algorithm-of-convex-hull-works-wrong-when-number-of-points-more-than-10k/37749 "2022-06-30T09:38:33Z")

</div>

Here is the code. It works fine with 10k and less. NUM variable it is number of points import java.util.Arrays; import java.util.Comparator; ArrayList\<PVector\> init, sorted; int NUM = 10000; int border = 100; void set…

---

## [Can you break and start an if loop?](https://discourse.processing.org/t/can-you-break-and-start-an-if-loop/37761)

<div class="topic-metadata">

**Author:** [@Kalarila](https://discourse.processing.org/u/Kalarila)\
**Replies:** 7\
**Last updated:** [June 30, 2022, 8:35am UTC](https://discourse.processing.org/t/can-you-break-and-start-an-if-loop/37761 "2022-06-30T08:35:53Z")

</div>

\[details=“Summary”\] This text will be hidden So I want to create a simple program where some shapes slowly change color from red to green, then to blue and then back to red. To do so, I created integers r, g and b and…

---

## [Rotate problem with PGraphics](https://discourse.processing.org/t/rotate-problem-with-pgraphics/37753)

<div class="topic-metadata">

**Author:** [@druuupppa](https://discourse.processing.org/u/druuupppa)\
**Replies:** 4\
**Last updated:** [June 29, 2022, 11:56pm UTC](https://discourse.processing.org/t/rotate-problem-with-pgraphics/37753 "2022-06-29T23:56:30Z")

</div>

Can someone please help me to get rotate to work with pgraphics in the following code. This code calls a function that draws a ‘petal’ that I would like to rotate and which was working perfectly without PGraphics. \< p.…

---

## [Sampling a movement by storing Mouse datas and repeat it one second after. The right sampling :)](https://discourse.processing.org/t/sampling-a-movement-by-storing-mouse-datas-and-repeat-it-one-second-after-the-right-sampling/37472)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 10\
**Last updated:** [June 28, 2022, 4:10pm UTC](https://discourse.processing.org/t/sampling-a-movement-by-storing-mouse-datas-and-repeat-it-one-second-after-the-right-sampling/37472 "2022-06-28T16:10:25Z")

</div>

PLEASE GO to SEE my NEXT post! Thank you Hello everybodies, I would like to be able to record the x and y position of the mouse for a second and then automatically redo that recorded movement. It would be nice to succ…

---

## [Copy data to OpenGL buffer](https://discourse.processing.org/t/copy-data-to-opengl-buffer/17709)

<div class="topic-metadata">

**Author:** [@Alex\_Pr](https://discourse.processing.org/u/Alex_Pr)\
**Replies:** 6\
**Last updated:** [June 28, 2022, 6:32am UTC](https://discourse.processing.org/t/copy-data-to-opengl-buffer/17709 "2022-06-28T06:32:30Z")

</div>

I’m trying to implement a parallax mapping shader following this post. In the (C++) code, at the end of the renderQuad function, the the array quadVertices is copied into the GL Buffer. How can I do the same in Processi…

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

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