# Coding Questions

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

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

**Page:** 90

---

## [I have a problem with the menu of my game](https://discourse.processing.org/t/i-have-a-problem-with-the-menu-of-my-game/21826)

<div class="topic-metadata">

**Author:** [@OohYuma](https://discourse.processing.org/u/OohYuma)\
**Replies:** 5\
**Last updated:** [June 14, 2020, 9:29am UTC](https://discourse.processing.org/t/i-have-a-problem-with-the-menu-of-my-game/21826 "2020-06-14T09:29:29Z")

</div>

Hi guys, I’m a beginner with processing and others languages. I started to do a Snake game for my exam but I have a problem with my code. When I’m in the menu, I can select to play (pic.1) or to go in the setting(pic.2) …

---

## [3d Random Walker export-as-dxf](https://discourse.processing.org/t/3d-random-walker-export-as-dxf/21847)

<div class="topic-metadata">

**Author:** [@andresobregonl](https://discourse.processing.org/u/andresobregonl)\
**Replies:** 1\
**Last updated:** [June 13, 2020, 8:24pm UTC](https://discourse.processing.org/t/3d-random-walker-export-as-dxf/21847 "2020-06-13T20:24:19Z")

</div>

Hello I am trying to write a 3d random Walker P3D But I do not achieve to export all the boxes as .dxf my goal is to be able to open the file in Rhino and export it as .stl and send it to a 3d Printing I will apprecia…

---

## [Shading a polygon PShape](https://discourse.processing.org/t/shading-a-polygon-pshape/21833)

<div class="topic-metadata">

**Author:** [@opheliagame](https://discourse.processing.org/u/opheliagame)\
**Replies:** 1\
**Last updated:** [June 13, 2020, 3:50pm UTC](https://discourse.processing.org/t/shading-a-polygon-pshape/21833 "2020-06-13T15:50:34Z")

</div>

I am making a custom PShape and setting different colors to the different vertices. From my experimentation, I have understod that the PShape is triangulated and the colors given to the different vertices are interpolate…

---

## [Display Basics program](https://discourse.processing.org/t/display-basics-program/21808)

<div class="topic-metadata">

**Author:** [@mike\_z](https://discourse.processing.org/u/mike_z)\
**Replies:** 13\
**Last updated:** [June 13, 2020, 11:30am UTC](https://discourse.processing.org/t/display-basics-program/21808 "2020-06-13T11:30:16Z")

</div>

I a beginner with processing, but have had experience with coding in other languages. I am attempting to make a block of cyan color walk across a blue back gound in three steps. For some reason the first two blocks will …

---

## [Can Processing use MacOS X's native Picture-in-Picture (PIP) mode?](https://discourse.processing.org/t/can-processing-use-macos-xs-native-picture-in-picture-pip-mode/21806)

<div class="topic-metadata">

**Author:** [@DerTarchin](https://discourse.processing.org/u/DerTarchin)\
**Replies:** 1\
**Last updated:** [June 13, 2020, 11:03am UTC](https://discourse.processing.org/t/can-processing-use-macos-xs-native-picture-in-picture-pip-mode/21806 "2020-06-13T11:03:14Z")

</div>

I’m not sure how to do it and I see no references to it in the forums. Am I able to take advantage of the native PIP with Processing? Here is an example of what I’m talking about

---

## [Stopping the game when touching sides pong game](https://discourse.processing.org/t/stopping-the-game-when-touching-sides-pong-game/21810)

<div class="topic-metadata">

**Author:** [@mrporcessing](https://discourse.processing.org/u/mrporcessing)\
**Replies:** 3\
**Last updated:** [June 13, 2020, 10:48am UTC](https://discourse.processing.org/t/stopping-the-game-when-touching-sides-pong-game/21810 "2020-06-13T10:48:27Z")

</div>

Hi, I just need help trying to stop the game, if the ball touches the left or right side of the screen and not the paddles. here is my code: int x,y,w,h,speedX,speedY;//circle variables int paddleX, paddleY,paddlew,padd…

---

## [I need to embed processing code in my Wordpress](https://discourse.processing.org/t/i-need-to-embed-processing-code-in-my-wordpress/20944)

<div class="topic-metadata">

**Author:** [@cndae](https://discourse.processing.org/u/cndae)\
**Replies:** 16\
**Last updated:** [June 13, 2020, 1:46am UTC](https://discourse.processing.org/t/i-need-to-embed-processing-code-in-my-wordpress/20944 "2020-06-13T01:46:18Z")

</div>

Hi there! I need to insert a processing code in wordpress, but I’m going crazy and I can’t do it. Does anyone know how I can do it? Thanks

---

## [Is it possible to not have the generic windows close buttons and make your own close button?](https://discourse.processing.org/t/is-it-possible-to-not-have-the-generic-windows-close-buttons-and-make-your-own-close-button/2013)

<div class="topic-metadata">

**Author:** [@Shimo](https://discourse.processing.org/u/Shimo)\
**Replies:** 6\
**Last updated:** [June 12, 2020, 8:06pm UTC](https://discourse.processing.org/t/is-it-possible-to-not-have-the-generic-windows-close-buttons-and-make-your-own-close-button/2013 "2020-06-12T20:06:00Z")

</div>

So I’m talking about applications like discord, they don’t have that ugly windows border around their application, the league of legends client also doesn’t have it, Photoshop also has a custom one. So I know it’s possib…

---

## [Sharing PImage or PGraphics between nested Applets](https://discourse.processing.org/t/sharing-pimage-or-pgraphics-between-nested-applets/21793)

<div class="topic-metadata">

**Author:** [@johnbentcope](https://discourse.processing.org/u/johnbentcope)\
**Replies:** 5\
**Last updated:** [June 12, 2020, 6:35pm UTC](https://discourse.processing.org/t/sharing-pimage-or-pgraphics-between-nested-applets/21793 "2020-06-12T18:35:39Z")

</div>

I’m attempting to write an application that will stream a single incoming video feed to both eyes using an Oculus Rift DK2. In Linux, I’ve configured the Rift as a second monitor. Thanks to another topic on here, I’m abl…

---

## [ArrayList with boolean type crashing on use of the .get function](https://discourse.processing.org/t/arraylist-with-boolean-type-crashing-on-use-of-the-get-function/21807)

<div class="topic-metadata">

**Author:** [@TheEternalDragon](https://discourse.processing.org/u/TheEternalDragon)\
**Replies:** 2\
**Last updated:** [June 12, 2020, 3:18pm UTC](https://discourse.processing.org/t/arraylist-with-boolean-type-crashing-on-use-of-the-get-function/21807 "2020-06-12T15:18:24Z")

</div>

I am trying to use an arraylist of booleans but when using the .get function on the array the program crashes, so I figured I should have iniatilized the values however when trying to do so it simply seems to skip over t…

---

## [Help color movement](https://discourse.processing.org/t/help-color-movement/21764)

<div class="topic-metadata">

**Author:** [@marika20](https://discourse.processing.org/u/marika20)\
**Replies:** 9\
**Last updated:** [June 12, 2020, 12:21pm UTC](https://discourse.processing.org/t/help-color-movement/21764 "2020-06-12T12:21:01Z")

</div>

Ciao a tutti! Ho bisogno di un suggerimento per il mio lavoro: devo far in modo che le mie linee insieme ai miei rect() si muovano nel seguente modo: il mio codice è il seguente: color red = #FF0004; color yellow = …

---

## [Linee e Background](https://discourse.processing.org/t/linee-e-background/21802)

<div class="topic-metadata">

**Author:** [@marika20](https://discourse.processing.org/u/marika20)\
**Replies:** 3\
**Last updated:** [June 12, 2020, 12:20pm UTC](https://discourse.processing.org/t/linee-e-background/21802 "2020-06-12T12:20:23Z")

</div>

Ciao a tutti, ho un problema con il movimento di una linea: non capisco perchè se io voglio una linea che si muova a dx e a sin nel mio sketch questa si muove creando dello spazio bianco? color red = #FF0004; color yell…

---

## [Shared PGraphics instances - drawing](https://discourse.processing.org/t/shared-pgraphics-instances-drawing/21801)

<div class="topic-metadata">

**Author:** [@mgood7123](https://discourse.processing.org/u/mgood7123)\
**Replies:** 2\
**Last updated:** [June 12, 2020, 10:56am UTC](https://discourse.processing.org/t/shared-pgraphics-instances-drawing/21801 "2020-06-12T10:56:12Z")

</div>

NOTE: https://discourse.processing.org/t/pgraphics-begindraw-pgraphics-enddraw-alternatives/21769 how would i go about drawing to a shared PGraphics instance in the context each window that obtains the PGraphics instanc…

---

## [beginDraw endDraw optimizing (trying to reduce the amount of beginDraw endDraw calls required) fails to render](https://discourse.processing.org/t/begindraw-enddraw-optimizing-trying-to-reduce-the-amount-of-begindraw-enddraw-calls-required-fails-to-render/21803)

<div class="topic-metadata">

**Author:** [@mgood7123](https://discourse.processing.org/u/mgood7123)\
**Replies:** 0\
**Last updated:** [June 12, 2020, 10:51am UTC](https://discourse.processing.org/t/begindraw-enddraw-optimizing-trying-to-reduce-the-amount-of-begindraw-enddraw-calls-required-fails-to-render/21803 "2020-06-12T10:51:38Z")

</div>

in the following code Compositor compositor; void settings() { //fullScreen(P3D); // 31 fps size(400, 400, P3D); // 60 fps } class Applications\_Cube extends Window { @Override void draw() { graphics.lig…

---

## [Can anybody help me to make this code have possibility to add multiple images?](https://discourse.processing.org/t/can-anybody-help-me-to-make-this-code-have-possibility-to-add-multiple-images/21770)

<div class="topic-metadata">

**Author:** [@Cassius](https://discourse.processing.org/u/Cassius)\
**Replies:** 10\
**Last updated:** [June 12, 2020, 10:33am UTC](https://discourse.processing.org/t/can-anybody-help-me-to-make-this-code-have-possibility-to-add-multiple-images/21770 "2020-06-12T10:33:54Z")

</div>

Hello everybody I am still new in processing so go easy on me,I have found this code and have been trying how to make so that I can add multiple images to this sketch and on mouswheel() it changes images.I would appreci…

---

## [Bouncing ball with paddle](https://discourse.processing.org/t/bouncing-ball-with-paddle/21798)

<div class="topic-metadata">

**Author:** [@mrporcessing](https://discourse.processing.org/u/mrporcessing)\
**Replies:** 1\
**Last updated:** [June 12, 2020, 9:03am UTC](https://discourse.processing.org/t/bouncing-ball-with-paddle/21798 "2020-06-12T09:03:30Z")

</div>

Hi, I just need it so that the ball will bounce off the two paddles. I don’t know the proper code for it. Code: int x,y,w,h,speedX,speedY;//circle variables int paddleX, paddleY,paddlew,paddleH,paddleS,paddleX2,paddleY…

---

## [Need help with some GLSL shader code](https://discourse.processing.org/t/need-help-with-some-glsl-shader-code/21655)

<div class="topic-metadata">

**Author:** [@zenglenn](https://discourse.processing.org/u/zenglenn)\
**Replies:** 4\
**Last updated:** [June 12, 2020, 6:41am UTC](https://discourse.processing.org/t/need-help-with-some-glsl-shader-code/21655 "2020-06-12T06:41:13Z")

</div>

Hi I want to use Processing shaders to do some code art algorithms - but I want to do it all through a shader to take advantage of the high GPU power. I know the basics of shader programming, but what I’m stuck on at t…

---

## [Randomly Appearing Objects When Something Is Clicked](https://discourse.processing.org/t/randomly-appearing-objects-when-something-is-clicked/21792)

<div class="topic-metadata">

**Author:** [@chemicalite](https://discourse.processing.org/u/chemicalite)\
**Replies:** 8\
**Last updated:** [June 12, 2020, 2:12am UTC](https://discourse.processing.org/t/randomly-appearing-objects-when-something-is-clicked/21792 "2020-06-12T02:12:07Z")

</div>

Hey everyone! I’m currently working on a coding project and needed a bit of help on how to do something. I want to be able to have a different “text box” appear every time the user clicks the corner of the canvas. The t…

---

## [Mapping a point a "sub" matrix to main/default matrix?](https://discourse.processing.org/t/mapping-a-point-a-sub-matrix-to-main-default-matrix/21568)

<div class="topic-metadata">

**Author:** [@Perro](https://discourse.processing.org/u/Perro)\
**Replies:** 6\
**Last updated:** [June 11, 2020, 9:31pm UTC](https://discourse.processing.org/t/mapping-a-point-a-sub-matrix-to-main-default-matrix/21568 "2020-06-11T21:31:46Z")

</div>

Hi, Can anyone advise how to map a point, calculated within a matrix, to a point in the “main” (top-level) matrix? More specifically, I have a situation where separate points are calculated within two separate matrices…

---

## [pGraphics.beginDraw() RuntimeException: Too many pushFramebuffer calls](https://discourse.processing.org/t/pgraphics-begindraw-runtimeexception-too-many-pushframebuffer-calls/21765)

<div class="topic-metadata">

**Author:** [@mgood7123](https://discourse.processing.org/u/mgood7123)\
**Replies:** 2\
**Last updated:** [June 11, 2020, 9:18pm UTC](https://discourse.processing.org/t/pgraphics-begindraw-runtimeexception-too-many-pushframebuffer-calls/21765 "2020-06-11T21:18:44Z")

</div>

why would i get RuntimeException: Too many pushFramebuffer calls when calling window.graphics = createGraphics(window.width, window.height, type); window.graphics.beginDraw(); java.lang.RuntimeExcepti…

---

## [Scoped beginDraw and endDraw](https://discourse.processing.org/t/scoped-begindraw-and-enddraw/21767)

<div class="topic-metadata">

**Author:** [@mgood7123](https://discourse.processing.org/u/mgood7123)\
**Replies:** 1\
**Last updated:** [June 11, 2020, 6:24pm UTC](https://discourse.processing.org/t/scoped-begindraw-and-enddraw/21767 "2020-06-11T18:24:52Z")

</div>

is there any way to use PGraphics.beginDraw and PGraphics.endDraw outside of the scope of PGraphics.\*() calls? for example if i do this then nothing renders void drawGraphics() { //graphics.endDraw(); if (dis…

---

## [Performance - draw vs redraw](https://discourse.processing.org/t/performance-draw-vs-redraw/21763)

<div class="topic-metadata">

**Author:** [@mgood7123](https://discourse.processing.org/u/mgood7123)\
**Replies:** 5\
**Last updated:** [June 11, 2020, 6:16pm UTC](https://discourse.processing.org/t/performance-draw-vs-redraw/21763 "2020-06-11T18:16:26Z")

</div>

when would it be good to use draw() and when would it be good to use redraw() and could a program ran via a main draw() loop be made faster by only using a redraw-when-needed approach? if so, is redraw, in a while(true…

---

## [Can I generate a QR code through'processing'?](https://discourse.processing.org/t/can-i-generate-a-qr-code-throughprocessing/21756)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 2\
**Last updated:** [June 11, 2020, 5:36pm UTC](https://discourse.processing.org/t/can-i-generate-a-qr-code-throughprocessing/21756 "2020-06-11T17:36:27Z")

</div>

I want to generate a QR code through the program. Is there a way? Help.

---

## [Off-screen render performance, multiple PGraphics objects](https://discourse.processing.org/t/off-screen-render-performance-multiple-pgraphics-objects/21783)

<div class="topic-metadata">

**Author:** [@mgood7123](https://discourse.processing.org/u/mgood7123)\
**Replies:** 0\
**Last updated:** [June 11, 2020, 5:22pm UTC](https://discourse.processing.org/t/off-screen-render-performance-multiple-pgraphics-objects/21783 "2020-06-11T17:22:24Z")

</div>

how can reduce the time taken to draw all my components? as, specifically, PGraphics.beginDraw() and PGraphics.endDraw() calls are expensive if there are a lot of them in a single call as if i do 400 by 400 i get 60 f…

---

## [Issue with map() function](https://discourse.processing.org/t/issue-with-map-function/21715)

<div class="topic-metadata">

**Author:** [@Th3cG](https://discourse.processing.org/u/Th3cG)\
**Replies:** 6\
**Last updated:** [June 11, 2020, 4:19pm UTC](https://discourse.processing.org/t/issue-with-map-function/21715 "2020-06-11T16:19:30Z")

</div>

Hello, I’m trying to write some code to animate a logo that starts from the left of the screen, then bounces on the right side and stops. My initial sketch works with a width of 640px as follows; PImage logo; float x …

---

## [3rd Person Shooter translate() and camera()](https://discourse.processing.org/t/3rd-person-shooter-translate-and-camera/21633)

<div class="topic-metadata">

**Author:** [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Replies:** 3\
**Last updated:** [June 10, 2020, 10:56pm UTC](https://discourse.processing.org/t/3rd-person-shooter-translate-and-camera/21633 "2020-06-10T22:56:11Z")

</div>

Hello all, I would like to make a 3rd Person Shooter (or 3rd Person Player) where a player in 3D is followed by a camera. Move with mouse and wasd keys. I found a code in the forum. But in the code, the player and ca…

---

## [Warnings using noSmooth() in setup()](https://discourse.processing.org/t/warnings-using-nosmooth-in-setup/21703)

<div class="topic-metadata">

**Author:** [@glv](https://discourse.processing.org/u/glv)\
**Replies:** 6\
**Last updated:** [June 10, 2020, 8:17pm UTC](https://discourse.processing.org/t/warnings-using-nosmooth-in-setup/21703 "2020-06-10T20:17:50Z")

</div>

Hello, Can anyone help me understand what is happening here? Ok: Ok: ? ? ? :)

---

## [GIF Of Inverting a binary Tree](https://discourse.processing.org/t/gif-of-inverting-a-binary-tree/21625)

<div class="topic-metadata">

**Author:** [@sharoha](https://discourse.processing.org/u/sharoha)\
**Replies:** 5\
**Last updated:** [June 10, 2020, 8:04pm UTC](https://discourse.processing.org/t/gif-of-inverting-a-binary-tree/21625 "2020-06-10T20:04:20Z")

</div>

Hi. I am trying to create a gif, for the inversion of a binary tree(swap the left and right child of a node). For that, I have created a sketch of a binary tree first And then I am trying to redraw the tree after swap…

---

## [Manually drawing an oval, in response to a straight mouse drag](https://discourse.processing.org/t/manually-drawing-an-oval-in-response-to-a-straight-mouse-drag/21710)

<div class="topic-metadata">

**Author:** [@ottenm](https://discourse.processing.org/u/ottenm)\
**Replies:** 7\
**Last updated:** [June 10, 2020, 7:41pm UTC](https://discourse.processing.org/t/manually-drawing-an-oval-in-response-to-a-straight-mouse-drag/21710 "2020-06-10T19:41:35Z")

</div>

I wrote a sketch for penning letters and digits on a touchscreen, and then manipulating them. I use it as a teaching tool for young kids. The penning part is trivial, just drawing lines in response to mouse events. I …

---

## [Cannot find solution to: "Could not run the sketch (Target VM failed to initialize)"](https://discourse.processing.org/t/cannot-find-solution-to-could-not-run-the-sketch-target-vm-failed-to-initialize/21732)

<div class="topic-metadata">

**Author:** [@TheEternalDragon](https://discourse.processing.org/u/TheEternalDragon)\
**Replies:** 9\
**Last updated:** [June 10, 2020, 11:14am UTC](https://discourse.processing.org/t/cannot-find-solution-to-could-not-run-the-sketch-target-vm-failed-to-initialize/21732 "2020-06-10T11:14:01Z")

</div>

So I have been getting this error that is stated in the title and I have looked around a bit. The problem often seems to be a library or an nVidea driver however I am not using any nVidea drivers. So I am at a bit of a l…

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

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