# Coding Questions

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

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

**Page:** 150

---

## [Text() on Mac causes program to pause](https://discourse.processing.org/t/text-on-mac-causes-program-to-pause/8353)

<div class="topic-metadata">

**Author:** [@sgolanka](https://discourse.processing.org/u/sgolanka)\
**Replies:** 3\
**Last updated:** [February 26, 2019, 6:36pm UTC](https://discourse.processing.org/t/text-on-mac-causes-program-to-pause/8353 "2019-02-26T18:36:00Z")

</div>

This problem occurs on Apple computers, but not not on Windows. The code below comes from a simple game. When the condition is true, the program (on a Mac), stops for a few seconds, and then displays “You Lose.” When…

---

## [Proper wraparound](https://discourse.processing.org/t/proper-wraparound/8702)

<div class="topic-metadata">

**Author:** [@LordCacops](https://discourse.processing.org/u/LordCacops)\
**Replies:** 2\
**Last updated:** [February 26, 2019, 5:11pm UTC](https://discourse.processing.org/t/proper-wraparound/8702 "2019-02-26T17:11:26Z")

</div>

Hey! I have these colored grids, 192 pixels wide, 120 pixels tall, and they move. I want them to wraparound the horizontal dimension so that when they start going out one side, right away they start popping out of the o…

---

## [Draw this Polygon using loops?](https://discourse.processing.org/t/draw-this-polygon-using-loops/1588)

<div class="topic-metadata">

**Author:** [@nerdboybi](https://discourse.processing.org/u/nerdboybi)\
**Replies:** 18\
**Last updated:** [February 26, 2019, 3:50pm UTC](https://discourse.processing.org/t/draw-this-polygon-using-loops/1588 "2019-02-26T15:50:35Z")

</div>

Its from a textbook and I just need a solution so I can get an idea on how to use loops

---

## [Animation for a quadrilateral polygon assistance](https://discourse.processing.org/t/animation-for-a-quadrilateral-polygon-assistance/8679)

<div class="topic-metadata">

**Author:** [@NationalRex22](https://discourse.processing.org/u/NationalRex22)\
**Replies:** 3\
**Last updated:** [February 25, 2019, 11:18pm UTC](https://discourse.processing.org/t/animation-for-a-quadrilateral-polygon-assistance/8679 "2019-02-25T23:18:05Z")

</div>

Hello, I’m interested in developing an animated loop for a quadrilateral polygon that slowly moves down vertically from its initial position to the exact position of a quadrilateral polygon of the same size. Finally, th…

---

## [Draw from text file not working as expected](https://discourse.processing.org/t/draw-from-text-file-not-working-as-expected/8498)

<div class="topic-metadata">

**Author:** [@socraticbot](https://discourse.processing.org/u/socraticbot)\
**Replies:** 21\
**Last updated:** [February 25, 2019, 4:21pm UTC](https://discourse.processing.org/t/draw-from-text-file-not-working-as-expected/8498 "2019-02-25T16:21:52Z")

</div>

Hi all, I have a script which finds all the black pixels in an image along a spiral path and saves it to a text file. float r = 0; float theta = 0; PImage input; String\[\] output; void setup() { size(300, 300); bac…

---

## [keyPresssed not returning proper value](https://discourse.processing.org/t/keypresssed-not-returning-proper-value/8701)

<div class="topic-metadata">

**Author:** [@dragonheart0001](https://discourse.processing.org/u/dragonheart0001)\
**Replies:** 11\
**Last updated:** [February 25, 2019, 5:24am UTC](https://discourse.processing.org/t/keypresssed-not-returning-proper-value/8701 "2019-02-25T05:24:05Z")

</div>

I am trying to create a basic input interface for project I am working on and am running into a bug where the keyPressed variable always returns false. Here’s the basic idea of the code. void setup() { int startTime =…

---

## [Array Sorting visually](https://discourse.processing.org/t/array-sorting-visually/803)

<div class="topic-metadata">

**Author:** [@bertin](https://discourse.processing.org/u/bertin)\
**Replies:** 5\
**Last updated:** [June 10, 2018, 2:19am UTC](https://discourse.processing.org/t/array-sorting-visually/803 "2018-06-10T02:19:24Z")

</div>

Hi everyone! This is my first topic, hoping not to do something wrong. I was trying to develop a simple sketch that shows in real time the sorting algorithms of an array of integers, through simple vertical lines which …

---

## [Ball bouncing on a grid](https://discourse.processing.org/t/ball-bouncing-on-a-grid/8688)

<div class="topic-metadata">

**Author:** [@pritesh](https://discourse.processing.org/u/pritesh)\
**Replies:** 9\
**Last updated:** [February 24, 2019, 7:06pm UTC](https://discourse.processing.org/t/ball-bouncing-on-a-grid/8688 "2019-02-24T19:06:24Z")

</div>

Hello, I recently started learning processing and I have been trying to write a code in which a ball is bouncing off the four corners of a grid. Can someone plz help me with this? float x = 150; float y = 150; void…

---

## [How to use characters (and assign tasks to these characters) from a .txt file in Processing](https://discourse.processing.org/t/how-to-use-characters-and-assign-tasks-to-these-characters-from-a-txt-file-in-processing/8604)

<div class="topic-metadata">

**Author:** [@anon98404100](https://discourse.processing.org/u/anon98404100)\
**Replies:** 14\
**Last updated:** [February 24, 2019, 5:03pm UTC](https://discourse.processing.org/t/how-to-use-characters-and-assign-tasks-to-these-characters-from-a-txt-file-in-processing/8604 "2019-02-24T17:03:25Z")

</div>

We have a project called “generative art”. Our goal is to make a program, and that program creates something totally random that works as a form of art. My idea was the following, and I wanted to base it around the sub…

---

## [Save image by input name as jpg or to absolute path](https://discourse.processing.org/t/save-image-by-input-name-as-jpg-or-to-absolute-path/8674)

<div class="topic-metadata">

**Author:** [@angelman](https://discourse.processing.org/u/angelman)\
**Replies:** 6\
**Last updated:** [February 24, 2019, 4:32am UTC](https://discourse.processing.org/t/save-image-by-input-name-as-jpg-or-to-absolute-path/8674 "2019-02-24T04:32:18Z")

</div>

I am inputting a list of names and output images made as result of list of names. This works fine . It will out put them as tif . But how can I get them output as jpg. and also to a folder in the sketch folder rather th…

---

## [Is it possible to "move" your coordinate by moving the mouse?](https://discourse.processing.org/t/is-it-possible-to-move-your-coordinate-by-moving-the-mouse/8574)

<div class="topic-metadata">

**Author:** [@LaLiia](https://discourse.processing.org/u/LaLiia)\
**Replies:** 4\
**Last updated:** [February 23, 2019, 8:45pm UTC](https://discourse.processing.org/t/is-it-possible-to-move-your-coordinate-by-moving-the-mouse/8574 "2019-02-23T20:45:10Z")

</div>

Hello, is it possible to “move” a coordinate (vector point) through the movement of the mouse? So that the effect is a form, for example a circle, to bend? Similar to the “Liquify” filter in Photoshop. I would be very …

---

## [Loosing lives really fast when Collision happens](https://discourse.processing.org/t/loosing-lives-really-fast-when-collision-happens/8627)

<div class="topic-metadata">

**Author:** [@vinipineschi](https://discourse.processing.org/u/vinipineschi)\
**Replies:** 8\
**Last updated:** [February 23, 2019, 7:20pm UTC](https://discourse.processing.org/t/loosing-lives-really-fast-when-collision-happens/8627 "2019-02-23T19:20:36Z")

</div>

Hi, I was trying to create a simple collision code for my Asteroid game. Basically I managed to create the collision between the objects (Spaceship and Asteroid), however when I created this if condition bellow: if (xp…

---

## [How to draw a black and white cookie?](https://discourse.processing.org/t/how-to-draw-a-black-and-white-cookie/8634)

<div class="topic-metadata">

**Author:** [@sorenkirk](https://discourse.processing.org/u/sorenkirk)\
**Replies:** 4\
**Last updated:** [February 23, 2019, 7:14pm UTC](https://discourse.processing.org/t/how-to-draw-a-black-and-white-cookie/8634 "2019-02-23T19:14:54Z")

</div>

I am basically trying to draw something like this: I can draw a half circle and a larger surrounding circle, but I am having trouble simulating the uneven-ness of one of the half circles and making the shape look beve…

---

## [Trying to get interaction with two objects](https://discourse.processing.org/t/trying-to-get-interaction-with-two-objects/8666)

<div class="topic-metadata">

**Author:** [@tkozeletz](https://discourse.processing.org/u/tkozeletz)\
**Replies:** 1\
**Last updated:** [February 23, 2019, 5:32pm UTC](https://discourse.processing.org/t/trying-to-get-interaction-with-two-objects/8666 "2019-02-23T17:32:33Z")

</div>

I am getting so confused by the code that I have created. I am trying to make it so that when the laser hits the alien, the alien would disappear. To make the laser work, you have to press and hold the mouse. Please help…

---

## [Making a long text appearing and disappearing](https://discourse.processing.org/t/making-a-long-text-appearing-and-disappearing/8658)

<div class="topic-metadata">

**Author:** [@videopirate](https://discourse.processing.org/u/videopirate)\
**Replies:** 11\
**Last updated:** [February 23, 2019, 4:19pm UTC](https://discourse.processing.org/t/making-a-long-text-appearing-and-disappearing/8658 "2019-02-23T16:19:22Z")

</div>

Hi everyone, I am new here. hi hi! I am a visual artist and I project text (poetry) to an audience. I would love some help in making a long text appearing and disappearing. At the moment I have only two words. In my c…

---

## [Draw circle shape with vertex](https://discourse.processing.org/t/draw-circle-shape-with-vertex/8558)

<div class="topic-metadata">

**Author:** [@Stanlepunk](https://discourse.processing.org/u/Stanlepunk)\
**Replies:** 4\
**Last updated:** [February 22, 2019, 11:05am UTC](https://discourse.processing.org/t/draw-circle-shape-with-vertex/8558 "2019-02-22T11:05:11Z")

</div>

I try to draw a circle with vertex, but my result is very dirty. I read a few article about that but I don’t find a solution ready to eat, so I coded something like I think possible to work but…so if anybody have sugges…

---

## [ArrayList of ellipses only draws the last ellipses to canvas](https://discourse.processing.org/t/arraylist-of-ellipses-only-draws-the-last-ellipses-to-canvas/8618)

<div class="topic-metadata">

**Author:** [@bandit0311](https://discourse.processing.org/u/bandit0311)\
**Replies:** 1\
**Last updated:** [February 22, 2019, 9:36am UTC](https://discourse.processing.org/t/arraylist-of-ellipses-only-draws-the-last-ellipses-to-canvas/8618 "2019-02-22T09:36:39Z")

</div>

Im attempting to make a parallel coordinates plot. I have so far created the vertical axis for the graph and I have a class that each individual line is object of. I have all my line objects in an ArrayList container an…

---

## [Floating Above Paint](https://discourse.processing.org/t/floating-above-paint/8601)

<div class="topic-metadata">

**Author:** [@stevenoneilsteven](https://discourse.processing.org/u/stevenoneilsteven)\
**Replies:** 1\
**Last updated:** [February 21, 2019, 7:50pm UTC](https://discourse.processing.org/t/floating-above-paint/8601 "2019-02-21T19:50:48Z")

</div>

Hi all, How do you arrange text to float above everything else on the canvas. Even above the mouse painting. S

---

## [Robot Class - Check my Code Please](https://discourse.processing.org/t/robot-class-check-my-code-please/8441)

<div class="topic-metadata">

**Author:** [@Ismaiel\_Ahmed](https://discourse.processing.org/u/Ismaiel_Ahmed)\
**Replies:** 5\
**Last updated:** [February 21, 2019, 6:20pm UTC](https://discourse.processing.org/t/robot-class-check-my-code-please/8441 "2019-02-21T18:20:54Z")

</div>

Hello Geniuses, This code is for a Differential Drive Mobile Robot Class. The robot should change each of its left and right wheel velocity from \[-1.0 to 1.0\] . // I used nested for loop for this. In each specific ve…

---

## [Problem Create a Table -](https://discourse.processing.org/t/problem-create-a-table/8586)

<div class="topic-metadata">

**Author:** [@Ismaiel\_Ahmed](https://discourse.processing.org/u/Ismaiel_Ahmed)\
**Replies:** 2\
**Last updated:** [February 21, 2019, 3:29pm UTC](https://discourse.processing.org/t/problem-create-a-table/8586 "2019-02-21T15:29:18Z")

</div>

Hello Geniuses, I’m trying to save data in a table inside a class Table results = new Table(); results.addColumn("Diameter"); results.addColumn("Left Speed"); results.addColumn("Right Speed"); When i run the program i…

---

## [Open the videos on Processing by serials - help needed](https://discourse.processing.org/t/open-the-videos-on-processing-by-serials-help-needed/8595)

<div class="topic-metadata">

**Author:** [@jeniffer](https://discourse.processing.org/u/jeniffer)\
**Replies:** 0\
**Last updated:** [February 21, 2019, 9:32am UTC](https://discourse.processing.org/t/open-the-videos-on-processing-by-serials-help-needed/8595 "2019-02-21T09:32:04Z")

</div>

Hello, I’m starter of Processing and Arduino, so sorry for it could be a very beginner’s question. I tried to googling it and finding some similar cases like me connecting the serial and video playing, but it was hard t…

---

## [How to draw and rotate at the same time?](https://discourse.processing.org/t/how-to-draw-and-rotate-at-the-same-time/8539)

<div class="topic-metadata">

**Author:** [@ricaroca](https://discourse.processing.org/u/ricaroca)\
**Replies:** 3\
**Last updated:** [February 21, 2019, 1:35pm UTC](https://discourse.processing.org/t/how-to-draw-and-rotate-at-the-same-time/8539 "2019-02-21T13:35:02Z")

</div>

hi! I can’t find a way to draw a shape, and I mean drawing it frame by frame, no just making it appear while rotating it. so, I’m drawing a circle with points, I can do it, but without using background(0) in void draw(…

---

## [How can I use a "for" loop to redraw something multiple times?](https://discourse.processing.org/t/how-can-i-use-a-for-loop-to-redraw-something-multiple-times/8585)

<div class="topic-metadata">

**Author:** [@bh1234](https://discourse.processing.org/u/bh1234)\
**Replies:** 4\
**Last updated:** [February 21, 2019, 7:27am UTC](https://discourse.processing.org/t/how-can-i-use-a-for-loop-to-redraw-something-multiple-times/8585 "2019-02-21T07:27:39Z")

</div>

So, I’m taking this CSS 101 class and our professor has given us some code that draws an owl: void setup ( ) { size(600,600); background(200); smooth( ); frameRate(30); } void draw ( ) { owl(35,100); } void owl…

---

## [Filling Dinamyc Arrays\[\]\[\]](https://discourse.processing.org/t/filling-dinamyc-arrays/7049)

<div class="topic-metadata">

**Author:** [@vjjv](https://discourse.processing.org/u/vjjv)\
**Replies:** 4\
**Last updated:** [January 8, 2019, 2:38pm UTC](https://discourse.processing.org/t/filling-dinamyc-arrays/7049 "2019-01-08T14:38:06Z")

</div>

hello! i need some help to fill a two dimensional array in a dinamyc way. I want to add a new Cols in a JTable when and object is created, and fill the rows with the values of the object. for that i want to use a two dim…

---

## [Different shade of color when using opacity](https://discourse.processing.org/t/different-shade-of-color-when-using-opacity/8476)

<div class="topic-metadata">

**Author:** [@gytis585](https://discourse.processing.org/u/gytis585)\
**Replies:** 1\
**Last updated:** [February 20, 2019, 7:53pm UTC](https://discourse.processing.org/t/different-shade-of-color-when-using-opacity/8476 "2019-02-20T19:53:57Z")

</div>

Hello, I am experiencing a weird error regarding opacity. I am rendering a 3D shape made out of two circles. Each of the circle is made out of several pieces. Every second is flipped. The ones that are fliped get a dar…

---

## [Semicircle drawing producing artifacts](https://discourse.processing.org/t/semicircle-drawing-producing-artifacts/8444)

<div class="topic-metadata">

**Author:** [@RagingLightning](https://discourse.processing.org/u/RagingLightning)\
**Replies:** 8\
**Last updated:** [February 20, 2019, 7:41pm UTC](https://discourse.processing.org/t/semicircle-drawing-producing-artifacts/8444 "2019-02-20T19:41:00Z")

</div>

Hello! I am trying to draw a semisphere using verticies, but for some reason I get weird artifacts, when two or more “rings” are drawn behind each other. I already tried to use illumination (with a point light at 0,0,0 …

---

## [How to calculate the shades of a color?](https://discourse.processing.org/t/how-to-calculate-the-shades-of-a-color/8426)

<div class="topic-metadata">

**Author:** [@bobw](https://discourse.processing.org/u/bobw)\
**Replies:** 3\
**Last updated:** [February 20, 2019, 7:34pm UTC](https://discourse.processing.org/t/how-to-calculate-the-shades-of-a-color/8426 "2019-02-20T19:34:04Z")

</div>

Is there a way to calculate the shades of a color? I’d like to assign evenly spaced fill colors to an arbitrary and ever changing number of objects based on their size. Assign smaller objects darker shades and larger o…

---

## [Rate in a graph](https://discourse.processing.org/t/rate-in-a-graph/337)

<div class="topic-metadata">

**Author:** [@netphysicist](https://discourse.processing.org/u/netphysicist)\
**Replies:** 17\
**Last updated:** [February 20, 2019, 2:41pm UTC](https://discourse.processing.org/t/rate-in-a-graph/337 "2019-02-20T14:41:39Z")

</div>

Hello, i have made a programm that loads csv files and make plots in processing IDE…I would like to know how can i calculate the rate of the results with code in java for processing i3.t The plots are sinusoidal so i w…

---

## [Sketch to Webpage](https://discourse.processing.org/t/sketch-to-webpage/8543)

<div class="topic-metadata">

**Author:** [@stevenoneilsteven](https://discourse.processing.org/u/stevenoneilsteven)\
**Replies:** 4\
**Last updated:** [February 20, 2019, 12:53pm UTC](https://discourse.processing.org/t/sketch-to-webpage/8543 "2019-02-20T12:53:47Z")

</div>

Any help on how I can turn this Sketch in to an interactive webpage? void setup () { size(1920,1080); background(0); } void draw () { if (mousePressed) { noStroke(); fill(0); ellipse(mouseX, mouseY, 460, 460); …

---

## [\[SOLVED\] Interface vs Enum vs any other better solution?](https://discourse.processing.org/t/solved-interface-vs-enum-vs-any-other-better-solution/7658)

<div class="topic-metadata">

**Author:** [@Ov3rM1nD](https://discourse.processing.org/u/Ov3rM1nD)\
**Replies:** 5\
**Last updated:** [February 20, 2019, 3:34am UTC](https://discourse.processing.org/t/solved-interface-vs-enum-vs-any-other-better-solution/7658 "2019-02-20T03:34:38Z")

</div>

Hello folks! I was a few days ago reading random topics here on the site, and I came across this, where I felt interested to create a .jar file with a compilation of colors to use in my sketches. My question is, I have …

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

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