# Coding Questions

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

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

**Page:** 146

---

## [Color arithmetic (getting average, etc.)](https://discourse.processing.org/t/color-arithmetic-getting-average-etc/9801)

<div class="topic-metadata">

**Author:** [@cdaein](https://discourse.processing.org/u/cdaein)\
**Replies:** 4\
**Last updated:** [March 31, 2019, 8:21pm UTC](https://discourse.processing.org/t/color-arithmetic-getting-average-etc/9801 "2019-03-31T20:21:15Z")

</div>

I am trying to do calculation on color data type. Say, I want to get an average of two colors as below, and say I cannot access the color values 0 and 255 themselves directly: color c1 = color(0); color c2 = color(255);…

---

## [Time in Processing](https://discourse.processing.org/t/time-in-processing/9799)

<div class="topic-metadata">

**Author:** [@kaushalsapre](https://discourse.processing.org/u/kaushalsapre)\
**Replies:** 2\
**Last updated:** [March 31, 2019, 8:07pm UTC](https://discourse.processing.org/t/time-in-processing/9799 "2019-03-31T20:07:36Z")

</div>

I have a .csv file with a column for time in milliseconds and another for speed in kmph. I would like to create a visualization for a speedometer using processing. My framework for the solution was to create a counter t…

---

## [String of thumbnail images instead of characters](https://discourse.processing.org/t/string-of-thumbnail-images-instead-of-characters/9725)

<div class="topic-metadata">

**Author:** [@gdesigner](https://discourse.processing.org/u/gdesigner)\
**Replies:** 2\
**Last updated:** [March 31, 2019, 1:03pm UTC](https://discourse.processing.org/t/string-of-thumbnail-images-instead-of-characters/9725 "2019-03-31T13:03:06Z")

</div>

Hello, I’m new to Processing and this forum but I’m trying to create a project for University, where you can create a unique street as you type. I have started with the character string example, however, instead of a ch…

---

## [Show an desktop menu bar](https://discourse.processing.org/t/show-an-desktop-menu-bar/9651)

<div class="topic-metadata">

**Author:** [@Stanlepunk](https://discourse.processing.org/u/Stanlepunk)\
**Replies:** 14\
**Last updated:** [March 31, 2019, 10:23am UTC](https://discourse.processing.org/t/show-an-desktop-menu-bar/9651 "2019-03-31T10:23:18Z")

</div>

I try to add a menu bar on the top of my desktop, i’m close but I fail :slight\_smile Obviously I don’t want open a new frame, but I cannot figure the way to do that. my code is here Menu\_bar mp; void setup() { build…

---

## [mouseClicked function using an image](https://discourse.processing.org/t/mouseclicked-function-using-an-image/9795)

<div class="topic-metadata">

**Author:** [@mvincee](https://discourse.processing.org/u/mvincee)\
**Replies:** 1\
**Last updated:** [March 31, 2019, 3:31am UTC](https://discourse.processing.org/t/mouseclicked-function-using-an-image/9795 "2019-03-31T03:31:40Z")

</div>

I have four emojis displaying in a canvas. Each image when clicked will change the background. For example, smiling face, a rising sun will appear. First question, how do I use the mouseClicked event on an image? Second,…

---

## [Size cannot be used here](https://discourse.processing.org/t/size-cannot-be-used-here/9765)

<div class="topic-metadata">

**Author:** [@yonjukyu](https://discourse.processing.org/u/yonjukyu)\
**Replies:** 3\
**Last updated:** [March 30, 2019, 10:20pm UTC](https://discourse.processing.org/t/size-cannot-be-used-here/9765 "2019-03-30T22:20:29Z")

</div>

hello i am creating a little game and everything was ok before an error appeared: Could not run the sketch: size cannot be used here. here is my code (there is 4 authers classes): boolean keys\[\]; int vaisseau\_x = …

---

## [Mercator Map question: ellipse not showing](https://discourse.processing.org/t/mercator-map-question-ellipse-not-showing/9748)

<div class="topic-metadata">

**Author:** [@antoinesaurat](https://discourse.processing.org/u/antoinesaurat)\
**Replies:** 1\
**Last updated:** [March 30, 2019, 7:42pm UTC](https://discourse.processing.org/t/mercator-map-question-ellipse-not-showing/9748 "2019-03-30T19:42:39Z")

</div>

Dear all, First of all nice to meet you, I am (a very excited) beginner in Processing. Congratulations for this amazingly clear and friendly forum. As stated in the title, I am trying to use a code from Till Nagel to p…

---

## [Flappy bird colision help](https://discourse.processing.org/t/flappy-bird-colision-help/9736)

<div class="topic-metadata">

**Author:** [@bobbobbobbob](https://discourse.processing.org/u/bobbobbobbob)\
**Replies:** 4\
**Last updated:** [March 30, 2019, 5:21pm UTC](https://discourse.processing.org/t/flappy-bird-colision-help/9736 "2019-03-30T17:21:00Z")

</div>

int rectX2; float r2; int rectX; float r; float v = -1; float y = 300; void setup() { size(600, 600); background(0); r = random(50, 450); rectX = 550; r2 = random(50, 450); rectX2 = 1100; } void draw() { b…

---

## [Using data to draw custom shapes](https://discourse.processing.org/t/using-data-to-draw-custom-shapes/9733)

<div class="topic-metadata">

**Author:** [@kirstee\_baxt](https://discourse.processing.org/u/kirstee_baxt)\
**Replies:** 10\
**Last updated:** [March 30, 2019, 4:55pm UTC](https://discourse.processing.org/t/using-data-to-draw-custom-shapes/9733 "2019-03-30T16:55:23Z")

</div>

Hello! I don’t have a lot of code experience, but have been learning a lot about Processing through tutorials, etc. I have a desire to pull data in from a csv that contains two columns : time (in decimal format) and an …

---

## [Confused as to how I could implement a sorting algorithm in Processing](https://discourse.processing.org/t/confused-as-to-how-i-could-implement-a-sorting-algorithm-in-processing/9708)

<div class="topic-metadata">

**Author:** [@Xevion](https://discourse.processing.org/u/Xevion)\
**Replies:** 3\
**Last updated:** [March 29, 2019, 5:50pm UTC](https://discourse.processing.org/t/confused-as-to-how-i-could-implement-a-sorting-algorithm-in-processing/9708 "2019-03-29T17:50:04Z")

</div>

Hi, I’m just getting started in programming and have been working with Processing for a couple of months now, but haven’t found a solution to a rather advanced (for me) problem concerning solving and projecting an array …

---

## [Score doesn't work](https://discourse.processing.org/t/score-doesnt-work/9418)

<div class="topic-metadata">

**Author:** [@alexanecula](https://discourse.processing.org/u/alexanecula)\
**Replies:** 12\
**Last updated:** [March 29, 2019, 7:24am UTC](https://discourse.processing.org/t/score-doesnt-work/9418 "2019-03-29T07:24:35Z")

</div>

Hi, everyone! I’ve been working a pong game lately (my first game actually) and I’m kind of struggling with a very big problem: the scores don’t work and I genuinely don’t know why! It shows “0” the whole time and it si…

---

## [Tron Game movement](https://discourse.processing.org/t/tron-game-movement/9604)

<div class="topic-metadata">

**Author:** [@o0804337](https://discourse.processing.org/u/o0804337)\
**Replies:** 3\
**Last updated:** [March 25, 2019, 11:29pm UTC](https://discourse.processing.org/t/tron-game-movement/9604 "2019-03-25T23:29:38Z")

</div>

I been making Tron but when I go backwards I die. Can someone help me fix this? boolean gameOver=false; boolean gameOver1=false; Car\_2 c=new Car\_2(); Car\_1 f=new Car\_1(); int direction=RIGHT; int Direction2=LEFT; boole…

---

## [Changing the background for an image (related to the arduino logo example)](https://discourse.processing.org/t/changing-the-background-for-an-image-related-to-the-arduino-logo-example/9707)

<div class="topic-metadata">

**Author:** [@ShermanM](https://discourse.processing.org/u/ShermanM)\
**Replies:** 2\
**Last updated:** [March 28, 2019, 4:08am UTC](https://discourse.processing.org/t/changing-the-background-for-an-image-related-to-the-arduino-logo-example/9707 "2019-03-28T04:08:10Z")

</div>

For the life of my, I can’t sort out why this won’t work, despite looking at several examples and tutorials online that would suggest this should work. I am largely using the example from the Arduino projects book, chapt…

---

## [Text Covered by Image](https://discourse.processing.org/t/text-covered-by-image/9692)

<div class="topic-metadata">

**Author:** [@figraham](https://discourse.processing.org/u/figraham)\
**Replies:** 0\
**Last updated:** [March 27, 2019, 9:17pm UTC](https://discourse.processing.org/t/text-covered-by-image/9692 "2019-03-27T21:17:07Z")

</div>

Hey @fwtini. I’m moving your question it’s own topic because the guidelines topic is for discussing the site’s guidelines. In future please use the new topic button on the main page to ask questions. It looks like you’r…

---

## [Trying to loop circles and make them disappear when hovered over](https://discourse.processing.org/t/trying-to-loop-circles-and-make-them-disappear-when-hovered-over/9612)

<div class="topic-metadata">

**Author:** [@longhorn392](https://discourse.processing.org/u/longhorn392)\
**Replies:** 2\
**Last updated:** [March 27, 2019, 9:01pm UTC](https://discourse.processing.org/t/trying-to-loop-circles-and-make-them-disappear-when-hovered-over/9612 "2019-03-27T21:01:17Z")

</div>

Hey guys I’m new to processing and working on a project for class. I’ve made a main file and one in a new tab for my object class Circle. Circle\[\] circle = new Circle\[20\]; void setup() { size(1280, 720); background…

---

## [Help with Extrusion from 2D to 3D](https://discourse.processing.org/t/help-with-extrusion-from-2d-to-3d/9656)

<div class="topic-metadata">

**Author:** [@Pierre](https://discourse.processing.org/u/Pierre)\
**Replies:** 4\
**Last updated:** [March 27, 2019, 3:07pm UTC](https://discourse.processing.org/t/help-with-extrusion-from-2d-to-3d/9656 "2019-03-27T15:07:03Z")

</div>

Hello everyone ! It’s my first post and I’m glad to be new member of the community :slight\_smile: I’m attempting to write a code that allows me to create a 3D image out of a 2D image. I’ve tried this code (see bellow) b…

---

## [Problems with framerate and loading pictures](https://discourse.processing.org/t/problems-with-framerate-and-loading-pictures/9670)

<div class="topic-metadata">

**Author:** [@jensemand](https://discourse.processing.org/u/jensemand)\
**Replies:** 5\
**Last updated:** [March 27, 2019, 9:05am UTC](https://discourse.processing.org/t/problems-with-framerate-and-loading-pictures/9670 "2019-03-27T09:05:33Z")

</div>

Hi I am trying to create a game called “Undertale” as a project at my school however my framerate drops every time I load a picture in draw. Here is a part of my code: PImage img; PImage img2; void setup() { fullScree…

---

## [How to make ellipses on the screen](https://discourse.processing.org/t/how-to-make-ellipses-on-the-screen/9669)

<div class="topic-metadata">

**Author:** [@Robol](https://discourse.processing.org/u/Robol)\
**Replies:** 2\
**Last updated:** [March 27, 2019, 8:20am UTC](https://discourse.processing.org/t/how-to-make-ellipses-on-the-screen/9669 "2019-03-27T08:20:11Z")

</div>

So I started learning processing about 3 days ago, and I realy enjoyed what the program can do so far I know. But this morning I started working with arrays and objects and I couldnt figure out why my code wasnt working.…

---

## [mouseClicked new sketch](https://discourse.processing.org/t/mouseclicked-new-sketch/9616)

<div class="topic-metadata">

**Author:** [@nothingnew](https://discourse.processing.org/u/nothingnew)\
**Replies:** 3\
**Last updated:** [March 27, 2019, 6:09am UTC](https://discourse.processing.org/t/mouseclicked-new-sketch/9616 "2019-03-27T06:09:51Z")

</div>

Hi, I want to make my code when mouse is clicked it can open 2nd sketch. right now it only appears when I click and released my mouse. ( i know it is because it is in void draw) I want it to be hold the 2nd sketch and …

---

## [Attractor / Flow Fields - Bezier Line Drawing Echo/Depth Effect](https://discourse.processing.org/t/attractor-flow-fields-bezier-line-drawing-echo-depth-effect/9598)

<div class="topic-metadata">

**Author:** [@arvind](https://discourse.processing.org/u/arvind)\
**Replies:** 4\
**Last updated:** [March 27, 2019, 12:34am UTC](https://discourse.processing.org/t/attractor-flow-fields-bezier-line-drawing-echo-depth-effect/9598 "2019-03-27T00:34:29Z")

</div>

Hello! Does anyone know how to create the imagery used in this attractor/flow field Processing animation? It looks as though it is bezier lines but I’m trying to understand the process that …

---

## [Text() don't recognize \\t tabulator](https://discourse.processing.org/t/text-dont-recognize-t-tabulator/9572)

<div class="topic-metadata">

**Author:** [@Santy](https://discourse.processing.org/u/Santy)\
**Replies:** 13\
**Last updated:** [March 26, 2019, 5:18pm UTC](https://discourse.processing.org/t/text-dont-recognize-t-tabulator/9572 "2019-03-26T17:18:48Z")

</div>

Hi friends, I’ve a problem with the tab… the function text() doesn’t recognize \\t while the funcion print() if it does. you can see a simple code: String datos\[\]=new String\[10\]; int sep=15; datos=loadStrings("Datos.t…

---

## [Image Orientation incorrect after LoadImage() and image()](https://discourse.processing.org/t/image-orientation-incorrect-after-loadimage-and-image/9581)

<div class="topic-metadata">

**Author:** [@charly4710](https://discourse.processing.org/u/charly4710)\
**Replies:** 4\
**Last updated:** [March 25, 2019, 9:33pm UTC](https://discourse.processing.org/t/image-orientation-incorrect-after-loadimage-and-image/9581 "2019-03-25T21:33:08Z")

</div>

A lot of images do not show the correct orientation, at least not the one that shows in the Windows Explorer and in image editors. For a lot of images, after I have loaded them from the harddrive with loadimage(), and t…

---

## [Needle in a NaN stack](https://discourse.processing.org/t/needle-in-a-nan-stack/9519)

<div class="topic-metadata">

**Author:** [@Tsskyx](https://discourse.processing.org/u/Tsskyx)\
**Replies:** 4\
**Last updated:** [March 25, 2019, 8:57pm UTC](https://discourse.processing.org/t/needle-in-a-nan-stack/9519 "2019-03-25T20:57:29Z")

</div>

So, long story short, I am working on a neural network. Here it is, plus all the assorted files: https://drive.google.com/open?id=1GLXP1Ta0bqXB6fZLjZUJ4ysk23e7cDwt Read through my comments to better understand it, espe…

---

## [Image distort - warp](https://discourse.processing.org/t/image-distort-warp/9600)

<div class="topic-metadata">

**Author:** [@dimpapadop](https://discourse.processing.org/u/dimpapadop)\
**Replies:** 0\
**Last updated:** [March 25, 2019, 11:17am UTC](https://discourse.processing.org/t/image-distort-warp/9600 "2019-03-25T11:17:28Z")

</div>

Hallo, i am trying to distort an image to fit to a skewed / distorted shape. For example when i give the 4 corners of a shape and make it fit there even though it is not a rectangle. I tried the easy way with vertex()…

---

## [Drawing Ikeda Function](https://discourse.processing.org/t/drawing-ikeda-function/9536)

<div class="topic-metadata">

**Author:** [@mloiz](https://discourse.processing.org/u/mloiz)\
**Replies:** 2\
**Last updated:** [March 25, 2019, 9:58am UTC](https://discourse.processing.org/t/drawing-ikeda-function/9536 "2019-03-25T09:58:56Z")

</div>

I want to reproduce the Ikeda chaos map example on Wikipedia but I dont manage to have the same result, complexity. I have only one attractor, the center… any advice ? size(500, 700); background(250); int margin = 20; …

---

## [4 stroke animation need help with rotate()](https://discourse.processing.org/t/4-stroke-animation-need-help-with-rotate/9510)

<div class="topic-metadata">

**Author:** [@grillgemuese](https://discourse.processing.org/u/grillgemuese)\
**Replies:** 2\
**Last updated:** [March 25, 2019, 6:53am UTC](https://discourse.processing.org/t/4-stroke-animation-need-help-with-rotate/9510 "2019-03-25T06:53:41Z")

</div>

Hi all, please try to help me undestanding translate() combined with rotate(radians()). My left valve is working nearly as expected but the right valve get() function is not referencing the top of the valve. Thanks a…

---

## [Making an aiming line?](https://discourse.processing.org/t/making-an-aiming-line/9514)

<div class="topic-metadata">

**Author:** [@JsRambles](https://discourse.processing.org/u/JsRambles)\
**Replies:** 4\
**Last updated:** [March 25, 2019, 6:51am UTC](https://discourse.processing.org/t/making-an-aiming-line/9514 "2019-03-25T06:51:11Z")

</div>

Hello! I am attempting to make an “aiming line” but it has to be dashed. How can I make a dashed line? I’ve seen the lerp() function mentioned but they always end up not perfectly straight and kind of whacky looking. I…

---

## [Enemy Movement Match 3](https://discourse.processing.org/t/enemy-movement-match-3/9558)

<div class="topic-metadata">

**Author:** [@ctrembla](https://discourse.processing.org/u/ctrembla)\
**Replies:** 10\
**Last updated:** [March 24, 2019, 3:04pm UTC](https://discourse.processing.org/t/enemy-movement-match-3/9558 "2019-03-24T15:04:52Z")

</div>

Hey I’m trying to create a match 3 game with blocks that dont just drop downwards. I’ve tried several ways to get my blocks to do as i want but my booleans ain’t working correctly. The enemy should check below till it re…

---

## [Help please idk how to fix](https://discourse.processing.org/t/help-please-idk-how-to-fix/9425)

<div class="topic-metadata">

**Author:** [@Spartan](https://discourse.processing.org/u/Spartan)\
**Replies:** 2\
**Last updated:** [March 22, 2019, 10:34pm UTC](https://discourse.processing.org/t/help-please-idk-how-to-fix/9425 "2019-03-22T22:34:21Z")

</div>

I want it to do tpassword = tpassword + (acharset\[iter\] \* iter(how many iterations have gone through)) so if its iter 0 than it just does tpassword = tpassword if it’s higher it does tpassword = tpassword + (achar…

---

## [Fill the screen with maroon](https://discourse.processing.org/t/fill-the-screen-with-maroon/9525)

<div class="topic-metadata">

**Author:** [@andrewyu](https://discourse.processing.org/u/andrewyu)\
**Replies:** 4\
**Last updated:** [March 22, 2019, 10:48am UTC](https://discourse.processing.org/t/fill-the-screen-with-maroon/9525 "2019-03-22T10:48:35Z")

</div>

Hi I need help with code. It’s actually for school. And they want the ui to look that its going to fill the row with maroon using frameRate from left to right. Once its filled the next row will be filled. Here’s the code…

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

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