# Coding Questions

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

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

**Page:** 33

---

## [How to output UTF8 character on screen?](https://discourse.processing.org/t/how-to-output-utf8-character-on-screen/35944)

<div class="topic-metadata">

**Author:** [@bigboss97](https://discourse.processing.org/u/bigboss97)\
**Replies:** 2\
**Last updated:** [March 26, 2022, 6:33am UTC](https://discourse.processing.org/t/how-to-output-utf8-character-on-screen/35944 "2022-03-26T06:33:52Z")

</div>

I’m using Processing 3.5.4 on Windows 10. I managed to read a UTF8 file name and write it to a text file. But when I tried to use text() command to show it on screen I only saw some squares. Also, when I tried to put s…

---

## [Alternative to background()](https://discourse.processing.org/t/alternative-to-background/35923)

<div class="topic-metadata">

**Author:** [@Raul](https://discourse.processing.org/u/Raul)\
**Replies:** 0\
**Last updated:** [March 24, 2022, 2:11pm UTC](https://discourse.processing.org/t/alternative-to-background/35923 "2022-03-24T14:11:14Z")

</div>

Hi there, It would be long to explain, but I can’t use background() in my sketch (something related with P3D sketches whose windows are bigger than your display). So, I though this code would do the same as background(…

---

## [Access to a class variable](https://discourse.processing.org/t/access-to-a-class-variable/35883)

<div class="topic-metadata">

**Author:** [@Cthulhu](https://discourse.processing.org/u/Cthulhu)\
**Replies:** 1\
**Last updated:** [March 24, 2022, 1:23pm UTC](https://discourse.processing.org/t/access-to-a-class-variable/35883 "2022-03-24T13:23:10Z")

</div>

Hello, I want to acess to a class variable but I can´t. How do I do it? \</if (dist(xpos,ypos,balls.xpost,balls.ypost)\<=0){ } Class name is Ball

---

## [Can someone help by making my code into a SVG file?](https://discourse.processing.org/t/can-someone-help-by-making-my-code-into-a-svg-file/35874)

<div class="topic-metadata">

**Author:** [@C.J](https://discourse.processing.org/u/C.J)\
**Replies:** 1\
**Last updated:** [March 21, 2022, 10:18am UTC](https://discourse.processing.org/t/can-someone-help-by-making-my-code-into-a-svg-file/35874 "2022-03-21T10:18:20Z")

</div>

Hey! I’m a student CS at a Highschool in the Netherlands and I need some help. I’ve been making a code but I can’t seem to make it into a SVG file. Could someone help me with that? Here’s the code: //code made by C.J …

---

## [Audio Visualizer with multiple midi channels](https://discourse.processing.org/t/audio-visualizer-with-multiple-midi-channels/35898)

<div class="topic-metadata">

**Author:** [@Douix](https://discourse.processing.org/u/Douix)\
**Replies:** 0\
**Last updated:** [March 22, 2022, 6:55pm UTC](https://discourse.processing.org/t/audio-visualizer-with-multiple-midi-channels/35898 "2022-03-22T18:55:22Z")

</div>

Hi everyone, I’m a beginner with Processing and I lack the vocabulary of coding, but I challenged myself to create an audio viewer from .midi files that would give graphic renderings on different levels according to the…

---

## [How to export it to an SVG file, can someone help?](https://discourse.processing.org/t/how-to-export-it-to-an-svg-file-can-someone-help/35795)

<div class="topic-metadata">

**Author:** [@AvdMaker](https://discourse.processing.org/u/AvdMaker)\
**Replies:** 2\
**Last updated:** [March 21, 2022, 8:53am UTC](https://discourse.processing.org/t/how-to-export-it-to-an-svg-file-can-someone-help/35795 "2022-03-21T08:53:33Z")

</div>

Hi all, I am a student CS at a Highschool in the Netherlands and I need some help;This is what it’s supposed to be but I can’t find the original code anymore I’ve been trying to export this processing code from ‘proces…

---

## [Weird bug with Processing lights](https://discourse.processing.org/t/weird-bug-with-processing-lights/35803)

<div class="topic-metadata">

**Author:** [@SNICKRS](https://discourse.processing.org/u/SNICKRS)\
**Replies:** 0\
**Last updated:** [March 17, 2022, 11:20pm UTC](https://discourse.processing.org/t/weird-bug-with-processing-lights/35803 "2022-03-17T23:20:17Z")

</div>

I’ve been doing some experiments with marching cubes lately, but it was really hard to look at the image as 3d because there were no shadows or lighting. I tried using processing’s built in lights, but I got this weird i…

---

## [Rollover not working when applied in an array of circles](https://discourse.processing.org/t/rollover-not-working-when-applied-in-an-array-of-circles/35840)

<div class="topic-metadata">

**Author:** [@Erif](https://discourse.processing.org/u/Erif)\
**Replies:** 2\
**Last updated:** [March 19, 2022, 4:13pm UTC](https://discourse.processing.org/t/rollover-not-working-when-applied-in-an-array-of-circles/35840 "2022-03-19T16:13:51Z")

</div>

Hi all, coding with Processing for just over a month only so lots of things to learn :sweat\_smile: I’ve created a simple rollover so when the mouse is within the circle it changes color. It works… however when adjusting…

---

## [Automaticaly rerun and save images](https://discourse.processing.org/t/automaticaly-rerun-and-save-images/35786)

<div class="topic-metadata">

**Author:** [@tshaqscc](https://discourse.processing.org/u/tshaqscc)\
**Replies:** 4\
**Last updated:** [March 17, 2022, 3:07pm UTC](https://discourse.processing.org/t/automaticaly-rerun-and-save-images/35786 "2022-03-17T15:07:45Z")

</div>

I have this code that generates image. I want to generate 1000 variations of this image. I added this to save images \<saveFrame(“image\_####.png”);/\> but it saved just one time, is there a way to make this process autom…

---

## [Delay an event by 200ms. Why can I shift one and not several?](https://discourse.processing.org/t/delay-an-event-by-200ms-why-can-i-shift-one-and-not-several/35777)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 0\
**Last updated:** [March 16, 2022, 12:04pm UTC](https://discourse.processing.org/t/delay-an-event-by-200ms-why-can-i-shift-one-and-not-several/35777 "2022-03-16T12:04:45Z")

</div>

Good morning all! For my artistic installation, I would like from the movement of a point rotating at constant speed, to be able to make 9 other points follow the first with temporal and spatial shifts. Here is the lin…

---

## [Text on top of 3D box](https://discourse.processing.org/t/text-on-top-of-3d-box/35757)

<div class="topic-metadata">

**Author:** [@Divitiacus](https://discourse.processing.org/u/Divitiacus)\
**Replies:** 3\
**Last updated:** [March 15, 2022, 12:53pm UTC](https://discourse.processing.org/t/text-on-top-of-3d-box/35757 "2022-03-15T12:53:38Z")

</div>

I have a 3D box and I would like to show data on top of the picture, which are always on front and are not moving, when I move the box. I found, that hint can be used to disable depth test for that but that just gives t…

---

## [Need help for this task](https://discourse.processing.org/t/need-help-for-this-task/20771)

<div class="topic-metadata">

**Author:** [@jones](https://discourse.processing.org/u/jones)\
**Replies:** 2\
**Last updated:** [May 12, 2020, 10:22am UTC](https://discourse.processing.org/t/need-help-for-this-task/20771 "2020-05-12T10:22:11Z")

</div>

int cellSize = 30; int radius = cellSize/2; int ellipseSize = cellSize; int ellipseSizeMini = 5; int gap = 0; void setup() { size (300, 300); background(255); noStroke(); for (int j=0; j\<height; j=j+cellS…

---

## [How to print text to console?](https://discourse.processing.org/t/how-to-print-text-to-console/35725)

<div class="topic-metadata">

**Author:** [@bigboss97](https://discourse.processing.org/u/bigboss97)\
**Replies:** 1\
**Last updated:** [March 14, 2022, 6:56am UTC](https://discourse.processing.org/t/how-to-print-text-to-console/35725 "2022-03-14T06:56:06Z")

</div>

I’m using Processing 3.5.4 (Windows 10) and I want to write a command line app with arguments and text output to the console. I found this: handling command line arguments in a sketch I exported the code to Windows exe…

---

## [Temporizador para texto después de una acción](https://discourse.processing.org/t/temporizador-para-texto-despues-de-una-accion/35627)

<div class="topic-metadata">

**Author:** [@AdriaCornell](https://discourse.processing.org/u/AdriaCornell)\
**Replies:** 1\
**Last updated:** [March 10, 2022, 9:02am UTC](https://discourse.processing.org/t/temporizador-para-texto-despues-de-una-accion/35627 "2022-03-10T09:02:24Z")

</div>

Buenas! Para un trabajo tengo que crear el típico juego de Pong. Cada vez que la pelota llega al final se suma un punto y al llegar a 3 puntos se acaba la partida. Pero antes intento hacer aparecer durante unos segundos…

---

## [Updating Number of Files While Sketch Runs](https://discourse.processing.org/t/updating-number-of-files-while-sketch-runs/35615)

<div class="topic-metadata">

**Author:** [@BruceTheWayneJohnson](https://discourse.processing.org/u/BruceTheWayneJohnson)\
**Replies:** 1\
**Last updated:** [March 9, 2022, 4:24pm UTC](https://discourse.processing.org/t/updating-number-of-files-while-sketch-runs/35615 "2022-03-09T16:24:08Z")

</div>

Hello! I am working on a way to see how many image files are in the sketch folder. My goal is to load the folder with images with an API and as the sketch runs, check to see if new images have been added. I can imagine…

---

## [Grab sketch/window name from within sketch for copy-and-paste screenshot method?](https://discourse.processing.org/t/grab-sketch-window-name-from-within-sketch-for-copy-and-paste-screenshot-method/35629)

<div class="topic-metadata">

**Author:** [@squig](https://discourse.processing.org/u/squig)\
**Replies:** 2\
**Last updated:** [March 9, 2022, 4:10pm UTC](https://discourse.processing.org/t/grab-sketch-window-name-from-within-sketch-for-copy-and-paste-screenshot-method/35629 "2022-03-09T16:10:32Z")

</div>

I make a lot of short sketches from scratch. I’m attempting to write a short bit of code that I can copy and paste into any sketch so I can get full resolution screenshots with as little effort as possible. Currently I h…

---

## [Does anyone know how to create this gradient looked design in Processing?](https://discourse.processing.org/t/does-anyone-know-how-to-create-this-gradient-looked-design-in-processing/35576)

<div class="topic-metadata">

**Author:** [@bringmeflowers](https://discourse.processing.org/u/bringmeflowers)\
**Replies:** 1\
**Last updated:** [March 9, 2022, 8:29am UTC](https://discourse.processing.org/t/does-anyone-know-how-to-create-this-gradient-looked-design-in-processing/35576 "2022-03-09T08:29:36Z")

</div>

---

## [I am trying to input a couple of variables at the sketch startup](https://discourse.processing.org/t/i-am-trying-to-input-a-couple-of-variables-at-the-sketch-startup/35558)

<div class="topic-metadata">

**Author:** [@laptophead](https://discourse.processing.org/u/laptophead)\
**Replies:** 3\
**Last updated:** [March 9, 2022, 3:29am UTC](https://discourse.processing.org/t/i-am-trying-to-input-a-couple-of-variables-at-the-sketch-startup/35558 "2022-03-09T03:29:21Z")

</div>

Is there an example out there? Looked in the library… found nothing… So when the sketch starts, the user is prompted to input Month and Year in 2 different boxes. The values would have to be restricted to 1-12 and 20…

---

## [Trying To Make A Circle Move Back and Forth On A Horizontal Line](https://discourse.processing.org/t/trying-to-make-a-circle-move-back-and-forth-on-a-horizontal-line/35546)

<div class="topic-metadata">

**Author:** [@0\_0](https://discourse.processing.org/u/0_0)\
**Replies:** 1\
**Last updated:** [March 8, 2022, 9:37pm UTC](https://discourse.processing.org/t/trying-to-make-a-circle-move-back-and-forth-on-a-horizontal-line/35546 "2022-03-08T21:37:14Z")

</div>

//Constants final int X\_LEFT = 100; //The left end of the horizontal line. final int X\_RIGHT = 400; //The right end of the horizontal line. final int Y = 100; //The y position of the line and circle. final int BALL\_DIAM…

---

## [URL error (MalformedURLException)](https://discourse.processing.org/t/url-error-malformedurlexception/35585)

<div class="topic-metadata">

**Author:** [@gidiav](https://discourse.processing.org/u/gidiav)\
**Replies:** 2\
**Last updated:** [March 7, 2022, 10:20pm UTC](https://discourse.processing.org/t/url-error-malformedurlexception/35585 "2022-03-07T22:20:32Z")

</div>

Hello, I am new to Processing and also to Java (though I’ve coded a lot in other languages). I am trying to read some text from a web page for my sketch, so I tried to follow the instructions in this link, and do somet…

---

## [How to get bits from jpg image](https://discourse.processing.org/t/how-to-get-bits-from-jpg-image/35574)

<div class="topic-metadata">

**Author:** [@0ldBergamot](https://discourse.processing.org/u/0ldBergamot)\
**Replies:** 4\
**Last updated:** [March 6, 2022, 11:19pm UTC](https://discourse.processing.org/t/how-to-get-bits-from-jpg-image/35574 "2022-03-06T23:19:03Z")

</div>

Context : I coded an image generator. You choose a String as input, every char is converted into its binary ascii value and each bit represents a pixel (0 = white, 1 = black). The result is save as “image.jpg” Question…

---

## [How to save text to clipboard?](https://discourse.processing.org/t/how-to-save-text-to-clipboard/34504)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 2\
**Last updated:** [March 6, 2022, 10:12am UTC](https://discourse.processing.org/t/how-to-save-text-to-clipboard/34504 "2022-03-06T10:12:25Z")

</div>

Hi, I want to save a String of text to clipboard. Is it possible to do it while the program is running in the background? Thank you.

---

## [Generating 8k images in P3D](https://discourse.processing.org/t/generating-8k-images-in-p3d/35545)

<div class="topic-metadata">

**Author:** [@Raul](https://discourse.processing.org/u/Raul)\
**Replies:** 5\
**Last updated:** [March 6, 2022, 1:26am UTC](https://discourse.processing.org/t/generating-8k-images-in-p3d/35545 "2022-03-06T01:26:10Z")

</div>

Hi! I have a program that generates images, displays them (in a 3D space) and saves them. There is no problem if the images’ resolution is up to 4k, since my screen is 4k. But I can’t do the same with, for example, 8k …

---

## [Trying to slow down ellipses in a small space](https://discourse.processing.org/t/trying-to-slow-down-ellipses-in-a-small-space/35562)

<div class="topic-metadata">

**Author:** [@Sevenylime](https://discourse.processing.org/u/Sevenylime)\
**Replies:** 4\
**Last updated:** [March 5, 2022, 12:21pm UTC](https://discourse.processing.org/t/trying-to-slow-down-ellipses-in-a-small-space/35562 "2022-03-05T12:21:59Z")

</div>

Hello everyone! I’m trying to make it so the “fireflies” in my code, while in the cup, move slower. So far, the fireflies bounce off the walls, and once the player presses ‘g’, a cup is grabbed, and if the cup makes co…

---

## [How Can I Make A Circle Move Back And Forth Using Conditionals, And Freezing When the Mouse is Pressed?](https://discourse.processing.org/t/how-can-i-make-a-circle-move-back-and-forth-using-conditionals-and-freezing-when-the-mouse-is-pressed/35563)

<div class="topic-metadata">

**Author:** [@0\_0](https://discourse.processing.org/u/0_0)\
**Replies:** 2\
**Last updated:** [March 5, 2022, 2:10am UTC](https://discourse.processing.org/t/how-can-i-make-a-circle-move-back-and-forth-using-conditionals-and-freezing-when-the-mouse-is-pressed/35563 "2022-03-05T02:10:58Z")

</div>

I am trying to make a circle move back and forth on a line in processing, however I can’t seem to get the coding right to where the circle returns back after moving to the right on the line. I’m new to coding and I’ve tr…

---

## [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…

---

## [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…

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

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