# Coding Questions

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

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

**Page:** 119

---

## [Are createFont and loadFont unusable in Processing iOS?](https://discourse.processing.org/t/are-createfont-and-loadfont-unusable-in-processing-ios/15714)

<div class="topic-metadata">

**Author:** [@Qwqwwqqqweeewqw](https://discourse.processing.org/u/Qwqwwqqqweeewqw)\
**Replies:** 2\
**Last updated:** [November 23, 2019, 10:43am UTC](https://discourse.processing.org/t/are-createfont-and-loadfont-unusable-in-processing-ios/15714 "2019-11-23T10:43:18Z")

</div>

void setup() { size(screen.width, screen.height); textAlign(CENTER); textFont(createFont("Lato-Medium.ttf", 30)); frameRate(60); } void draw() { ... } I wanted to use Lato font, ant I wrote this code, but …

---

## [Backpropagation doesn't work properly](https://discourse.processing.org/t/backpropagation-doesnt-work-properly/15724)

<div class="topic-metadata">

**Author:** [@NumericPrime](https://discourse.processing.org/u/NumericPrime)\
**Replies:** 2\
**Last updated:** [November 23, 2019, 5:55am UTC](https://discourse.processing.org/t/backpropagation-doesnt-work-properly/15724 "2019-11-23T05:55:15Z")

</div>

I got a problem with learning in Neuronal Networks again. I tried using backpropagation and created following two classes: class Neuron { float lastinputs\[\]; int id; float\[\] weights; Neuron(int id\_, int lengthw…

---

## [Does anybody have tips with smooth moving?](https://discourse.processing.org/t/does-anybody-have-tips-with-smooth-moving/15456)

<div class="topic-metadata">

**Author:** [@24stevek](https://discourse.processing.org/u/24stevek)\
**Replies:** 7\
**Last updated:** [November 23, 2019, 4:57am UTC](https://discourse.processing.org/t/does-anybody-have-tips-with-smooth-moving/15456 "2019-11-23T04:57:53Z")

</div>

Hi, I’m back with my second question:) I am currently making a zooming effect, by gradually increasing the size of an image. It does work well, but it kind of lags and the pixels get all mixed up; I don’t want to slow …

---

## [\[SOLVED\] Circle around a pixel](https://discourse.processing.org/t/solved-circle-around-a-pixel/1071)

<div class="topic-metadata">

**Author:** [@MxFxM](https://discourse.processing.org/u/MxFxM)\
**Replies:** 8\
**Last updated:** [November 22, 2019, 11:34pm UTC](https://discourse.processing.org/t/solved-circle-around-a-pixel/1071 "2019-11-22T23:34:27Z")

</div>

Hello everbody, I’m currently working on a project where I need to find a specific distance between a point and a line. To do that, I draw the line in green and start scanning each pixel around the point. This can take…

---

## [Forwarding and reversing time in physics sim](https://discourse.processing.org/t/forwarding-and-reversing-time-in-physics-sim/15597)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 10\
**Last updated:** [November 22, 2019, 11:14pm UTC](https://discourse.processing.org/t/forwarding-and-reversing-time-in-physics-sim/15597 "2019-11-22T23:14:43Z")

</div>

void update(){ steps = pos.size()-1; text (counter, 150,20); fill(255); text(index,200,10); fill(col); if(forward){ if(index==0){ if(pos.size()\>0){ counter = pos…

---

## [How to display a special font in Processing?](https://discourse.processing.org/t/how-to-display-a-special-font-in-processing/15459)

<div class="topic-metadata">

**Author:** [@z.chen](https://discourse.processing.org/u/z.chen)\
**Replies:** 8\
**Last updated:** [November 22, 2019, 8:57pm UTC](https://discourse.processing.org/t/how-to-display-a-special-font-in-processing/15459 "2019-11-22T20:57:18Z")

</div>

Hello, I downloaded this kind of font online, and I need to translate the input of others into this font in Processing and save the file in SVG format to the local folder. Cuz I need to upload the SVG file to my plotter …

---

## [Download/upload stats Monitor](https://discourse.processing.org/t/download-upload-stats-monitor/15582)

<div class="topic-metadata">

**Author:** [@FPAIS](https://discourse.processing.org/u/FPAIS)\
**Replies:** 1\
**Last updated:** [November 22, 2019, 8:55pm UTC](https://discourse.processing.org/t/download-upload-stats-monitor/15582 "2019-11-22T20:55:23Z")

</div>

Hi, I would like to use my computer or browser download/upload stats (Mb/Kb downloaded in a certain time frame) in processing and visualize these in different ways. Does anyone have a clue on how I could access these v…

---

## [How to make bouncing balls?](https://discourse.processing.org/t/how-to-make-bouncing-balls/15465)

<div class="topic-metadata">

**Author:** [@Soloh](https://discourse.processing.org/u/Soloh)\
**Replies:** 2\
**Last updated:** [November 22, 2019, 4:54pm UTC](https://discourse.processing.org/t/how-to-make-bouncing-balls/15465 "2019-11-22T16:54:38Z")

</div>

i have to do ball Flying left, and when it reach wall it return

---

## [Scale the whole screen content to the back](https://discourse.processing.org/t/scale-the-whole-screen-content-to-the-back/15712)

<div class="topic-metadata">

**Author:** [@lumicon9](https://discourse.processing.org/u/lumicon9)\
**Replies:** 5\
**Last updated:** [November 22, 2019, 3:56pm UTC](https://discourse.processing.org/t/scale-the-whole-screen-content-to-the-back/15712 "2019-11-22T15:56:56Z")

</div>

i want to scale the screen content slowly to the (pseudo)back, using a 2d scale (shrinking). here is what i have as start out; int siz = 66; void setup(){ size(800,600); } void draw(){ ellipse((int)random(widt…

---

## [How do I attach a rectangle to a line?](https://discourse.processing.org/t/how-do-i-attach-a-rectangle-to-a-line/15423)

<div class="topic-metadata">

**Author:** [@Lucc39](https://discourse.processing.org/u/Lucc39)\
**Replies:** 6\
**Last updated:** [November 22, 2019, 3:37pm UTC](https://discourse.processing.org/t/how-do-i-attach-a-rectangle-to-a-line/15423 "2019-11-22T15:37:25Z")

</div>

So, I’m trying to create Pac Man and I’m not sure on how to do so. My best idea so far was to attach the rectangle (which will be Pac Man himself, the player) to certain invisible lines, as if he is a train on a railroad…

---

## [Please advise me on my cannon simulation code!](https://discourse.processing.org/t/please-advise-me-on-my-cannon-simulation-code/15717)

<div class="topic-metadata">

**Author:** [@O-O](https://discourse.processing.org/u/O-O)\
**Replies:** 3\
**Last updated:** [November 22, 2019, 2:18pm UTC](https://discourse.processing.org/t/please-advise-me-on-my-cannon-simulation-code/15717 "2019-11-22T14:18:51Z")

</div>

int angle=0,a=1; void setup(){ size(1500,750); fill(26,185,53); rectMode(CORNER); rect(0,600,1500,150); fill(75,78,75); rect(0,610,1500,20); fill(233,243,255); rect(0,0,1500,600); stroke(247,251,0); line(0,620,100,620)…

---

## [How to get a turnkey!](https://discourse.processing.org/t/how-to-get-a-turnkey/15716)

<div class="topic-metadata">

**Author:** [@O-O](https://discourse.processing.org/u/O-O)\
**Replies:** 1\
**Last updated:** [November 22, 2019, 1:06pm UTC](https://discourse.processing.org/t/how-to-get-a-turnkey/15716 "2019-11-22T13:06:45Z")

</div>

I’m going to adjust the angle of the cannon with the orientation key on the keyboard. How can I get a orientation key?:face\_with\_raised\_eyebrow:

---

## [Scale PShape object centered](https://discourse.processing.org/t/scale-pshape-object-centered/15710)

<div class="topic-metadata">

**Author:** [@lumicon9](https://discourse.processing.org/u/lumicon9)\
**Replies:** 2\
**Last updated:** [November 22, 2019, 10:34am UTC](https://discourse.processing.org/t/scale-pshape-object-centered/15710 "2019-11-22T10:34:54Z")

</div>

hi, how can i scale a PShape object centered? PShape square; float shrink; float sizeXY=100; void setup() { size(300, 300); square = createShape(RECT, 0, 0, sizeXY, sizeXY); } void draw() { shrink=shrink+0.0…

---

## [Need help to prevent Infinity to occur](https://discourse.processing.org/t/need-help-to-prevent-infinity-to-occur/15696)

<div class="topic-metadata">

**Author:** [@NumericPrime](https://discourse.processing.org/u/NumericPrime)\
**Replies:** 2\
**Last updated:** [November 21, 2019, 11:00pm UTC](https://discourse.processing.org/t/need-help-to-prevent-infinity-to-occur/15696 "2019-11-21T23:00:47Z")

</div>

I got following problem I’m creating a Neuronal Network class And for some strange reasons I don’t know there is one point in the learning process at wich there it suddenly becomes Infinity and then NaN. Here is code of …

---

## [How to make an animation appear for multiple seconds when collison happens?](https://discourse.processing.org/t/how-to-make-an-animation-appear-for-multiple-seconds-when-collison-happens/15698)

<div class="topic-metadata">

**Author:** [@legutierrez1](https://discourse.processing.org/u/legutierrez1)\
**Replies:** 1\
**Last updated:** [November 21, 2019, 8:31pm UTC](https://discourse.processing.org/t/how-to-make-an-animation-appear-for-multiple-seconds-when-collison-happens/15698 "2019-11-21T20:31:30Z")

</div>

Hello my name is Julio and i’m an undergraduate student that is new to processing. My question is about how can i make a variable inside of a collision appear for multiple seconds. The code part i need help with is the…

---

## [Strange behavior of code](https://discourse.processing.org/t/strange-behavior-of-code/15682)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.processing.org/u/qwerty)\
**Replies:** 19\
**Last updated:** [November 21, 2019, 3:04pm UTC](https://discourse.processing.org/t/strange-behavior-of-code/15682 "2019-11-21T15:04:35Z")

</div>

Hello. Today i’ve searching the Internet for the new Processing tutorials and found this one: void setup() { size(400, 400); background(#3355CC); } void draw() { fill(#3355CC, 20); rect(0, 0, width, he…

---

## [Responsive Image possible?](https://discourse.processing.org/t/responsive-image-possible/15686)

<div class="topic-metadata">

**Author:** [@lail](https://discourse.processing.org/u/lail)\
**Replies:** 4\
**Last updated:** [November 21, 2019, 12:14pm UTC](https://discourse.processing.org/t/responsive-image-possible/15686 "2019-11-21T12:14:20Z")

</div>

Hi :slight\_smile: I made a sketch on open processing.org and I wanted to send the link to different devices like Mobilephone or Computer with different resolutions. So I gave the canvas the fullScreen(); command. Now th…

---

## [How to draw a ring?](https://discourse.processing.org/t/how-to-draw-a-ring/3873)

<div class="topic-metadata">

**Author:** [@colaps](https://discourse.processing.org/u/colaps)\
**Replies:** 5\
**Last updated:** [November 21, 2019, 10:11am UTC](https://discourse.processing.org/t/how-to-draw-a-ring/3873 "2019-11-21T10:11:46Z")

</div>

Hi everybody, As a newbie in Processing, I try to draw a “ring”… (because English is not my native language I have to clarify what is a “ring” for me: a circle with a hole at the center, like a donut :slight\_smile:). M…

---

## [I am confused on why my code won't work](https://discourse.processing.org/t/i-am-confused-on-why-my-code-wont-work/15648)

<div class="topic-metadata">

**Author:** [@Silly\_bois](https://discourse.processing.org/u/Silly_bois)\
**Replies:** 2\
**Last updated:** [November 20, 2019, 1:09pm UTC](https://discourse.processing.org/t/i-am-confused-on-why-my-code-wont-work/15648 "2019-11-20T13:09:52Z")

</div>

int mode = 0; int INTRO = 0; int levelone = 1; int GAME\_OVER = 2; int fontcolor; float speed = 3; void setup () { background(0); size(1440, 900); fontcolor = color( 0, 225, 149); } void draw () { if (mode == IN…

---

## [Only countdown when mouse at a certain position](https://discourse.processing.org/t/only-countdown-when-mouse-at-a-certain-position/15635)

<div class="topic-metadata">

**Author:** [@kinglucas](https://discourse.processing.org/u/kinglucas)\
**Replies:** 1\
**Last updated:** [November 19, 2019, 2:21pm UTC](https://discourse.processing.org/t/only-countdown-when-mouse-at-a-certain-position/15635 "2019-11-19T14:21:08Z")

</div>

I want a countdown timer only when the mouse is on the bottom left rectangle the timer counts down and if you are not in that part it doesnt count down. Thank you in advance. // IMPORTANT!!! READ BELOW // Every scene is…

---

## [Text output in 3d using various rotations: text letters bounding box becomes not transparent](https://discourse.processing.org/t/text-output-in-3d-using-various-rotations-text-letters-bounding-box-becomes-not-transparent/15629)

<div class="topic-metadata">

**Author:** [@add02one](https://discourse.processing.org/u/add02one)\
**Replies:** 2\
**Last updated:** [November 19, 2019, 2:56am UTC](https://discourse.processing.org/t/text-output-in-3d-using-various-rotations-text-letters-bounding-box-becomes-not-transparent/15629 "2019-11-19T02:56:36Z")

</div>

hi, i’m trying to output text in 3d using various rotations and subsequent text’s bounding box starts hiding the text below. This is my code, very simple. Is there a way to fix this? Thanks in advance! void setup() …

---

## [How to print one rectangle at a time vs all at once?](https://discourse.processing.org/t/how-to-print-one-rectangle-at-a-time-vs-all-at-once/15617)

<div class="topic-metadata">

**Author:** [@ballinoates](https://discourse.processing.org/u/ballinoates)\
**Replies:** 4\
**Last updated:** [November 19, 2019, 2:53am UTC](https://discourse.processing.org/t/how-to-print-one-rectangle-at-a-time-vs-all-at-once/15617 "2019-11-19T02:53:54Z")

</div>

Hi all- n00b here, trying to learn this fantastic language but am having some trouble. I am taking this one step at a time but am missing something. My end idea is to have 100x100 pix rect’s fade in and fade out in rand…

---

## [Need help with supervised learning in neuronal networks](https://discourse.processing.org/t/need-help-with-supervised-learning-in-neuronal-networks/15585)

<div class="topic-metadata">

**Author:** [@NumericPrime](https://discourse.processing.org/u/NumericPrime)\
**Replies:** 5\
**Last updated:** [November 18, 2019, 11:58pm UTC](https://discourse.processing.org/t/need-help-with-supervised-learning-in-neuronal-networks/15585 "2019-11-18T23:58:18Z")

</div>

Hi I’m trying to programm a neuronal Network but as I looked for some functions for the change of weights to make the programm learn. Here is my code so far: class Neuron { int \_x, \_y; int id; float\[\] weights; f…

---

## [Null pointer exception on hashmap](https://discourse.processing.org/t/null-pointer-exception-on-hashmap/15627)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 1\
**Last updated:** [November 18, 2019, 10:58pm UTC](https://discourse.processing.org/t/null-pointer-exception-on-hashmap/15627 "2019-11-18T22:58:39Z")

</div>

I’m initialising a hashmap in a constructor Menu(float xx, float yy, float ww, float hh){ x = xx; y = yy; w = ww; h = hh; xoff = 0; yoff = 0; toggle =0; values = new HashMap\<String,B…

---

## [Simple dialogue system](https://discourse.processing.org/t/simple-dialogue-system/15616)

<div class="topic-metadata">

**Author:** [@kinglucas](https://discourse.processing.org/u/kinglucas)\
**Replies:** 6\
**Last updated:** [November 18, 2019, 8:47pm UTC](https://discourse.processing.org/t/simple-dialogue-system/15616 "2019-11-18T20:47:47Z")

</div>

I wanted to have a symple dialogue system for my game but I don’t know how to make the first text appear on click and then the next piece of text if you click again. int scene = 1; void setup() { size(800, 600); } v…

---

## [Void draw() again?](https://discourse.processing.org/t/void-draw-again/15610)

<div class="topic-metadata">

**Author:** [@vanoevelenstef](https://discourse.processing.org/u/vanoevelenstef)\
**Replies:** 4\
**Last updated:** [November 18, 2019, 3:36pm UTC](https://discourse.processing.org/t/void-draw-again/15610 "2019-11-18T15:36:31Z")

</div>

Hey, I’ve created a composition in void draw and when I pressed ‘r’ I would like that void draw() goes again so that I can have some random examples before I save it. But can’t figure out how to run void draw() again. So…

---

## [QuadraticPoint?](https://discourse.processing.org/t/quadraticpoint/15604)

<div class="topic-metadata">

**Author:** [@Darkar25](https://discourse.processing.org/u/Darkar25)\
**Replies:** 5\
**Last updated:** [November 18, 2019, 2:47pm UTC](https://discourse.processing.org/t/quadraticpoint/15604 "2019-11-18T14:47:39Z")

</div>

We have beizerPoint and curvePoint…but we dont have quadraticPoint…why?..and there is any way to make this function?thx

---

## [Plotting Lissajous Figures](https://discourse.processing.org/t/plotting-lissajous-figures/15567)

<div class="topic-metadata">

**Author:** [@pandl](https://discourse.processing.org/u/pandl)\
**Replies:** 5\
**Last updated:** [November 18, 2019, 11:41am UTC](https://discourse.processing.org/t/plotting-lissajous-figures/15567 "2019-11-18T11:41:51Z")

</div>

Thank you for reading this. I’ve spent most of the day on this and although the code basically works the result is pretty rough. Can anyone suggest how I might smooth out the resulting curve? float a = 0.0; float inc =…

---

## [Interacting Objects (P3)](https://discourse.processing.org/t/interacting-objects-p3/15600)

<div class="topic-metadata">

**Author:** [@JigKSaw](https://discourse.processing.org/u/JigKSaw)\
**Replies:** 4\
**Last updated:** [November 18, 2019, 11:18am UTC](https://discourse.processing.org/t/interacting-objects-p3/15600 "2019-11-18T11:18:30Z")

</div>

Hi everyone. I am trying to build up a little game: a labyrinth in which two images move (both make the same move with the same input keyCode). I did make the labyrinth, uploaded the images and created the “joypad”. Now…

---

## [Colouring pixels](https://discourse.processing.org/t/colouring-pixels/15551)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 25\
**Last updated:** [November 18, 2019, 8:15am UTC](https://discourse.processing.org/t/colouring-pixels/15551 "2019-11-18T08:15:50Z")

</div>

I want to colour the pixels of a 255 px x 255 px square so the x axis (left to right) shows red from 0 to 255 and the y axis (top to bottom) shows green from 0 to 255. This is only the first step of an ambitious proje…

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

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