# Coding Questions

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

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

**Page:** 15

---

## [Help with array (upper bound)](https://discourse.processing.org/t/help-with-array-upper-bound/41208)

<div class="topic-metadata">

**Author:** [@kristianjones](https://discourse.processing.org/u/kristianjones)\
**Replies:** 4\
**Last updated:** [March 9, 2023, 9:39am UTC](https://discourse.processing.org/t/help-with-array-upper-bound/41208 "2023-03-09T09:39:07Z")

</div>

Hi there. I have a question about a sketch i’m working on. I have it working the way I want it to, but, I want to change the amount of images that are displayed randomly from the array. It seems to currently display arou…

---

## [Making SVGs get bigger the further from the center of the canvas they are](https://discourse.processing.org/t/making-svgs-get-bigger-the-further-from-the-center-of-the-canvas-they-are/41200)

<div class="topic-metadata">

**Author:** [@Noobcessing](https://discourse.processing.org/u/Noobcessing)\
**Replies:** 4\
**Last updated:** [March 8, 2023, 8:03pm UTC](https://discourse.processing.org/t/making-svgs-get-bigger-the-further-from-the-center-of-the-canvas-they-are/41200 "2023-03-08T20:03:28Z")

</div>

Hi Guys - Totally new user here hoping to become an established community member, nice to meet you all. I’m hoping to create a project which has randomly rotated scalene triangles (or acute triangles) that are barely vi…

---

## [I want to create a window with height smaller than the minimum allowed by Processing. Is this possible?](https://discourse.processing.org/t/i-want-to-create-a-window-with-height-smaller-than-the-minimum-allowed-by-processing-is-this-possible/40755)

<div class="topic-metadata">

**Author:** [@vinijoncrafts](https://discourse.processing.org/u/vinijoncrafts)\
**Replies:** 5\
**Last updated:** [March 8, 2023, 4:48pm UTC](https://discourse.processing.org/t/i-want-to-create-a-window-with-height-smaller-than-the-minimum-allowed-by-processing-is-this-possible/40755 "2023-03-08T16:48:21Z")

</div>

Idk what else to say. Here’s my code, if that’s relevant. float v = 5; int winX = width/2; int winY = 800; boolean \[\] keys = new boolean\[128\]; import java.awt.Robot; Robot robot; void setup () { size(600, 25); tr…

---

## [My contour doesn't work](https://discourse.processing.org/t/my-contour-doesnt-work/41193)

<div class="topic-metadata">

**Author:** [@TF-SHOCK76](https://discourse.processing.org/u/TF-SHOCK76)\
**Replies:** 2\
**Last updated:** [March 8, 2023, 12:31pm UTC](https://discourse.processing.org/t/my-contour-doesnt-work/41193 "2023-03-08T12:31:20Z")

</div>

I tried to create a plane with a hole in the middle. It works with the example on the documentation, but I don’t succeed to make it work with my values. Is there any constraint on values? Here is my code: float x = 980…

---

## [Arraylist and inheritance](https://discourse.processing.org/t/arraylist-and-inheritance/41073)

<div class="topic-metadata">

**Author:** [@hokuto](https://discourse.processing.org/u/hokuto)\
**Replies:** 8\
**Last updated:** [March 7, 2023, 3:23pm UTC](https://discourse.processing.org/t/arraylist-and-inheritance/41073 "2023-03-07T15:23:48Z")

</div>

I am going to show an example where I am testing the use of inheritance. There are three classes, one that is a ship that can be moved with the keys and shoot, the other class is in charge of shooting and finally there …

---

## [Keyboard to input a word not just letter](https://discourse.processing.org/t/keyboard-to-input-a-word-not-just-letter/41180)

<div class="topic-metadata">

**Author:** [@Dave](https://discourse.processing.org/u/Dave)\
**Replies:** 4\
**Last updated:** [March 7, 2023, 2:39pm UTC](https://discourse.processing.org/t/keyboard-to-input-a-word-not-just-letter/41180 "2023-03-07T14:39:22Z")

</div>

This code takes a 1 letter input from keyboard and moves a pointer what i would like to do is take a 4 letter word input something like if (input == cold ) { do this stuff } thankyou for your time \`Preformatted te…

---

## [How to improve performance: multiple array operations on pixels](https://discourse.processing.org/t/how-to-improve-performance-multiple-array-operations-on-pixels/41078)

<div class="topic-metadata">

**Author:** [@flodeux](https://discourse.processing.org/u/flodeux)\
**Replies:** 5\
**Last updated:** [March 7, 2023, 12:12pm UTC](https://discourse.processing.org/t/how-to-improve-performance-multiple-array-operations-on-pixels/41078 "2023-03-07T12:12:00Z")

</div>

Hi all :slight\_smile: I’m back to processing. I was using this tool when i was student 10 years ago, and its really pleasure to re-use it ! I’m triyng to use Kinect to generate design and im working to calculate pixels…

---

## [Coding problem in my game](https://discourse.processing.org/t/coding-problem-in-my-game/41169)

<div class="topic-metadata">

**Author:** [@MaxU89](https://discourse.processing.org/u/MaxU89)\
**Replies:** 6\
**Last updated:** [March 7, 2023, 2:23am UTC](https://discourse.processing.org/t/coding-problem-in-my-game/41169 "2023-03-07T02:23:57Z")

</div>

Hello. I have once again stumbled across a problem which I couldn’t resolve myself. My Plank does interact with the ball, but only sometimes. And sometimes on the edge the ball just bursts through. I think the problem is…

---

## [Fading and Zoom (image slideshow)](https://discourse.processing.org/t/fading-and-zoom-image-slideshow/40812)

<div class="topic-metadata">

**Author:** [@ajaynischal98](https://discourse.processing.org/u/ajaynischal98)\
**Replies:** 33\
**Last updated:** [March 5, 2023, 10:31pm UTC](https://discourse.processing.org/t/fading-and-zoom-image-slideshow/40812 "2023-03-05T22:31:45Z")

</div>

Hi I have a txt file that contains image names. I am trying to take the first image and fade slowly into the second image. I then want to start zooming into the second image to about 500x. I tried to do it but for some r…

---

## [How do i change the icon of the exported exe?](https://discourse.processing.org/t/how-do-i-change-the-icon-of-the-exported-exe/41140)

<div class="topic-metadata">

**Author:** [@Aryszin](https://discourse.processing.org/u/Aryszin)\
**Replies:** 4\
**Last updated:** [March 4, 2023, 3:43pm UTC](https://discourse.processing.org/t/how-do-i-change-the-icon-of-the-exported-exe/41140 "2023-03-04T15:43:12Z")

</div>

I want to change the icon of the exe, when compiled it shows the basic Processing icon. How do i change it? Ressource hacker works, but if i try opening it it opens with an error.

---

## [Possible to change top bars layout? (window frame color)](https://discourse.processing.org/t/possible-to-change-top-bars-layout-window-frame-color/40914)

<div class="topic-metadata">

**Author:** [@Aryszin](https://discourse.processing.org/u/Aryszin)\
**Replies:** 3\
**Last updated:** [March 4, 2023, 3:26pm UTC](https://discourse.processing.org/t/possible-to-change-top-bars-layout-window-frame-color/40914 "2023-03-04T15:26:03Z")

</div>

Is it possible to change how the bar looks in Windows, where the minimize, window & exit buttons are. Can you change the color of that?

---

## [Diagonal move not working](https://discourse.processing.org/t/diagonal-move-not-working/41103)

<div class="topic-metadata">

**Author:** [@hokuto](https://discourse.processing.org/u/hokuto)\
**Replies:** 3\
**Last updated:** [March 2, 2023, 4:27pm UTC](https://discourse.processing.org/t/diagonal-move-not-working/41103 "2023-03-02T16:27:04Z")

</div>

//clase jugador-------------------------------------- class Jugador extends Padre{ private float x,y,velocidad; private PImage grafico = loadImage("jugador.png"); private Disparo disparo1; private int contador; …

---

## [Help with projecting a 3D point to the 2D view](https://discourse.processing.org/t/help-with-projecting-a-3d-point-to-the-2d-view/41112)

<div class="topic-metadata">

**Author:** [@Flon](https://discourse.processing.org/u/Flon)\
**Replies:** 4\
**Last updated:** [March 2, 2023, 11:02am UTC](https://discourse.processing.org/t/help-with-projecting-a-3d-point-to-the-2d-view/41112 "2023-03-02T11:02:18Z")

</div>

Hi all, can anyone offer insight into how the PGraphics3D “projection” and “modelview” (or combined “projmodelview” ) matrices are used to convert a 3d vector in the scene to a final 2d vector on the rasterized screen? I…

---

## [1st person camera](https://discourse.processing.org/t/1st-person-camera/41106)

<div class="topic-metadata">

**Author:** [@09husky](https://discourse.processing.org/u/09husky)\
**Replies:** 1\
**Last updated:** [March 1, 2023, 10:23pm UTC](https://discourse.processing.org/t/1st-person-camera/41106 "2023-03-01T22:23:38Z")

</div>

I am having some trouble with the camera function at the end. It does work to a decent extent, but I am wondering if anyone can help me solve the following problems with it: sensitivity too high for looking up and down …

---

## [Help with coding syntax errors](https://discourse.processing.org/t/help-with-coding-syntax-errors/41110)

<div class="topic-metadata">

**Author:** [@danielsj14](https://discourse.processing.org/u/danielsj14)\
**Replies:** 2\
**Last updated:** [March 1, 2023, 10:06pm UTC](https://discourse.processing.org/t/help-with-coding-syntax-errors/41110 "2023-03-01T22:06:14Z")

</div>

I’m trying to code a moving grid pattern and I keep getting an error message when I try to run my code, but I can’t figure out why. This is what my code looks like: float x = 0; float y = 0; float spacing = 50; //One a…

---

## [How do I make randomly generated objects move?](https://discourse.processing.org/t/how-do-i-make-randomly-generated-objects-move/41091)

<div class="topic-metadata">

**Author:** [@jrubesch](https://discourse.processing.org/u/jrubesch)\
**Replies:** 5\
**Last updated:** [February 28, 2023, 7:18pm UTC](https://discourse.processing.org/t/how-do-i-make-randomly-generated-objects-move/41091 "2023-02-28T19:18:00Z")

</div>

Hi! I’m trying to code something like scrolling credits with some text. I loaded each text block as an image and generated the text order randomly. I now want those text blocks to move up the screen like movie-ending cre…

---

## [Process error column 4 dont exist](https://discourse.processing.org/t/process-error-column-4-dont-exist/41075)

<div class="topic-metadata">

**Author:** [@ctremblay](https://discourse.processing.org/u/ctremblay)\
**Replies:** 16\
**Last updated:** [February 27, 2023, 4:38pm UTC](https://discourse.processing.org/t/process-error-column-4-dont-exist/41075 "2023-02-27T16:38:19Z")

</div>

I’m coding a game and using tables. I have a bunch of lines of code that could easily be placed in a table to lessen the code, even though i’m sure everything is correct it keeps giving me an error. “Column 4 dont exist.…

---

## [FrameRate hiccups](https://discourse.processing.org/t/framerate-hiccups/11947)

<div class="topic-metadata">

**Author:** [@glv](https://discourse.processing.org/u/glv)\
**Replies:** 20\
**Last updated:** [February 26, 2023, 2:11pm UTC](https://discourse.processing.org/t/framerate-hiccups/11947 "2023-02-26T14:11:08Z")

</div>

I have experienced hiccups in my animations at the start of my animations and trying to understand why this happens. Is it Processing, Java or other? I have reduced it down to a simple example that displays frameRates b…

---

## [Very weird stuff going on with colors and transparency with the P2D renderer](https://discourse.processing.org/t/very-weird-stuff-going-on-with-colors-and-transparency-with-the-p2d-renderer/40924)

<div class="topic-metadata">

**Author:** [@PianoMastR64](https://discourse.processing.org/u/PianoMastR64)\
**Replies:** 8\
**Last updated:** [February 24, 2023, 3:20pm UTC](https://discourse.processing.org/t/very-weird-stuff-going-on-with-colors-and-transparency-with-the-p2d-renderer/40924 "2023-02-24T15:20:16Z")

</div>

PGraphics pg; void setup() { size(800, 800, P2D); pg = createGraphics(width, height, P2D); pg.beginDraw(); pg.noStroke(); pg.clear(); pg.fill(255, 127); pg.rect(0, 0, 195, height); printColor(pg.get…

---

## [Get elements in JSONObject](https://discourse.processing.org/t/get-elements-in-jsonobject/41048)

<div class="topic-metadata">

**Author:** [@Stanlepunk](https://discourse.processing.org/u/Stanlepunk)\
**Replies:** 3\
**Last updated:** [February 24, 2023, 1:14pm UTC](https://discourse.processing.org/t/get-elements-in-jsonobject/41048 "2023-02-24T13:14:41Z")

</div>

I try to go in JSONObject but I don’t find a solution to go inside, except if I use knew key. But my purpose is going to the object to grad all informations from it, I don’t know the information in advance. I see the JS…

---

## [Help with code with images](https://discourse.processing.org/t/help-with-code-with-images/40917)

<div class="topic-metadata">

**Author:** [@ajaynischal98](https://discourse.processing.org/u/ajaynischal98)\
**Replies:** 3\
**Last updated:** [February 23, 2023, 6:22pm UTC](https://discourse.processing.org/t/help-with-code-with-images/40917 "2023-02-23T18:22:57Z")

</div>

ArrayList\<PImage\> images; int lastImageIndex = -1; int nextImageIndex = 0; float alphaValue = 0; float alphaShift = 0.004; // adjust speed, smaller = slower //Parabolic Zoom void setup() { fullScreen(P2…

---

## [Image() flickers when changing sketch size with windowResize()](https://discourse.processing.org/t/image-flickers-when-changing-sketch-size-with-windowresize/38952)

<div class="topic-metadata">

**Author:** [@sableraph](https://discourse.processing.org/u/sableraph)\
**Replies:** 4\
**Last updated:** [February 23, 2023, 3:44pm UTC](https://discourse.processing.org/t/image-flickers-when-changing-sketch-size-with-windowresize/38952 "2023-02-23T15:44:18Z")

</div>

Context: I’m trying to make a demo sketch for the new window methods in Processing 4.0 (which replace the old surface methods). I’m running in an issue where the image flickers at larger sizes.This happens even if I art…

---

## [How to set an area of pixels in an if statement?](https://discourse.processing.org/t/how-to-set-an-area-of-pixels-in-an-if-statement/41006)

<div class="topic-metadata">

**Author:** [@MaxU89](https://discourse.processing.org/u/MaxU89)\
**Replies:** 3\
**Last updated:** [February 23, 2023, 8:45am UTC](https://discourse.processing.org/t/how-to-set-an-area-of-pixels-in-an-if-statement/41006 "2023-02-23T08:45:15Z")

</div>

Hello. I need help with setting an area of pixels in an if statement. I am still kind of new here so please don’t pay attention to any wrong terminology I use. In an if statement I need to use not only the one position …

---

## [Function within mousePressed function doesn't work](https://discourse.processing.org/t/function-within-mousepressed-function-doesnt-work/40981)

<div class="topic-metadata">

**Author:** [@MaxU89](https://discourse.processing.org/u/MaxU89)\
**Replies:** 3\
**Last updated:** [February 21, 2023, 8:55pm UTC](https://discourse.processing.org/t/function-within-mousepressed-function-doesnt-work/40981 "2023-02-21T20:55:50Z")

</div>

Hello. I am still kind of new to processing. I have been trying to create a game with moving platform(I called it plank), balls which shoot down bricks. I am currently creating the platform and I want it to move on the x…

---

## [Navigation links in PDF](https://discourse.processing.org/t/navigation-links-in-pdf/40973)

<div class="topic-metadata">

**Author:** [@Mattax\_ger](https://discourse.processing.org/u/Mattax_ger)\
**Replies:** 3\
**Last updated:** [February 21, 2023, 5:06pm UTC](https://discourse.processing.org/t/navigation-links-in-pdf/40973 "2023-02-21T17:06:37Z")

</div>

Hello everyone, i am using processing since 2015 and just registered for the forum. i would like to know if you guys can tell me how to put a page/chapter hypertext-link inside a generated pdf file, if this is even pos…

---

## [Random Select Images and Fade in / fade out according to variable / Blend](https://discourse.processing.org/t/random-select-images-and-fade-in-fade-out-according-to-variable-blend/40960)

<div class="topic-metadata">

**Author:** [@JonnieNightTime](https://discourse.processing.org/u/JonnieNightTime)\
**Replies:** 1\
**Last updated:** [February 20, 2023, 9:12am UTC](https://discourse.processing.org/t/random-select-images-and-fade-in-fade-out-according-to-variable-blend/40960 "2023-02-20T09:12:21Z")

</div>

Hi All, can’t see the wood for the trees here!! I"m trying to randomly move through an image directory, and fade in and out according to a variable imgA\_Duration. Eventually I want to blend multiple layers of images fro…

---

## [Create class in Processing (error message)](https://discourse.processing.org/t/create-class-in-processing-error-message/40922)

<div class="topic-metadata">

**Author:** [@kmll](https://discourse.processing.org/u/kmll)\
**Replies:** 7\
**Last updated:** [February 16, 2023, 11:53am UTC](https://discourse.processing.org/t/create-class-in-processing-error-message/40922 "2023-02-16T11:53:47Z")

</div>

I created a class in a separate TAB but I still get the “The class Test does not exist”. If I move the class code into the main tab it works fine. What do I need to do to import the class? In main tab: Test t1 = new Te…

---

## [Transitions for Fading and Zooming](https://discourse.processing.org/t/transitions-for-fading-and-zooming/40927)

<div class="topic-metadata">

**Author:** [@ajaynischal1](https://discourse.processing.org/u/ajaynischal1)\
**Replies:** 1\
**Last updated:** [February 15, 2023, 5:57pm UTC](https://discourse.processing.org/t/transitions-for-fading-and-zooming/40927 "2023-02-15T17:57:54Z")

</div>

ArrayList\<PImage\> images; int lastImageIndex = -1; int nextImageIndex = 0; float alphaValue = 0; float alphaShift = 0.004; // adjust speed, smaller = slower //Parabolic Zoom void setup() { fullScreen(P2…

---

## [Advice for understanding Processing 'under the hood'](https://discourse.processing.org/t/advice-for-understanding-processing-under-the-hood/40778)

<div class="topic-metadata">

**Author:** [@MuddyGardener](https://discourse.processing.org/u/MuddyGardener)\
**Replies:** 11\
**Last updated:** [February 15, 2023, 1:33am UTC](https://discourse.processing.org/t/advice-for-understanding-processing-under-the-hood/40778 "2023-02-15T01:33:25Z")

</div>

Sometimes I run into something about Processing that I think is super useful but isn’t obvious from the surface level documentation, such as this answer to a query from the old Processing forum: the PGraphics object us…

---

## [Possible to use a variable as literal code? (from variables to ArrayList)](https://discourse.processing.org/t/possible-to-use-a-variable-as-literal-code-from-variables-to-arraylist/40903)

<div class="topic-metadata">

**Author:** [@Aryszin](https://discourse.processing.org/u/Aryszin)\
**Replies:** 6\
**Last updated:** [February 12, 2023, 9:27pm UTC](https://discourse.processing.org/t/possible-to-use-a-variable-as-literal-code-from-variables-to-arraylist/40903 "2023-02-12T21:27:48Z")

</div>

so this is very complicated. im making an art software and i have many pgraphics, and i need to speak to the pgraphics. im wondering if there is any method, i could make it so it doest always is: if(currentlayer == 1) {…

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

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