# Coding Questions

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

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

**Page:** 111

---

## [Why Ain't my Code working?](https://discourse.processing.org/t/why-aint-my-code-working/16800)

<div class="topic-metadata">

**Author:** [@ctrembla](https://discourse.processing.org/u/ctrembla)\
**Replies:** 2\
**Last updated:** [January 27, 2020, 2:05pm UTC](https://discourse.processing.org/t/why-aint-my-code-working/16800 "2020-01-27T14:05:05Z")

</div>

I’m trying to make a card game, but when I try to get the player’s hand in the correct spot. All 5 cards go to the last spot instead of staying where they suppose to. here setup Table enemyT; TableRow tr; int s = 75; A…

---

## [Creating "boundaries" for my ball using max and min](https://discourse.processing.org/t/creating-boundaries-for-my-ball-using-max-and-min/17367)

<div class="topic-metadata">

**Author:** [@AxFan](https://discourse.processing.org/u/AxFan)\
**Replies:** 3\
**Last updated:** [January 27, 2020, 6:49am UTC](https://discourse.processing.org/t/creating-boundaries-for-my-ball-using-max-and-min/17367 "2020-01-27T06:49:52Z")

</div>

So I was supposed to create this joystick like program in one of my questions but Im not sure how I can use functions max and min so the ball doesnt fly past the canvas when Im controlling it with my mouse. float lineX …

---

## [Drawing scaling based on position in window size?](https://discourse.processing.org/t/drawing-scaling-based-on-position-in-window-size/17303)

<div class="topic-metadata">

**Author:** [@AxFan](https://discourse.processing.org/u/AxFan)\
**Replies:** 1\
**Last updated:** [January 27, 2020, 6:43am UTC](https://discourse.processing.org/t/drawing-scaling-based-on-position-in-window-size/17303 "2020-01-27T06:43:43Z")

</div>

Hey guys so I want to know how a ball or drawing can be scaled as it moves from one area to the other? Say I have a ball and its being controlled by my mouse, at the bottom left corner its big, but as I move it towards t…

---

## [Draw lines through an array with a timer](https://discourse.processing.org/t/draw-lines-through-an-array-with-a-timer/17349)

<div class="topic-metadata">

**Author:** [@Ona](https://discourse.processing.org/u/Ona)\
**Replies:** 1\
**Last updated:** [January 26, 2020, 3:03pm UTC](https://discourse.processing.org/t/draw-lines-through-an-array-with-a-timer/17349 "2020-01-26T15:03:34Z")

</div>

hi, I’m writing a code for a project. At the moment my program can get lines out of a video image and display them. All the lines are displayed at once. Now I want every line to be displayed separately. So every 10 or 20…

---

## [How to place Transparent glass over human body..idea request](https://discourse.processing.org/t/how-to-place-transparent-glass-over-human-body-idea-request/17273)

<div class="topic-metadata">

**Author:** [@adaptinnovative](https://discourse.processing.org/u/adaptinnovative)\
**Replies:** 8\
**Last updated:** [January 26, 2020, 1:25pm UTC](https://discourse.processing.org/t/how-to-place-transparent-glass-over-human-body-idea-request/17273 "2020-01-26T13:25:54Z")

</div>

Any idea how to get this done in processing. I can load the human figure as an .obj file but to get the transparent slab of glass to be Frontal Sagittal Transverse As seen in the image. Any ideas?

---

## [SVG shape distortion when importing back in processing](https://discourse.processing.org/t/svg-shape-distortion-when-importing-back-in-processing/17322)

<div class="topic-metadata">

**Author:** [@Ruchi](https://discourse.processing.org/u/Ruchi)\
**Replies:** 4\
**Last updated:** [January 26, 2020, 1:21pm UTC](https://discourse.processing.org/t/svg-shape-distortion-when-importing-back-in-processing/17322 "2020-01-26T13:21:12Z")

</div>

// Shape import processing.svg.\*; float lengthD; float ellipseR; float rhombusW; float rhombusH; void setup() { size(800, 800); beginRecord(SVG, "SHAPE.svg"); smooth(); noLoop(); lengthD = sqrt(pow(w…

---

## [Reading Youtube API?](https://discourse.processing.org/t/reading-youtube-api/17331)

<div class="topic-metadata">

**Author:** [@iobotic](https://discourse.processing.org/u/iobotic)\
**Replies:** 2\
**Last updated:** [January 25, 2020, 11:40pm UTC](https://discourse.processing.org/t/reading-youtube-api/17331 "2020-01-25T23:40:26Z")

</div>

Hello friends, someone can you provide some example about how can I read the Youtube API to get the subscribers number? Thanks :hugs:

---

## [Arranging an array of objects in a grid](https://discourse.processing.org/t/arranging-an-array-of-objects-in-a-grid/16969)

<div class="topic-metadata">

**Author:** [@debxyz](https://discourse.processing.org/u/debxyz)\
**Replies:** 34\
**Last updated:** [January 25, 2020, 8:23pm UTC](https://discourse.processing.org/t/arranging-an-array-of-objects-in-a-grid/16969 "2020-01-25T20:23:17Z")

</div>

I’m trying to further my understanding of how to implement an object array with this simple sketch. I created a while loop within a while loop to create the grid. I added the object array But the screen appears empty w…

---

## [Repeated alpha not reaching full opacity](https://discourse.processing.org/t/repeated-alpha-not-reaching-full-opacity/16890)

<div class="topic-metadata">

**Author:** [@mortap](https://discourse.processing.org/u/mortap)\
**Replies:** 12\
**Last updated:** [January 25, 2020, 6:20pm UTC](https://discourse.processing.org/t/repeated-alpha-not-reaching-full-opacity/16890 "2020-01-25T18:20:18Z")

</div>

Hello, I’m using a rectangle filled with white and a certain alpha value at the beginning of draw, and I would think that if done enough times that eventually the first thing drawn in setup would eventually be totally w…

---

## [How to create an drawing evolution for a clock](https://discourse.processing.org/t/how-to-create-an-drawing-evolution-for-a-clock/17288)

<div class="topic-metadata">

**Author:** [@marcucci](https://discourse.processing.org/u/marcucci)\
**Replies:** 7\
**Last updated:** [January 24, 2020, 10:07pm UTC](https://discourse.processing.org/t/how-to-create-an-drawing-evolution-for-a-clock/17288 "2020-01-24T22:07:35Z")

</div>

Hey Guys, I’m completely new to processing and i’m trying to build a clock. I drawed a tree on illustrator which grow up over time.I don’t know what i can do. The idea of the clock is when the hour is finish, the tree …

---

## [Changing color according to the y variable](https://discourse.processing.org/t/changing-color-according-to-the-y-variable/17315)

<div class="topic-metadata">

**Author:** [@PhilRandom](https://discourse.processing.org/u/PhilRandom)\
**Replies:** 6\
**Last updated:** [January 24, 2020, 7:20pm UTC](https://discourse.processing.org/t/changing-color-according-to-the-y-variable/17315 "2020-01-24T19:20:37Z")

</div>

How should one go about changing the color according to the y variable, an ombré of sorts? Please and Thank You Best, Phil

---

## [Convert into arraylist to add elements](https://discourse.processing.org/t/convert-into-arraylist-to-add-elements/17317)

<div class="topic-metadata">

**Author:** [@floflopm](https://discourse.processing.org/u/floflopm)\
**Replies:** 1\
**Last updated:** [January 24, 2020, 6:31pm UTC](https://discourse.processing.org/t/convert-into-arraylist-to-add-elements/17317 "2020-01-24T18:31:34Z")

</div>

Hi, I am working with a code where there is a defined number of elements N\_ATOMS proportionate to the screen size. I would like to add elements using MousePressed. However, there is no ArrayList in the code and I am not…

---

## [Clock project (Urgent please)](https://discourse.processing.org/t/clock-project-urgent-please/17298)

<div class="topic-metadata">

**Author:** [@laura](https://discourse.processing.org/u/laura)\
**Replies:** 4\
**Last updated:** [January 24, 2020, 7:28am UTC](https://discourse.processing.org/t/clock-project-urgent-please/17298 "2020-01-24T07:28:30Z")

</div>

Hello everyone, I have to create a clock for my animation class and I have some issues with processing. It’s the first time I’m using this app… Please if someone can help me, I want to create a line for every minute th…

---

## [Mixing colours in Processing](https://discourse.processing.org/t/mixing-colours-in-processing/17280)

<div class="topic-metadata">

**Author:** [@Kate](https://discourse.processing.org/u/Kate)\
**Replies:** 4\
**Last updated:** [January 23, 2020, 12:21pm UTC](https://discourse.processing.org/t/mixing-colours-in-processing/17280 "2020-01-23T12:21:18Z")

</div>

What should I use to create such gradient in the text?

---

## [Random numbers 1-13 that don't repeat more than once](https://discourse.processing.org/t/random-numbers-1-13-that-dont-repeat-more-than-once/17269)

<div class="topic-metadata">

**Author:** [@jonnystockham](https://discourse.processing.org/u/jonnystockham)\
**Replies:** 4\
**Last updated:** [January 23, 2020, 8:40am UTC](https://discourse.processing.org/t/random-numbers-1-13-that-dont-repeat-more-than-once/17269 "2020-01-23T08:40:45Z")

</div>

Is it possible to randomly generate an int value going 1-13 and not make the numbers repeat more than once during this sequence?

---

## [Convert text to PShape?](https://discourse.processing.org/t/convert-text-to-pshape/15552)

<div class="topic-metadata">

**Author:** [@hi.ke](https://discourse.processing.org/u/hi.ke)\
**Replies:** 6\
**Last updated:** [January 22, 2020, 6:37pm UTC](https://discourse.processing.org/t/convert-text-to-pshape/15552 "2020-01-22T18:37:58Z")

</div>

Hi out there :wave: i was wondering if it s possible to put a text with a specific size and font into a PShape object. i am working on a sketch, that has some text elements, floating and bouncing around. i am not happy…

---

## [Assigning an Image to a Keyrelease](https://discourse.processing.org/t/assigning-an-image-to-a-keyrelease/17167)

<div class="topic-metadata">

**Author:** [@Dubs](https://discourse.processing.org/u/Dubs)\
**Replies:** 21\
**Last updated:** [January 22, 2020, 7:20am UTC](https://discourse.processing.org/t/assigning-an-image-to-a-keyrelease/17167 "2020-01-22T07:20:58Z")

</div>

Relatively new to coding… and by that I mean I’ve never done it before. Our assignment is to assign different functions to the number keys. In the example code given, our professor assigned text to pop up when you press…

---

## [Coding help with questions](https://discourse.processing.org/t/coding-help-with-questions/17177)

<div class="topic-metadata">

**Author:** [@neptoonsz](https://discourse.processing.org/u/neptoonsz)\
**Replies:** 9\
**Last updated:** [January 21, 2020, 11:59pm UTC](https://discourse.processing.org/t/coding-help-with-questions/17177 "2020-01-21T23:59:25Z")

</div>

I’ve been trying (for a while now) to add in a fill in the blank type question into my quiz but whenever I try to add in the specified code for the fill in the blank type of question: the code doesn’t work together with …

---

## [I need help for a school project](https://discourse.processing.org/t/i-need-help-for-a-school-project/17227)

<div class="topic-metadata">

**Author:** [@linnd](https://discourse.processing.org/u/linnd)\
**Replies:** 11\
**Last updated:** [January 21, 2020, 3:19pm UTC](https://discourse.processing.org/t/i-need-help-for-a-school-project/17227 "2020-01-21T15:19:36Z")

</div>

Hi guys, For my school project we have to do an assignment with the processing program. I have made two things but I want to combine them but I’m not advanced enough to do so since I’ve just started a few weeks ago. Th…

---

## [How to do this video?](https://discourse.processing.org/t/how-to-do-this-video/17019)

<div class="topic-metadata">

**Author:** [@asa2332](https://discourse.processing.org/u/asa2332)\
**Replies:** 39\
**Last updated:** [January 21, 2020, 1:20pm UTC](https://discourse.processing.org/t/how-to-do-this-video/17019 "2020-01-21T13:20:17Z")

</div>

2.

---

## [Gimbals, quaternions, and manual rotation](https://discourse.processing.org/t/gimbals-quaternions-and-manual-rotation/17065)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 22\
**Last updated:** [January 20, 2020, 6:19pm UTC](https://discourse.processing.org/t/gimbals-quaternions-and-manual-rotation/17065 "2020-01-20T18:19:24Z")

</div>

I want to sketch a gimbal. It will be similar to this: \<https://www.openprocessing.org/sketch/414889\> by @behreajj I have no problem with drawing the torus, nor (yet) with the spatial rotations. I want to manually rota…

---

## [Creating obstacles in an existing script](https://discourse.processing.org/t/creating-obstacles-in-an-existing-script/17190)

<div class="topic-metadata">

**Author:** [@floflopm](https://discourse.processing.org/u/floflopm)\
**Replies:** 4\
**Last updated:** [January 20, 2020, 5:30pm UTC](https://discourse.processing.org/t/creating-obstacles-in-an-existing-script/17190 "2020-01-20T17:30:24Z")

</div>

Hi, I am currently working on the following script studying the effects of ‘‘waves’’. I would like to add controls that could modify the waves’ behaviour. Two things I would like to do: Find a way to update the scree…

---

## [PImage and img=null;](https://discourse.processing.org/t/pimage-and-img-null/17187)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 7\
**Last updated:** [January 20, 2020, 9:37am UTC](https://discourse.processing.org/t/pimage-and-img-null/17187 "2020-01-20T09:37:06Z")

</div>

I cobbled this together from something @Chrisir once wrote. I only have one small question. What, if anything, does img=null; do? It is at the end of the setup() block. PShape globe; PImage img; void setup() { size …

---

## [Try...catch (ConnectException e) seems to be missing](https://discourse.processing.org/t/try-catch-connectexception-e-seems-to-be-missing/16524)

<div class="topic-metadata">

**Author:** [@pacolux](https://discourse.processing.org/u/pacolux)\
**Replies:** 5\
**Last updated:** [January 20, 2020, 4:37am UTC](https://discourse.processing.org/t/try-catch-connectexception-e-seems-to-be-missing/16524 "2020-01-20T04:37:34Z")

</div>

import java.net.\*; XML xml; void setup() { try{ xml = loadXML("http://192.168.24.50/tmp/latestsampledata\_u.xml"); } catch (ConnectException e) {println("a bad thing happened");} } Using this abov…

---

## [Translate mistake in the console](https://discourse.processing.org/t/translate-mistake-in-the-console/17171)

<div class="topic-metadata">

**Author:** [@Alrox](https://discourse.processing.org/u/Alrox)\
**Replies:** 3\
**Last updated:** [January 19, 2020, 3:28pm UTC](https://discourse.processing.org/t/translate-mistake-in-the-console/17171 "2020-01-19T15:28:05Z")

</div>

Dear friends, I’m working on a code for my college and I’ve made a game with processing. Unfortunately there is a mistake in the console: “translate(), or this particular variation of it, is not available with this rende…

---

## [I am having trouble with assigning a key press to a image and boolean variable](https://discourse.processing.org/t/i-am-having-trouble-with-assigning-a-key-press-to-a-image-and-boolean-variable/17144)

<div class="topic-metadata">

**Author:** [@NinjaKittens](https://discourse.processing.org/u/NinjaKittens)\
**Replies:** 13\
**Last updated:** [January 19, 2020, 12:33am UTC](https://discourse.processing.org/t/i-am-having-trouble-with-assigning-a-key-press-to-a-image-and-boolean-variable/17144 "2020-01-19T00:33:48Z")

</div>

This is what I came up with on the spot. void keyReleased() { if (keyPressed && ((key == 'a' || key == 'A')) { flagC1 =true } } void draw() { if (keyPressed) { if (key == 'a' || key == 'A') { background(255…

---

## [Is there a way to do this progressively?](https://discourse.processing.org/t/is-there-a-way-to-do-this-progressively/17099)

<div class="topic-metadata">

**Author:** [@moitapjoao](https://discourse.processing.org/u/moitapjoao)\
**Replies:** 9\
**Last updated:** [January 18, 2020, 11:02am UTC](https://discourse.processing.org/t/is-there-a-way-to-do-this-progressively/17099 "2020-01-18T11:02:00Z")

</div>

Hello, I need to make a mathematical flower as shown in this Coding Train video (https://www.youtube.com/watch?v=f5QBExMNB1I&t=6s) but I’d like it to appear progressively, as starting in the middle and drawing out the t…

---

## [Create Login using Processing](https://discourse.processing.org/t/create-login-using-processing/17151)

<div class="topic-metadata">

**Author:** [@Grad](https://discourse.processing.org/u/Grad)\
**Replies:** 3\
**Last updated:** [January 18, 2020, 9:05am UTC](https://discourse.processing.org/t/create-login-using-processing/17151 "2020-01-18T09:05:20Z")

</div>

Hi, I’m new using processing and I want to create a login can you please give me something like ideas to start with?. I advance thank you for any help that you may give.

---

## [Making a for loop with timer](https://discourse.processing.org/t/making-a-for-loop-with-timer/17085)

<div class="topic-metadata">

**Author:** [@Salttt](https://discourse.processing.org/u/Salttt)\
**Replies:** 1\
**Last updated:** [January 14, 2020, 6:06pm UTC](https://discourse.processing.org/t/making-a-for-loop-with-timer/17085 "2020-01-14T18:06:16Z")

</div>

int delay = 2000; void setup() { size(200, 200); time = millis(); fill(#989696); stroke(#747373); rectMode(CENTER); rect(width - 70, 35, 120, 40); } void draw() { for (int i = width - 130; i \< width - 10;…

---

## [Trying to get object to collide with player](https://discourse.processing.org/t/trying-to-get-object-to-collide-with-player/17142)

<div class="topic-metadata">

**Author:** [@Banana132](https://discourse.processing.org/u/Banana132)\
**Replies:** 2\
**Last updated:** [January 17, 2020, 6:19pm UTC](https://discourse.processing.org/t/trying-to-get-object-to-collide-with-player/17142 "2020-01-17T18:19:47Z")

</div>

Hi there, hoping someone is able to help with this issue I have, I am making a very basic game for an assignment and I am struggling to get an object to collide with the player to end the game. I have use the same collis…

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

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