# Coding Questions

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

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

**Page:** 85

---

## [Draw a number on each side of a box](https://discourse.processing.org/t/draw-a-number-on-each-side-of-a-box/22916)

<div class="topic-metadata">

**Author:** [@hugoromo](https://discourse.processing.org/u/hugoromo)\
**Replies:** 1\
**Last updated:** [July 30, 2020, 2:13am UTC](https://discourse.processing.org/t/draw-a-number-on-each-side-of-a-box/22916 "2020-07-30T02:13:10Z")

</div>

Hello, I think a possible solution would be using the shapes3d library and drawing a PImage on each side of the box. But I’m new with all this and I wasn’t able to come up with a solution using this library, so I was wo…

---

## [Adding texture to 2D circle](https://discourse.processing.org/t/adding-texture-to-2d-circle/22914)

<div class="topic-metadata">

**Author:** [@Chafari](https://discourse.processing.org/u/Chafari)\
**Replies:** 0\
**Last updated:** [July 29, 2020, 8:13pm UTC](https://discourse.processing.org/t/adding-texture-to-2d-circle/22914 "2020-07-29T20:13:39Z")

</div>

Hi there . Is it possible to asign an image to a 2D circle or it must be a p3D shape? Edit. Stupid me !! I should have read references first.

---

## [Get most recent online file?](https://discourse.processing.org/t/get-most-recent-online-file/22879)

<div class="topic-metadata">

**Author:** [@jetjaguar](https://discourse.processing.org/u/jetjaguar)\
**Replies:** 3\
**Last updated:** [July 29, 2020, 3:20am UTC](https://discourse.processing.org/t/get-most-recent-online-file/22879 "2020-07-29T03:20:28Z")

</div>

Imagine a public directory online, like this one: https://neo.sci.gsfc.nasa.gov/archive/rgb/MOD\_LSTD\_E/ This directory has a file put into it usually every 8 days. I would like to get the newest file whenever the sketch…

---

## [Need help while creating new picture](https://discourse.processing.org/t/need-help-while-creating-new-picture/22741)

<div class="topic-metadata">

**Author:** [@yhlaskerimov](https://discourse.processing.org/u/yhlaskerimov)\
**Replies:** 5\
**Last updated:** [July 28, 2020, 5:51pm UTC](https://discourse.processing.org/t/need-help-while-creating-new-picture/22741 "2020-07-28T17:51:08Z")

</div>

Hello I want to do thing like this tap here to see. But i can’t create an image which i am selecting… How to do this ? Can anyone help ? int x = 0; int y = 0; int x2 = 1; int y2 = 1; int q, w, e, r; boolean basyldymy; …

---

## [Trying to work with image arrays to store images for temporary use](https://discourse.processing.org/t/trying-to-work-with-image-arrays-to-store-images-for-temporary-use/22088)

<div class="topic-metadata">

**Author:** [@TheEternalDragon](https://discourse.processing.org/u/TheEternalDragon)\
**Replies:** 4\
**Last updated:** [July 28, 2020, 11:34am UTC](https://discourse.processing.org/t/trying-to-work-with-image-arrays-to-store-images-for-temporary-use/22088 "2020-07-28T11:34:13Z")

</div>

So I have been trying to work a lot with playing animations in Processing and I am currently working on a program that has a starting screen which the player can see after loading but will probably click away fairly quik…

---

## [Changing strokeWeight when mousePressed](https://discourse.processing.org/t/changing-strokeweight-when-mousepressed/22869)

<div class="topic-metadata">

**Author:** [@karate29](https://discourse.processing.org/u/karate29)\
**Replies:** 1\
**Last updated:** [July 28, 2020, 11:03am UTC](https://discourse.processing.org/t/changing-strokeweight-when-mousepressed/22869 "2020-07-28T11:03:12Z")

</div>

I am brand new to Processing and was trying to create a free hand drawing program. I already made the colors and when you press them it changes the color and you can draw with the selected color. The problem I am coming …

---

## [Need a little Help](https://discourse.processing.org/t/need-a-little-help/22874)

<div class="topic-metadata">

**Author:** [@the\_ahnafpiash](https://discourse.processing.org/u/the_ahnafpiash)\
**Replies:** 3\
**Last updated:** [July 28, 2020, 8:41am UTC](https://discourse.processing.org/t/need-a-little-help/22874 "2020-07-28T08:41:37Z")

</div>

/\* I am trying for so long to solve my assignment but I am stuck… need a little help please! here is my assignment question: Create a ball of predefined size that bounces around the canvas, reversing directions when i…

---

## [Keep the strokeWeight() constant using scale](https://discourse.processing.org/t/keep-the-strokeweight-constant-using-scale/22611)

<div class="topic-metadata">

**Author:** [@Waboqueox](https://discourse.processing.org/u/Waboqueox)\
**Replies:** 4\
**Last updated:** [July 27, 2020, 8:48pm UTC](https://discourse.processing.org/t/keep-the-strokeweight-constant-using-scale/22611 "2020-07-27T20:48:21Z")

</div>

Hi people; When I use scale, the function scales the strokeWeight(); too, how can avoid it? void setup() { size(640,480); rectMode(CENTER); } void draw() { rect(50,50,50,50); scale(2,2); rect(50,50,50,50); …

---

## [I think I've made a huge mistake (function overloading)](https://discourse.processing.org/t/i-think-ive-made-a-huge-mistake-function-overloading/22835)

<div class="topic-metadata">

**Author:** [@Math\_Machine](https://discourse.processing.org/u/Math_Machine)\
**Replies:** 5\
**Last updated:** [July 26, 2020, 4:35pm UTC](https://discourse.processing.org/t/i-think-ive-made-a-huge-mistake-function-overloading/22835 "2020-07-26T16:35:31Z")

</div>

So, I was writing a (personal) library for complex numbers. I know there’s an existing library for that, but some of the syntax kinda bugged me and, wouldn’t you know it, I already made it anyway. But, I ended up overl…

---

## [Cube with rounded edges](https://discourse.processing.org/t/cube-with-rounded-edges/22064)

<div class="topic-metadata">

**Author:** [@Mesalcode](https://discourse.processing.org/u/Mesalcode)\
**Replies:** 6\
**Last updated:** [July 26, 2020, 8:38pm UTC](https://discourse.processing.org/t/cube-with-rounded-edges/22064 "2020-07-26T20:38:59Z")

</div>

Hi there! I am working on a mobile quizapp based on rotating a cube. I am currently using this code for drawing a cube: beginShape(QUADS); texture(front); vertex(-1, -1, 1, 0, 0); vertex( 1, -1, 1, 1, 0); ve…

---

## [Making rectangles behave like pixels after exporting](https://discourse.processing.org/t/making-rectangles-behave-like-pixels-after-exporting/22834)

<div class="topic-metadata">

**Author:** [@qewer3322](https://discourse.processing.org/u/qewer3322)\
**Replies:** 4\
**Last updated:** [July 26, 2020, 7:36am UTC](https://discourse.processing.org/t/making-rectangles-behave-like-pixels-after-exporting/22834 "2020-07-26T07:36:14Z")

</div>

I don’t exactly know what should I title this but basically, I have the main simple function of a pixelart program here: ArrayList\<Sq\> fill; boolean f = true; void setup() { size(1000, 600); fill = new ArrayList\<Sq\>…

---

## [Confusion on classes and objects](https://discourse.processing.org/t/confusion-on-classes-and-objects/22838)

<div class="topic-metadata">

**Author:** [@Edgard142ofWelshdale](https://discourse.processing.org/u/Edgard142ofWelshdale)\
**Replies:** 2\
**Last updated:** [July 26, 2020, 1:03am UTC](https://discourse.processing.org/t/confusion-on-classes-and-objects/22838 "2020-07-26T01:03:43Z")

</div>

Hello! I just started using classes in my processing games(as in, this is my first attempt). I am incredibly lost as to how to do it correctly. I looked at the processing 3 language reference and it doesn’t have much on …

---

## [How do I fix error "The operator && is undefined for the argument types boolean\[\], boolean"](https://discourse.processing.org/t/how-do-i-fix-error-the-operator-is-undefined-for-the-argument-types-boolean-boolean/21566)

<div class="topic-metadata">

**Author:** [@s.k9](https://discourse.processing.org/u/s.k9)\
**Replies:** 3\
**Last updated:** [July 25, 2020, 8:33pm UTC](https://discourse.processing.org/t/how-do-i-fix-error-the-operator-is-undefined-for-the-argument-types-boolean-boolean/21566 "2020-07-25T20:33:45Z")

</div>

Hi all, I am making a trivia game for a class project and I am getting this error I have not seen before and cannot figure out how to fix it. Context is I am using XML to load information into the game and overMulti is …

---

## [Maths question relating to TAU](https://discourse.processing.org/t/maths-question-relating-to-tau/22828)

<div class="topic-metadata">

**Author:** [@pandl](https://discourse.processing.org/u/pandl)\
**Replies:** 1\
**Last updated:** [July 25, 2020, 2:38am UTC](https://discourse.processing.org/t/maths-question-relating-to-tau/22828 "2020-07-25T02:38:22Z")

</div>

The following code plots a circle which is going to be a path for an image or a Pshape to follow. Where I’ve used a = (i \* TAU) / 90 seems a bit clumsy and I’m wondering if anyone can suggest what I should have done here…

---

## [Windows style dialogue boxes](https://discourse.processing.org/t/windows-style-dialogue-boxes/22147)

<div class="topic-metadata">

**Author:** [@F53](https://discourse.processing.org/u/F53)\
**Replies:** 4\
**Last updated:** [July 24, 2020, 6:41am UTC](https://discourse.processing.org/t/windows-style-dialogue-boxes/22147 "2020-07-24T06:41:42Z")

</div>

I would like to use windows 10 style dialogue boxes, where should I start looking in-order to learn how do this within processing? The provided dialogue boxes in processing feel dated and seemingly cant return a valuePr…

---

## [Scaling a custom PShape without changing line thickness](https://discourse.processing.org/t/scaling-a-custom-pshape-without-changing-line-thickness/11437)

<div class="topic-metadata">

**Author:** [@F53](https://discourse.processing.org/u/F53)\
**Replies:** 10\
**Last updated:** [July 24, 2020, 6:35am UTC](https://discourse.processing.org/t/scaling-a-custom-pshape-without-changing-line-thickness/11437 "2020-07-24T06:35:31Z")

</div>

I am teaching myself to code through coding games, I am currently working on asteroids. I have a custom PShape called ast that uses a fair bit of vertices. I create a separate instance of it called n in the asteroid cl…

---

## [Alpha values of overlapping lines](https://discourse.processing.org/t/alpha-values-of-overlapping-lines/22794)

<div class="topic-metadata">

**Author:** [@N0ld0r](https://discourse.processing.org/u/N0ld0r)\
**Replies:** 4\
**Last updated:** [July 23, 2020, 3:25pm UTC](https://discourse.processing.org/t/alpha-values-of-overlapping-lines/22794 "2020-07-23T15:25:21Z")

</div>

Good day I am creating a small asteroids clone just to have some fun. I recently added missiles into my game which work well except for a small issue I’m having with the alpha of the stroke(R,G,B,Alpha) function and lin…

---

## [Nativehook library](https://discourse.processing.org/t/nativehook-library/22790)

<div class="topic-metadata">

**Author:** [@Ardubora](https://discourse.processing.org/u/Ardubora)\
**Replies:** 0\
**Last updated:** [July 23, 2020, 9:40am UTC](https://discourse.processing.org/t/nativehook-library/22790 "2020-07-23T09:40:57Z")

</div>

How can I captchure a single keystrocke and then make the code “press” the button from te keystrocke at a later date. I am not asking for a KeyLogger.

---

## [How to generate a multi-color blur gradation from a specified image?](https://discourse.processing.org/t/how-to-generate-a-multi-color-blur-gradation-from-a-specified-image/22779)

<div class="topic-metadata">

**Author:** [@Soh](https://discourse.processing.org/u/Soh)\
**Replies:** 2\
**Last updated:** [July 22, 2020, 1:03pm UTC](https://discourse.processing.org/t/how-to-generate-a-multi-color-blur-gradation-from-a-specified-image/22779 "2020-07-22T13:03:44Z")

</div>

Is there any possible way to generate a multi-color blur gradation depends on an image via Processing? For example, the lyrics UI background of Apple Music. It’s auto-generated from CD jacket image.

---

## [Making tons of bullets flying in random directions](https://discourse.processing.org/t/making-tons-of-bullets-flying-in-random-directions/22745)

<div class="topic-metadata">

**Author:** [@qewer3322](https://discourse.processing.org/u/qewer3322)\
**Replies:** 9\
**Last updated:** [July 22, 2020, 7:30am UTC](https://discourse.processing.org/t/making-tons-of-bullets-flying-in-random-directions/22745 "2020-07-22T07:30:02Z")

</div>

So I have a game here: int x = 500; int y = 300; int f1 = 255; int f2 = 255; int f3 = 255; int ap = 120; int hp = 190; boolean showrange = true; PFont font; float xSpeed = 0; float ySpeed = 0; BulletSystem b1; boolean…

---

## [Moving a player rectangle smoothly](https://discourse.processing.org/t/moving-a-player-rectangle-smoothly/22763)

<div class="topic-metadata">

**Author:** [@Edgard142ofWelshdale](https://discourse.processing.org/u/Edgard142ofWelshdale)\
**Replies:** 3\
**Last updated:** [July 21, 2020, 10:18pm UTC](https://discourse.processing.org/t/moving-a-player-rectangle-smoothly/22763 "2020-07-21T22:18:03Z")

</div>

Hello! I like making simple arcade-like games in processing and have always had an issue with smooth movement. At first, I was using the void keyPressed() function to move the player. void keyPressed()//keypressed fuct…

---

## [Fancy gradient rainbow color on text?](https://discourse.processing.org/t/fancy-gradient-rainbow-color-on-text/22686)

<div class="topic-metadata">

**Author:** [@qewer3322](https://discourse.processing.org/u/qewer3322)\
**Replies:** 5\
**Last updated:** [July 21, 2020, 5:55pm UTC](https://discourse.processing.org/t/fancy-gradient-rainbow-color-on-text/22686 "2020-07-21T17:55:25Z")

</div>

What I want to do is basically this: but it is going through the text like this: I don’t exactly know where to start here or what I should do.

---

## [Help me please how to remove little circle?](https://discourse.processing.org/t/help-me-please-how-to-remove-little-circle/22564)

<div class="topic-metadata">

**Author:** [@Rai](https://discourse.processing.org/u/Rai)\
**Replies:** 26\
**Last updated:** [July 21, 2020, 6:24am UTC](https://discourse.processing.org/t/help-me-please-how-to-remove-little-circle/22564 "2020-07-21T06:24:28Z")

</div>

void setup() { size(640, 480); background(255); } void draw() { strokeWeight(10); stroke(255, 0, 0, 50); line(pmouseX, pmouseY, mouseX, mouseY); }

---

## [Downscaling an image to an array](https://discourse.processing.org/t/downscaling-an-image-to-an-array/22746)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 4\
**Last updated:** [July 20, 2020, 11:07pm UTC](https://discourse.processing.org/t/downscaling-an-image-to-an-array/22746 "2020-07-20T23:07:39Z")

</div>

currently stuck with this problem, and its probably easy however m brain cant figure it out. PImage img; ArrayList\<Float\> array = new ArrayList\<Float\>(); int cols = 202; int rows = 200; int res,ry; void setup(){ size…

---

## [Adjust text size based on screen resolution](https://discourse.processing.org/t/adjust-text-size-based-on-screen-resolution/22747)

<div class="topic-metadata">

**Author:** [@TechMaster04](https://discourse.processing.org/u/TechMaster04)\
**Replies:** 2\
**Last updated:** [July 20, 2020, 11:03pm UTC](https://discourse.processing.org/t/adjust-text-size-based-on-screen-resolution/22747 "2020-07-20T23:03:15Z")

</div>

Hello Recently I discovered how to make my programs resizable in Windows (Add surface.setResizable(true); in setup()) This led me to make a function that changes the location of certain elements based on resoloution…

---

## [Hi guys, I'm new to processing and I need help](https://discourse.processing.org/t/hi-guys-im-new-to-processing-and-i-need-help/22625)

<div class="topic-metadata">

**Author:** [@nhghi](https://discourse.processing.org/u/nhghi)\
**Replies:** 5\
**Last updated:** [July 20, 2020, 10:46pm UTC](https://discourse.processing.org/t/hi-guys-im-new-to-processing-and-i-need-help/22625 "2020-07-20T22:46:16Z")

</div>

so I’m trying to make an effect is like “Newton’s cradle”. I have n number of circles that go around my mouse. so the first n-1 circle go around my mouse with SPEED constance and the other circle go with 2\*SPEED with opp…

---

## [Desperate for Help, due in 2 days! Beginner & Confused, Rotating STRING text](https://discourse.processing.org/t/desperate-for-help-due-in-2-days-beginner-confused-rotating-string-text/22692)

<div class="topic-metadata">

**Author:** [@Sugar](https://discourse.processing.org/u/Sugar)\
**Replies:** 7\
**Last updated:** [July 18, 2020, 7:56pm UTC](https://discourse.processing.org/t/desperate-for-help-due-in-2-days-beginner-confused-rotating-string-text/22692 "2020-07-18T19:56:28Z")

</div>

Hi there, I am an Intern to an artist, and I have 0 experience coding, and frankly, I’m hating every second of it. But I have been tasked for Monday (July 20th 2020) to create a code for the show where the words “Press”…

---

## [Pyramid Rect Pattern](https://discourse.processing.org/t/pyramid-rect-pattern/22689)

<div class="topic-metadata">

**Author:** [@chemicalite](https://discourse.processing.org/u/chemicalite)\
**Replies:** 7\
**Last updated:** [July 17, 2020, 8:15pm UTC](https://discourse.processing.org/t/pyramid-rect-pattern/22689 "2020-07-17T20:15:22Z")

</div>

Hello! I’m making a pyramid pattern with rects using for loops. It’s a bit hard to explain, but basically, I would like to divide a square canvas into four triangular quadrants and fill each side with pyramids made from…

---

## [Download file from FTP server?](https://discourse.processing.org/t/download-file-from-ftp-server/22651)

<div class="topic-metadata">

**Author:** [@jetjaguar](https://discourse.processing.org/u/jetjaguar)\
**Replies:** 3\
**Last updated:** [July 17, 2020, 5:03pm UTC](https://discourse.processing.org/t/download-file-from-ftp-server/22651 "2020-07-17T17:03:05Z")

</div>

I feel like I’m missing something simple here. I just want to download and then display an image file from a remote, public FTP server. When I try to do so I get “The file xxx is missing or inaccessible, make sure the U…

---

## [Imported SVG is PShape GROUP, cannot convert to ArrayList of PVector](https://discourse.processing.org/t/imported-svg-is-pshape-group-cannot-convert-to-arraylist-of-pvector/22642)

<div class="topic-metadata">

**Author:** [@loremipsum](https://discourse.processing.org/u/loremipsum)\
**Replies:** 2\
**Last updated:** [July 17, 2020, 2:06pm UTC](https://discourse.processing.org/t/imported-svg-is-pshape-group-cannot-convert-to-arraylist-of-pvector/22642 "2020-07-17T14:06:38Z")

</div>

I’ve been trying to read in a .svg i made in Illustrator. It imports/displays properly as a PShape, but I’m hoping to convert the shape into an ArrayList of PVectors so I can manipulate the shape. Here’s what I’ve done: …

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

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