# Coding Questions

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

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

**Page:** 25

---

## [Offset when reading a sample](https://discourse.processing.org/t/offset-when-reading-a-sample/38883)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 0\
**Last updated:** [September 20, 2022, 3:43pm UTC](https://discourse.processing.org/t/offset-when-reading-a-sample/38883 "2022-09-20T15:43:34Z")

</div>

Hello, I would like to resample a first sample of datas that following a circular movement. Moreover movement of first and second sample are made with interpolations. You make movement with mouseY, you trig the recordi…

---

## [Updating ArrayList with additional instances of object](https://discourse.processing.org/t/updating-arraylist-with-additional-instances-of-object/38849)

<div class="topic-metadata">

**Author:** [@debxyz](https://discourse.processing.org/u/debxyz)\
**Replies:** 15\
**Last updated:** [September 20, 2022, 1:32am UTC](https://discourse.processing.org/t/updating-arraylist-with-additional-instances-of-object/38849 "2022-09-20T01:32:23Z")

</div>

Hello! I’ve think I’ve made some progress but… The goal is to: loop through an ArrayList which displays as a grid, – completed randomly select a few of the cells, – completed subdivide the selected into 4 smaller cel…

---

## [\[JAVA\] Get network information](https://discourse.processing.org/t/java-get-network-information/38866)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 1\
**Last updated:** [September 20, 2022, 12:32am UTC](https://discourse.processing.org/t/java-get-network-information/38866 "2022-09-20T00:32:19Z")

</div>

\[JAVA\] Get network information This is the source code to get network information. It would be good for reference. ref : Showing IP address of my device in the network? - Processing 2.x and 3.x Forum import java.net.…

---

## [\[JAVA\] Keypressed function / Can't I get Korean, Japanese, Chinese, etc.?](https://discourse.processing.org/t/java-keypressed-function-cant-i-get-korean-japanese-chinese-etc/38799)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 7\
**Last updated:** [September 19, 2022, 10:56pm UTC](https://discourse.processing.org/t/java-keypressed-function-cant-i-get-korean-japanese-chinese-etc/38799 "2022-09-19T22:56:08Z")

</div>

\[JAVA\] Keypressed function / Can’t I get Korean, Japanese, Chinese, etc.? You cannot receive data through Keypressed. Is it correct that it cannot be received with the ‘Key’ function in processing? Or is there anot…

---

## [Creating a function that returns an ArrayList of manipulated objects](https://discourse.processing.org/t/creating-a-function-that-returns-an-arraylist-of-manipulated-objects/38824)

<div class="topic-metadata">

**Author:** [@debxyz](https://discourse.processing.org/u/debxyz)\
**Replies:** 6\
**Last updated:** [September 19, 2022, 8:00pm UTC](https://discourse.processing.org/t/creating-a-function-that-returns-an-arraylist-of-manipulated-objects/38824 "2022-09-19T20:00:03Z")

</div>

Hello!! I have been trying to figure out the syntax to create a method that will subdivide a GridCell object. The GridCells display in the main program in a 2-D grid. In the main program I want to be able to loop thru…

---

## [I have Some trouble with a ArrayList](https://discourse.processing.org/t/i-have-some-trouble-with-a-arraylist/38863)

<div class="topic-metadata">

**Author:** [@CreCo](https://discourse.processing.org/u/CreCo)\
**Replies:** 10\
**Last updated:** [September 19, 2022, 6:10pm UTC](https://discourse.processing.org/t/i-have-some-trouble-with-a-arraylist/38863 "2022-09-19T18:10:53Z")

</div>

Dear love Community, I have some trouble with a ArrayList. I have coded a little bit complex Program. In this Program I have a set of Classes. Of one of this Classes i have build a ArrayList. Then I have coded three…

---

## [Pg graphics window is always square, even if main window size is rectangular](https://discourse.processing.org/t/pg-graphics-window-is-always-square-even-if-main-window-size-is-rectangular/38806)

<div class="topic-metadata">

**Author:** [@ishmalish](https://discourse.processing.org/u/ishmalish)\
**Replies:** 2\
**Last updated:** [September 16, 2022, 6:16pm UTC](https://discourse.processing.org/t/pg-graphics-window-is-always-square-even-if-main-window-size-is-rectangular/38806 "2022-09-16T18:16:59Z")

</div>

PFont font; PGraphics pg; void setup() { size(400, 600, P2D); font = createFont("helvetica\_bold.otf", 30); pg = createGraphics(1000, 1000, P2D); //pg = createGraphics(400, 600, P2D); //or the same size as the si…

---

## [How to make an overlay that overlays over other program](https://discourse.processing.org/t/how-to-make-an-overlay-that-overlays-over-other-program/38784)

<div class="topic-metadata">

**Author:** [@5x9x7x2x7x9](https://discourse.processing.org/u/5x9x7x2x7x9)\
**Replies:** 8\
**Last updated:** [September 15, 2022, 7:03pm UTC](https://discourse.processing.org/t/how-to-make-an-overlay-that-overlays-over-other-program/38784 "2022-09-15T19:03:43Z")

</div>

Hello, I was wondering if there was any way to make it so I could have a program, that if you switch to another program, it would still be on your screen and you could interact with the other program normally? For examp…

---

## [How to use robot.mousePress(int) and robot.mouseRelease(int)?](https://discourse.processing.org/t/how-to-use-robot-mousepress-int-and-robot-mouserelease-int/27768)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 3\
**Last updated:** [September 16, 2022, 9:06am UTC](https://discourse.processing.org/t/how-to-use-robot-mousepress-int-and-robot-mouserelease-int/27768 "2022-09-16T09:06:11Z")

</div>

Hi! I recently started using the robot library. I tried using inputEvent. and mouseEvent with the BUTTON\_MASK1… (I saw those methods on forums) However; I can’t use robot.mousePress(int) and robot.mouseRelease(int) I…

---

## [Reproducing JPG image from script to make it editable](https://discourse.processing.org/t/reproducing-jpg-image-from-script-to-make-it-editable/38760)

<div class="topic-metadata">

**Author:** [@techmouse](https://discourse.processing.org/u/techmouse)\
**Replies:** 10\
**Last updated:** [September 16, 2022, 7:29am UTC](https://discourse.processing.org/t/reproducing-jpg-image-from-script-to-make-it-editable/38760 "2022-09-16T07:29:02Z")

</div>

Hi, I want to ask, is there a script I could use to recreate an image I have and convert to a suitable format where I can make modifications to the image ?

---

## [How to load JSON multidimensional arrays and set them in a table](https://discourse.processing.org/t/how-to-load-json-multidimensional-arrays-and-set-them-in-a-table/38797)

<div class="topic-metadata">

**Author:** [@codeconfuser](https://discourse.processing.org/u/codeconfuser)\
**Replies:** 1\
**Last updated:** [September 16, 2022, 7:26am UTC](https://discourse.processing.org/t/how-to-load-json-multidimensional-arrays-and-set-them-in-a-table/38797 "2022-09-16T07:26:25Z")

</div>

Hi, I’m trying to get data from a JSON array that is outputted from a sensor, but I’m struggling to parse the data into easy columns and rows. this is a sample of the data output \[\[1643935200000,1\],\[1643941200000,1\],\[…

---

## [Begginer here, trying to reduce code with a for loop iteration](https://discourse.processing.org/t/begginer-here-trying-to-reduce-code-with-a-for-loop-iteration/38763)

<div class="topic-metadata">

**Author:** [@laptophead](https://discourse.processing.org/u/laptophead)\
**Replies:** 6\
**Last updated:** [September 16, 2022, 5:49am UTC](https://discourse.processing.org/t/begginer-here-trying-to-reduce-code-with-a-for-loop-iteration/38763 "2022-09-16T05:49:00Z")

</div>

please format code with \</\> button \* homework policy \* asking questions I used for loop for simple things before… but now I have to do some addition in every increment. My brain froze… I am drowning in code… Is t…

---

## [The operator \> is undefined for the argument - HOW TO RESOLVE ERROR (OOP)](https://discourse.processing.org/t/the-operator-is-undefined-for-the-argument-how-to-resolve-error-oop/38705)

<div class="topic-metadata">

**Author:** [@sosophia10](https://discourse.processing.org/u/sosophia10)\
**Replies:** 4\
**Last updated:** [September 13, 2022, 7:01pm UTC](https://discourse.processing.org/t/the-operator-is-undefined-for-the-argument-how-to-resolve-error-oop/38705 "2022-09-13T19:01:29Z")

</div>

Why is this error occuring and what can I do to solve it? The operator \> is undefined for the argument type(s) int Main.Cards is indicated where cardX, cardY, cardH, and cardW are being called in mousePressed(); and…

---

## [Easing equations with 'Influence' and 'In-/Outgoing Velocity' like in Adobe After Effects](https://discourse.processing.org/t/easing-equations-with-influence-and-in-outgoing-velocity-like-in-adobe-after-effects/38687)

<div class="topic-metadata">

**Author:** [@Namrad](https://discourse.processing.org/u/Namrad)\
**Replies:** 3\
**Last updated:** [September 14, 2022, 1:00pm UTC](https://discourse.processing.org/t/easing-equations-with-influence-and-in-outgoing-velocity-like-in-adobe-after-effects/38687 "2022-09-14T13:00:15Z")

</div>

Hello, I want to synchronise the easing of something I coded to something I made in After Effects as exactly as possible. In After Effects, when animating something you can more precisely control the motion of that ani…

---

## [Is there a way to pass a PNG image with the PImage.set() command?](https://discourse.processing.org/t/is-there-a-way-to-pass-a-png-image-with-the-pimage-set-command/38731)

<div class="topic-metadata">

**Author:** [@michele\_rinaldi](https://discourse.processing.org/u/michele_rinaldi)\
**Replies:** 5\
**Last updated:** [September 14, 2022, 12:16am UTC](https://discourse.processing.org/t/is-there-a-way-to-pass-a-png-image-with-the-pimage-set-command/38731 "2022-09-14T00:16:28Z")

</div>

I need to copy a PNG image to a JPG image. Using the command: pimg.set (x, y, img); I paste the image not as a PNG but as a JPG, thus inserting the background. Any advice to solve this problem?

---

## [Display Table data from a csv and return the rowID when the user clicks on a row](https://discourse.processing.org/t/display-table-data-from-a-csv-and-return-the-rowid-when-the-user-clicks-on-a-row/38548)

<div class="topic-metadata">

**Author:** [@TEACHMYSTERY](https://discourse.processing.org/u/TEACHMYSTERY)\
**Replies:** 4\
**Last updated:** [September 13, 2022, 4:44pm UTC](https://discourse.processing.org/t/display-table-data-from-a-csv-and-return-the-rowid-when-the-user-clicks-on-a-row/38548 "2022-09-13T16:44:09Z")

</div>

I want to display some of the columns from a Table object (it is loaded from a csv file) and then retrieve the row of information when the user clicks on the row. I do not see a “native” mechanism to do this in processin…

---

## [Pro Question: get ALL in-between points from beginShape curveVertex() endShape](https://discourse.processing.org/t/pro-question-get-all-in-between-points-from-beginshape-curvevertex-endshape/38693)

<div class="topic-metadata">

**Author:** [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Replies:** 5\
**Last updated:** [September 12, 2022, 3:35pm UTC](https://discourse.processing.org/t/pro-question-get-all-in-between-points-from-beginshape-curvevertex-endshape/38693 "2022-09-12T15:35:09Z")

</div>

Hello all! as we all know, we can use beginShape curveVertex() endShape to make long complex curves. See Reference / Processing.org But it’s pretty much a black box. How can I receive ALL points that are shown by cu…

---

## [Getting enum inside a class constructor](https://discourse.processing.org/t/getting-enum-inside-a-class-constructor/38722)

<div class="topic-metadata">

**Author:** [@iudividnal](https://discourse.processing.org/u/iudividnal)\
**Replies:** 1\
**Last updated:** [September 12, 2022, 11:13am UTC](https://discourse.processing.org/t/getting-enum-inside-a-class-constructor/38722 "2022-09-12T11:13:01Z")

</div>

Hello, I ran into this problem while working on simple object check box / onoff button. I wanted to be able to determin the type(looks) of my button in the costructor by an enum for example: checkbox\_box, checkbox\_cir…

---

## [Processing halts program before it even runs, how do I stop this?](https://discourse.processing.org/t/processing-halts-program-before-it-even-runs-how-do-i-stop-this/38676)

<div class="topic-metadata">

**Author:** [@JellyJam](https://discourse.processing.org/u/JellyJam)\
**Replies:** 3\
**Last updated:** [September 9, 2022, 6:54am UTC](https://discourse.processing.org/t/processing-halts-program-before-it-even-runs-how-do-i-stop-this/38676 "2022-09-09T06:54:37Z")

</div>

There is an “error” in my code that processing thinks is an error but really isn’t. It refuses to run because of this. Here is my code. import java.io.\*; import java.lang.\*; import java.util.\*; ArrayList\<Object\> objec…

---

## [Brick Game Timer Question](https://discourse.processing.org/t/brick-game-timer-question/38605)

<div class="topic-metadata">

**Author:** [@newprogrammer12](https://discourse.processing.org/u/newprogrammer12)\
**Replies:** 9\
**Last updated:** [September 7, 2022, 2:17pm UTC](https://discourse.processing.org/t/brick-game-timer-question/38605 "2022-09-07T14:17:22Z")

</div>

I am trying to make a timer that keeps the “GAME OVER” text on the screen after a few seconds before the game resets. Right now I have a timer more or less copied of the processing forum and I can’t figure out how it wor…

---

## [Problem interpolation from 359 to 1°?](https://discourse.processing.org/t/problem-interpolation-from-359-to-1/38625)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 7\
**Last updated:** [September 4, 2022, 7:47pm UTC](https://discourse.processing.org/t/problem-interpolation-from-359-to-1/38625 "2022-09-04T19:47:17Z")

</div>

Hello, I want to sample a movement. You can sample a circular movement by pressing once the mouse. It works in one way when i go straight forward but not the if i give a modulo. The problem is in void draw here // …

---

## [String Text match and swap to SVG](https://discourse.processing.org/t/string-text-match-and-swap-to-svg/38584)

<div class="topic-metadata">

**Author:** [@brisquez](https://discourse.processing.org/u/brisquez)\
**Replies:** 0\
**Last updated:** [August 31, 2022, 2:33pm UTC](https://discourse.processing.org/t/string-text-match-and-swap-to-svg/38584 "2022-08-31T14:33:44Z")

</div>

Hello there Processing Foundation community. As with all my past (not a lot) programming adventures, firstly you need an idea and afterwards you gradually figure out how to code it. The idea is the following: Canvas …

---

## [P3D rotating sphere to follow mouse](https://discourse.processing.org/t/p3d-rotating-sphere-to-follow-mouse/38425)

<div class="topic-metadata">

**Author:** [@vegas](https://discourse.processing.org/u/vegas)\
**Replies:** 5\
**Last updated:** [September 3, 2022, 6:49pm UTC](https://discourse.processing.org/t/p3d-rotating-sphere-to-follow-mouse/38425 "2022-09-03T18:49:34Z")

</div>

Hi, Im using P3D and I’m trying to make a sphere rotate in the direction towards the mouses location. To clarify, the sphere should remain stationary at its x,y coordinates but rotate in relation to the mouses position…

---

## [Moving text around a circular path](https://discourse.processing.org/t/moving-text-around-a-circular-path/38622)

<div class="topic-metadata">

**Author:** [@scottmclaughlin](https://discourse.processing.org/u/scottmclaughlin)\
**Replies:** 2\
**Last updated:** [September 2, 2022, 9:50pm UTC](https://discourse.processing.org/t/moving-text-around-a-circular-path/38622 "2022-09-02T21:50:09Z")

</div>

Hi, Relative Processing noob here. I’m stuck trying to figure out how to make text move around a circle. I took Shiffman’s tutorial on Displaying text character by character and tried to add a fixed distance to push the…

---

## [How can I make lines disappear?](https://discourse.processing.org/t/how-can-i-make-lines-disappear/38607)

<div class="topic-metadata">

**Author:** [@TLM](https://discourse.processing.org/u/TLM)\
**Replies:** 11\
**Last updated:** [September 2, 2022, 2:55pm UTC](https://discourse.processing.org/t/how-can-i-make-lines-disappear/38607 "2022-09-02T14:55:13Z")

</div>

Hello, I am really really new to Processing and working on this exercise I just wanted to make the lines disappear (from left to right) when the last lines reaches the right-end of the screen (endX \> width). The final re…

---

## [Game Timer Question](https://discourse.processing.org/t/game-timer-question/38602)

<div class="topic-metadata">

**Author:** [@newprogrammer12](https://discourse.processing.org/u/newprogrammer12)\
**Replies:** 7\
**Last updated:** [September 2, 2022, 1:31pm UTC](https://discourse.processing.org/t/game-timer-question/38602 "2022-09-02T13:31:36Z")

</div>

I have created a game similar to pong and at the end I have made a “Game Over” text appear for 5 seconds before the game resets. The problem is, when the game resets, the timer seems to not work anymore. Any ideas on how…

---

## [Errors of type "this.g" is null when accessing pure java sketch that extends PApplet as a BufferedImage, output only on 100x100 pixels, other PGraphics objects like size() cannot be used](https://discourse.processing.org/t/errors-of-type-this-g-is-null-when-accessing-pure-java-sketch-that-extends-papplet-as-a-bufferedimage-output-only-on-100x100-pixels-other-pgraphics-objects-like-size-cannot-be-used/37260)

<div class="topic-metadata">

**Author:** [@istinn](https://discourse.processing.org/u/istinn)\
**Replies:** 10\
**Last updated:** [September 1, 2022, 1:20am UTC](https://discourse.processing.org/t/errors-of-type-this-g-is-null-when-accessing-pure-java-sketch-that-extends-papplet-as-a-bufferedimage-output-only-on-100x100-pixels-other-pgraphics-objects-like-size-cannot-be-used/37260 "2022-09-01T01:20:08Z")

</div>

I am trying to get the image output of processing sketches as a bufferedimage using pure java. The goal is to use the code output as a complex “texture” for shapes and paths outside processing. So far I have quite prom…

---

## [Don't understand what this code means (easing)](https://discourse.processing.org/t/dont-understand-what-this-code-means-easing/38588)

<div class="topic-metadata">

**Author:** [@EKEN](https://discourse.processing.org/u/EKEN)\
**Replies:** 4\
**Last updated:** [September 1, 2022, 11:08am UTC](https://discourse.processing.org/t/dont-understand-what-this-code-means-easing/38588 "2022-09-01T11:08:12Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hello I am really new to processing and programing in general and I wanted this smiley to follow my mouse, and then i googled how to do it and j…

---

## [Mouse and keyboard functions](https://discourse.processing.org/t/mouse-and-keyboard-functions/38594)

<div class="topic-metadata">

**Author:** [@reacttoimpact](https://discourse.processing.org/u/reacttoimpact)\
**Replies:** 1\
**Last updated:** [September 1, 2022, 6:27am UTC](https://discourse.processing.org/t/mouse-and-keyboard-functions/38594 "2022-09-01T06:27:00Z")

</div>

Hi, i don’t know if this is possible, but can you simulate mouse clicks, moves and keyboard types with processing? eg. a virtual keyboard/mouse controlled by the code? say the mouse pointer was on the screen(win 10 de…

---

## [Question About Game Idea (Breakout / Arkanoid)](https://discourse.processing.org/t/question-about-game-idea-breakout-arkanoid/38565)

<div class="topic-metadata">

**Author:** [@newprogrammer12](https://discourse.processing.org/u/newprogrammer12)\
**Replies:** 23\
**Last updated:** [August 31, 2022, 11:05pm UTC](https://discourse.processing.org/t/question-about-game-idea-breakout-arkanoid/38565 "2022-08-31T23:05:54Z")

</div>

How could you make a ball bounce on a rectangle on the bottom of the screen that is controlled by mouseX? I have only been programming a couple days and haven’t been able to find any help online. I’m trying to code a bri…

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

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