# Coding Questions

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

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

**Page:** 39

---

## [Disabling color blending of a shape in P3D](https://discourse.processing.org/t/disabling-color-blending-of-a-shape-in-p3d/33779)

<div class="topic-metadata">

**Author:** [@Lurion](https://discourse.processing.org/u/Lurion)\
**Replies:** 3\
**Last updated:** [November 27, 2021, 6:11pm UTC](https://discourse.processing.org/t/disabling-color-blending-of-a-shape-in-p3d/33779 "2021-11-27T18:11:03Z")

</div>

I got a simple TRIANGLE\_STRIP shape with 3 vertexs. I need to have each triangle with only one solid color, but Processing is blending the colors when I’m on P3d (it works fine on P2D). How can I disable it? void setup…

---

## [Write over live stream video](https://discourse.processing.org/t/write-over-live-stream-video/33766)

<div class="topic-metadata">

**Author:** [@Fotis](https://discourse.processing.org/u/Fotis)\
**Replies:** 1\
**Last updated:** [November 27, 2021, 10:03am UTC](https://discourse.processing.org/t/write-over-live-stream-video/33766 "2021-11-27T10:03:08Z")

</div>

How can different users write words or sentences, at the same time, that appear on a live video streaming?

---

## [How do I increase the speed of a rectangle whenever I press a key?](https://discourse.processing.org/t/how-do-i-increase-the-speed-of-a-rectangle-whenever-i-press-a-key/33731)

<div class="topic-metadata">

**Author:** [@FunkyMan](https://discourse.processing.org/u/FunkyMan)\
**Replies:** 3\
**Last updated:** [November 27, 2021, 8:50am UTC](https://discourse.processing.org/t/how-do-i-increase-the-speed-of-a-rectangle-whenever-i-press-a-key/33731 "2021-11-27T08:50:25Z")

</div>

int X=20; int Y=20; int howBig=20; void setup() { size(700, 700); background(196, 196, 196); } void draw() { background(196, 196, 196); rect(X, Y, howBig, howBig); fill(113, 113, 113); } void keyPressed() { …

---

## [Generate seed while runtime](https://discourse.processing.org/t/generate-seed-while-runtime/33736)

<div class="topic-metadata">

**Author:** [@res56](https://discourse.processing.org/u/res56)\
**Replies:** 1\
**Last updated:** [November 25, 2021, 8:16pm UTC](https://discourse.processing.org/t/generate-seed-while-runtime/33736 "2021-11-25T20:16:37Z")

</div>

Hey guys, how can I create a unique seed while run time to save the script with this seed and use it for random functions. The goal is to have an instance of the script that returns the same result while using random fu…

---

## [Newbie advice... stop a blinking cursor](https://discourse.processing.org/t/newbie-advice-stop-a-blinking-cursor/33734)

<div class="topic-metadata">

**Author:** [@AudioBabble](https://discourse.processing.org/u/AudioBabble)\
**Replies:** 4\
**Last updated:** [November 25, 2021, 8:11pm UTC](https://discourse.processing.org/t/newbie-advice-stop-a-blinking-cursor/33734 "2021-11-25T20:11:24Z")

</div>

I’m totally new to processing and to coding in general. At the moment I’m really not sure if my brain is capable of learning code… have been trying to understand some of the reference section with limited success. I’ve…

---

## [Changing a normal string to camelCase](https://discourse.processing.org/t/changing-a-normal-string-to-camelcase/33744)

<div class="topic-metadata">

**Author:** [@it\_begins](https://discourse.processing.org/u/it_begins)\
**Replies:** 3\
**Last updated:** [November 25, 2021, 12:20pm UTC](https://discourse.processing.org/t/changing-a-normal-string-to-camelcase/33744 "2021-11-25T12:20:38Z")

</div>

Hi, i have to change a set of string to calmelcase i.e removing punctuations and spaces,and capitalizing the first letter of each word… Using only these string functions: charAt(), length(), toUpperCase(), toLowerCase(…

---

## [How to make histogram but the PImage location is not 0, 0](https://discourse.processing.org/t/how-to-make-histogram-but-the-pimage-location-is-not-0-0/33742)

<div class="topic-metadata">

**Author:** [@RNWA](https://discourse.processing.org/u/RNWA)\
**Replies:** 1\
**Last updated:** [November 25, 2021, 12:06pm UTC](https://discourse.processing.org/t/how-to-make-histogram-but-the-pimage-location-is-not-0-0/33742 "2021-11-25T12:06:56Z")

</div>

Hi, im a beginner in processing and tried to make histogram from PImage but the location i want to start it for example 200, 100. I tried play around with it and i got nothing, so pls any help i really appreciate it, and…

---

## [Color Histogram by Greg Borenstein](https://discourse.processing.org/t/color-histogram-by-greg-borenstein/33727)

<div class="topic-metadata">

**Author:** [@RNWA](https://discourse.processing.org/u/RNWA)\
**Replies:** 0\
**Last updated:** [November 24, 2021, 5:10pm UTC](https://discourse.processing.org/t/color-histogram-by-greg-borenstein/33727 "2021-11-24T17:10:47Z")

</div>

Hi guys, recently i download library by Greg Borenstein from his website which was PSVM and i tried to look at his example but his code hasn’t finished yet, and i got Syntax Error - Missing operator after return histogra…

---

## [Why is P3D drawing to the pixel grid wrong?](https://discourse.processing.org/t/why-is-p3d-drawing-to-the-pixel-grid-wrong/33717)

<div class="topic-metadata">

**Author:** [@rodsn](https://discourse.processing.org/u/rodsn)\
**Replies:** 1\
**Last updated:** [November 24, 2021, 2:53pm UTC](https://discourse.processing.org/t/why-is-p3d-drawing-to-the-pixel-grid-wrong/33717 "2021-11-24T14:53:12Z")

</div>

PImage sprite; int size = 10; void setup() { sprite = loadImage("sprite\_10.png"); size(500, 500, P3D); ortho(); noStroke(); noSmooth(); } void draw() { background(255); loadPixels(); sprite.loadPixels(); print…

---

## [ArrayIndexOutOfBoundsException error, using movie](https://discourse.processing.org/t/arrayindexoutofboundsexception-error-using-movie/33682)

<div class="topic-metadata">

**Author:** [@mysterzomb](https://discourse.processing.org/u/mysterzomb)\
**Replies:** 0\
**Last updated:** [November 23, 2021, 1:21am UTC](https://discourse.processing.org/t/arrayindexoutofboundsexception-error-using-movie/33682 "2021-11-23T01:21:17Z")

</div>

Hello! I am trying to make this Daniel Shiffman’s code : MotionPixels | Learning Processing 2nd Edition not with the Capture datatype, but with the Movie so that it reads a video file instead of a device on my computer.…

---

## [Why does my program return the error "ArrayIndex Out Of Bounds Exception: 4"?](https://discourse.processing.org/t/why-does-my-program-return-the-error-arrayindex-out-of-bounds-exception-4/33651)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 11\
**Last updated:** [November 22, 2021, 11:38am UTC](https://discourse.processing.org/t/why-does-my-program-return-the-error-arrayindex-out-of-bounds-exception-4/33651 "2021-11-22T11:38:27Z")

</div>

the number 4 is not in my code so I don’t know why it gives this error. this is my code: String blocked = "iA"; String inlava = "iB"; String nearsick = "iC"; String moverandom = "oA"; String movewest = "oB"; String mo…

---

## [Drag & drop each PGraphics shape](https://discourse.processing.org/t/drag-drop-each-pgraphics-shape/33643)

<div class="topic-metadata">

**Author:** [@rism](https://discourse.processing.org/u/rism)\
**Replies:** 1\
**Last updated:** [November 22, 2021, 6:17am UTC](https://discourse.processing.org/t/drag-drop-each-pgraphics-shape/33643 "2021-11-22T06:17:24Z")

</div>

Hi, I am trying to drag and drop each square rather than the all of the squares when ‘x’ is pressed. PGraphics squares; float bx; float by; boolean locked = false; float xOffset = 0.0; float yOffset = 0.0; void se…

---

## [Faster PImage Resizing](https://discourse.processing.org/t/faster-pimage-resizing/33593)

<div class="topic-metadata">

**Author:** [@TechnicJelle](https://discourse.processing.org/u/TechnicJelle)\
**Replies:** 16\
**Last updated:** [November 21, 2021, 4:46pm UTC](https://discourse.processing.org/t/faster-pimage-resizing/33593 "2021-11-21T16:46:34Z")

</div>

Hi there! I have been scouring the internet for all kinds of ways to resize images in Processing/Java, but they’re all too slow. I only get about 30 fps and my computer ain’t no slouch. The target fps is 60. Every sin…

---

## [How to divide string](https://discourse.processing.org/t/how-to-divide-string/33649)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 5\
**Last updated:** [November 21, 2021, 11:38am UTC](https://discourse.processing.org/t/how-to-divide-string/33649 "2021-11-21T11:38:42Z")

</div>

Let’s say you have a string and the string contains “ab” how could you divide this up into multiple strings, so you would have a string which equals “a” and a string which equals “b”?

---

## [Set portion of an image as another image](https://discourse.processing.org/t/set-portion-of-an-image-as-another-image/33648)

<div class="topic-metadata">

**Author:** [@dnclem106](https://discourse.processing.org/u/dnclem106)\
**Replies:** 2\
**Last updated:** [November 21, 2021, 8:50am UTC](https://discourse.processing.org/t/set-portion-of-an-image-as-another-image/33648 "2021-11-21T08:50:43Z")

</div>

Hi, I have a blank image (just white pixels) that is x, y pixels in width and height respectively. What I need to do is set another smaller image (dimensions (x0, y) where x0 \< x) as a portion of the blank image. In the…

---

## [MousePressed and MouseReleased to create objects](https://discourse.processing.org/t/mousepressed-and-mousereleased-to-create-objects/33628)

<div class="topic-metadata">

**Author:** [@processingArthur](https://discourse.processing.org/u/processingArthur)\
**Replies:** 1\
**Last updated:** [November 20, 2021, 1:35pm UTC](https://discourse.processing.org/t/mousepressed-and-mousereleased-to-create-objects/33628 "2021-11-20T13:35:27Z")

</div>

I have a ball class that creates a ball object. I want to created a ball object when the mouse is pressed, if the mouse is pressed and held the ball should follow the mouse(while the mouse is pressed). When the mouse is …

---

## [Drag and drop each shape of PGraphics](https://discourse.processing.org/t/drag-and-drop-each-shape-of-pgraphics/33622)

<div class="topic-metadata">

**Author:** [@rism](https://discourse.processing.org/u/rism)\
**Replies:** 0\
**Last updated:** [November 19, 2021, 4:29pm UTC](https://discourse.processing.org/t/drag-and-drop-each-shape-of-pgraphics/33622 "2021-11-19T16:29:57Z")

</div>

Hi, I am trying to drag and drop each square rather than the all of the squares when ‘x’ is pressed. Do I need to include a for or while loop somewhere? PGraphics squares; float bx; float by; boolean locked = false; …

---

## [Dropdown list as FilenameFilter in selectFolder() Dialog box](https://discourse.processing.org/t/dropdown-list-as-filenamefilter-in-selectfolder-dialog-box/33571)

<div class="topic-metadata">

**Author:** [@deanomite](https://discourse.processing.org/u/deanomite)\
**Replies:** 1\
**Last updated:** [November 19, 2021, 11:05pm UTC](https://discourse.processing.org/t/dropdown-list-as-filenamefilter-in-selectfolder-dialog-box/33571 "2021-11-19T23:05:24Z")

</div>

Hi guys… been racking my brains over this. I wanted to do a sort of extension filtering much like in the pic here… where the user can select the file extension or type eg: jpg, png, avi, mp4, etc I went down the rout…

---

## [IllegalAccessError: tried to access class processing.core.PApplet$RegisteredMethods from class cc.arduino.Arduino$SerialProxy](https://discourse.processing.org/t/illegalaccesserror-tried-to-access-class-processing-core-papplet-registeredmethods-from-class-cc-arduino-arduino-serialproxy/33598)

<div class="topic-metadata">

**Author:** [@shopdad](https://discourse.processing.org/u/shopdad)\
**Replies:** 0\
**Last updated:** [November 18, 2021, 4:40pm UTC](https://discourse.processing.org/t/illegalaccesserror-tried-to-access-class-processing-core-papplet-registeredmethods-from-class-cc-arduino-arduino-serialproxy/33598 "2021-11-18T16:40:25Z")

</div>

I have a fairly basic Processing program I made in 2013 to controll solenoids using an arduino card with FirmatA installed. the original worked very well but is having issues with windows 10. I wanted to update it from…

---

## [Please explain to me this strange behavior of Visual Studio Code Thank you](https://discourse.processing.org/t/please-explain-to-me-this-strange-behavior-of-visual-studio-code-thank-you/33591)

<div class="topic-metadata">

**Author:** [@Hiram-Belgium](https://discourse.processing.org/u/Hiram-Belgium)\
**Replies:** 0\
**Last updated:** [November 18, 2021, 8:16am UTC](https://discourse.processing.org/t/please-explain-to-me-this-strange-behavior-of-visual-studio-code-thank-you/33591 "2021-11-18T08:16:26Z")

</div>

Excuse my bad English. Hello, as I am a novice I will try to explain what has been ruining my life for days. In Visual Studio Code - I am running a js program with "live server: open with live server … and, the code do…

---

## [Create and Run .bat file for FFMPEG code](https://discourse.processing.org/t/create-and-run-bat-file-for-ffmpeg-code/33482)

<div class="topic-metadata">

**Author:** [@deanomite](https://discourse.processing.org/u/deanomite)\
**Replies:** 6\
**Last updated:** [November 18, 2021, 6:20am UTC](https://discourse.processing.org/t/create-and-run-bat-file-for-ffmpeg-code/33482 "2021-11-18T06:20:41Z")

</div>

Hi guys, Was trying to create a sort of batch process to convert some AVI files to MP4 through FFMPEG. I am able to create a .bat which I want to see run directly after creation. I have tried launch() and exec() too bu…

---

## [Can I use a Google font in an offline sketch without downloading it locally?](https://discourse.processing.org/t/can-i-use-a-google-font-in-an-offline-sketch-without-downloading-it-locally/33583)

<div class="topic-metadata">

**Author:** [@Amenhotep](https://discourse.processing.org/u/Amenhotep)\
**Replies:** 0\
**Last updated:** [November 17, 2021, 9:36pm UTC](https://discourse.processing.org/t/can-i-use-a-google-font-in-an-offline-sketch-without-downloading-it-locally/33583 "2021-11-17T21:36:54Z")

</div>

Hi there! I need to distribute a sketch to my students as a one-file app (html file including everything). As long as I use only 2D, it works great. But now I want to have a rotating cube with labels attached to some co…

---

## [Editor.p5js.org present mode disappeared - how to create transparent iframe?](https://discourse.processing.org/t/editor-p5js-org-present-mode-disappeared-how-to-create-transparent-iframe/33580)

<div class="topic-metadata">

**Author:** [@yarinbh](https://discourse.processing.org/u/yarinbh)\
**Replies:** 0\
**Last updated:** [November 17, 2021, 8:21pm UTC](https://discourse.processing.org/t/editor-p5js-org-present-mode-disappeared-how-to-create-transparent-iframe/33580 "2021-11-17T20:21:20Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hey, i add an iframe from p5js to my site and now when they delete the present mode the iframe dosent transparent any more. can i do something t…

---

## [Add Column on csv file](https://discourse.processing.org/t/add-column-on-csv-file/33572)

<div class="topic-metadata">

**Author:** [@anwar05](https://discourse.processing.org/u/anwar05)\
**Replies:** 6\
**Last updated:** [November 17, 2021, 2:19pm UTC](https://discourse.processing.org/t/add-column-on-csv-file/33572 "2021-11-17T14:19:41Z")

</div>

I want to save data in tabular form and want to save it in excel (csv) form, I have checked references and also tried examples from the internet, there are no errors, but when I addColumn (title) no new column is formed …

---

## [Text Converter (DESPERATE NEED!)](https://discourse.processing.org/t/text-converter-desperate-need/33411)

<div class="topic-metadata">

**Author:** [@processingboy1](https://discourse.processing.org/u/processingboy1)\
**Replies:** 10\
**Last updated:** [November 16, 2021, 11:22am UTC](https://discourse.processing.org/t/text-converter-desperate-need/33411 "2021-11-16T11:22:52Z")

</div>

in desperate need, will depend whether i fail or pass the course!!! Due date is very near! No use of Arrays.

---

## [How to DETECT COLORS from CAMERA CAPTURE and OUTPUT them?](https://discourse.processing.org/t/how-to-detect-colors-from-camera-capture-and-output-them/33550)

<div class="topic-metadata">

**Author:** [@badbatman](https://discourse.processing.org/u/badbatman)\
**Replies:** 0\
**Last updated:** [November 16, 2021, 12:54pm UTC](https://discourse.processing.org/t/how-to-detect-colors-from-camera-capture-and-output-them/33550 "2021-11-16T12:54:02Z")

</div>

How can I gain the colors from a camera capture and output them in swatches? What are the steps to do this? Something like this: https://www.youtube.com/watch?v=EyuqP43jkQ8 but then with Processing instead of JS. impo…

---

## [Filling grid cells inside a shape](https://discourse.processing.org/t/filling-grid-cells-inside-a-shape/33427)

<div class="topic-metadata">

**Author:** [@tribblesontoast](https://discourse.processing.org/u/tribblesontoast)\
**Replies:** 8\
**Last updated:** [November 16, 2021, 7:26am UTC](https://discourse.processing.org/t/filling-grid-cells-inside-a-shape/33427 "2021-11-16T07:26:36Z")

</div>

Hi all, I’m writing a program that visualises text from posters as a heatmap. I draw shapes around the titles of the posters and each of these positions is saved as a PVector. In order to visualise these on the heatma…

---

## [Processing 3 Object Class not Being Displayed](https://discourse.processing.org/t/processing-3-object-class-not-being-displayed/33508)

<div class="topic-metadata">

**Author:** [@sebest\_design](https://discourse.processing.org/u/sebest_design)\
**Replies:** 2\
**Last updated:** [November 14, 2021, 9:49pm UTC](https://discourse.processing.org/t/processing-3-object-class-not-being-displayed/33508 "2021-11-14T21:49:55Z")

</div>

Hi. I am a total noob to object classes. I do not know what I am doing wrong. Here’s an image of the prototype: I am trying to create an object class for the encircled cards. I have saved the class on a separate pag…

---

## [Processing 3 Translate and Rotate function taking triangle out of canvas](https://discourse.processing.org/t/processing-3-translate-and-rotate-function-taking-triangle-out-of-canvas/33509)

<div class="topic-metadata">

**Author:** [@sebest\_design](https://discourse.processing.org/u/sebest_design)\
**Replies:** 1\
**Last updated:** [November 14, 2021, 6:14pm UTC](https://discourse.processing.org/t/processing-3-translate-and-rotate-function-taking-triangle-out-of-canvas/33509 "2021-11-14T18:14:34Z")

</div>

Hi. I am trying to horizontally flip a triangle and have it placed on the canvas. I want to create buttons for a carousel slide… Here’s the code: //Buttons noStroke(); triangle(triangleRX1, triangleRY1, triangleRX2and3,…

---

## [Get alpha value from pixels array](https://discourse.processing.org/t/get-alpha-value-from-pixels-array/33479)

<div class="topic-metadata">

**Author:** [@bobodoustaud](https://discourse.processing.org/u/bobodoustaud)\
**Replies:** 3\
**Last updated:** [November 13, 2021, 11:15pm UTC](https://discourse.processing.org/t/get-alpha-value-from-pixels-array/33479 "2021-11-13T23:15:14Z")

</div>

So i opened a png with transparent pixels in a new PGraphics object. If i load it and render it in the main canvas, it has transparency, which means that the PGraphics background is transparent. But if i create a pixel …

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

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