# Beginners

**URL:** https://discourse.processing.org/c/processing/processing-beginners/14.md?page=3

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

**Page:** 4

---

## [Hello, just interesting b is link to a?](https://discourse.processing.org/t/hello-just-interesting-b-is-link-to-a/44376)

<div class="topic-metadata">

**Author:** [@zlfp](https://discourse.processing.org/u/zlfp)\
**Replies:** 3\
**Last updated:** [May 3, 2024, 2:24pm UTC](https://discourse.processing.org/t/hello-just-interesting-b-is-link-to-a/44376 "2024-05-03T14:24:44Z")

</div>

just interesting if we like do that int\[\] a = {1,2,3}; int\[\] b = a; b is link to a, or b is {1,2,3}? and if we redact b (if its link), we redact b or a? anyways, thanx

---

## [Using array of images to spawn enemies in game](https://discourse.processing.org/t/using-array-of-images-to-spawn-enemies-in-game/44341)

<div class="topic-metadata">

**Author:** [@dsdsdsds](https://discourse.processing.org/u/dsdsdsds)\
**Replies:** 9\
**Last updated:** [April 30, 2024, 8:48pm UTC](https://discourse.processing.org/t/using-array-of-images-to-spawn-enemies-in-game/44341 "2024-04-30T20:48:43Z")

</div>

Hi, I’m new to Processing and I’m trying to create a part of the game where enemies appear on the left side of the screen and move towards the right side of the screen in a 5 second interval. I’m using an array of image…

---

## [New tab in Processing](https://discourse.processing.org/t/new-tab-in-processing/44330)

<div class="topic-metadata">

**Author:** [@Simon1](https://discourse.processing.org/u/Simon1)\
**Replies:** 6\
**Last updated:** [April 22, 2024, 7:57pm UTC](https://discourse.processing.org/t/new-tab-in-processing/44330 "2024-04-22T19:57:25Z")

</div>

Can someone please tell how to add code to a new tab please?

---

## [Why is hex(255,2) != hex(255,2)?](https://discourse.processing.org/t/why-is-hex-255-2-hex-255-2/44274)

<div class="topic-metadata">

**Author:** [@bbcwarrior](https://discourse.processing.org/u/bbcwarrior)\
**Replies:** 1\
**Last updated:** [April 14, 2024, 12:15am UTC](https://discourse.processing.org/t/why-is-hex-255-2-hex-255-2/44274 "2024-04-14T00:15:47Z")

</div>

Why doesn’t this piece of code output anything: if(hex(255,2) == hex(255,2)) { println("foo"); } But this one does?: if(unhex(hex(255,2)) == unhex(hex(255,2))) { println("bar"); }

---

## [Where can I find the Java source code for the delay() method?](https://discourse.processing.org/t/where-can-i-find-the-java-source-code-for-the-delay-method/44222)

<div class="topic-metadata">

**Author:** [@sspboyd](https://discourse.processing.org/u/sspboyd)\
**Replies:** 4\
**Last updated:** [April 3, 2024, 7:33pm UTC](https://discourse.processing.org/t/where-can-i-find-the-java-source-code-for-the-delay-method/44222 "2024-04-03T19:33:19Z")

</div>

I am trying to learn a little about the Processing source code for the delay() method. I have tried searching through the GitHub repo without any success. Any suggestions? Thanks, Stephen

---

## [Toggling fullscreen](https://discourse.processing.org/t/toggling-fullscreen/44121)

<div class="topic-metadata">

**Author:** [@ripolas](https://discourse.processing.org/u/ripolas)\
**Replies:** 7\
**Last updated:** [March 20, 2024, 7:40pm UTC](https://discourse.processing.org/t/toggling-fullscreen/44121 "2024-03-20T19:40:03Z")

</div>

Hello, i couldn’t find anything useful on the topic about toggling fullscreen (like F11 in browsers for example). Also how do i run a windowed sketch at the size of the screen? Because if I try this: void setup(){ siz…

---

## [How do I export an image to a transparent background](https://discourse.processing.org/t/how-do-i-export-an-image-to-a-transparent-background/44111)

<div class="topic-metadata">

**Author:** [@W24](https://discourse.processing.org/u/W24)\
**Replies:** 2\
**Last updated:** [March 17, 2024, 2:02pm UTC](https://discourse.processing.org/t/how-do-i-export-an-image-to-a-transparent-background/44111 "2024-03-17T14:02:28Z")

</div>

Hi there - I have made a simple design . I would like to modify this code to save this image as a PNG with a transparent background. Can anyone help me? Thanks! \< PImage pic; void setup(){ size(600,1000); backgro…

---

## [Shameful plug: I printed my course on paper ... feedback please](https://discourse.processing.org/t/shameful-plug-i-printed-my-course-on-paper-feedback-please/44091)

<div class="topic-metadata">

**Author:** [@codeguppy](https://discourse.processing.org/u/codeguppy)\
**Replies:** 1\
**Last updated:** [March 13, 2024, 1:42am UTC](https://discourse.processing.org/t/shameful-plug-i-printed-my-course-on-paper-feedback-please/44091 "2024-03-13T01:42:04Z")

</div>

Hello all, I made a dry run and printed my coding course on paper. It has almost 700 pages of illustrated JavaScript content. https://www.youtube.com/shorts/745fht2RL7g What’s your opinion about this?

---

## [Weird randomSeed() behaviour](https://discourse.processing.org/t/weird-randomseed-behaviour/44052)

<div class="topic-metadata">

**Author:** [@ripolas](https://discourse.processing.org/u/ripolas)\
**Replies:** 4\
**Last updated:** [March 8, 2024, 5:46pm UTC](https://discourse.processing.org/t/weird-randomseed-behaviour/44052 "2024-03-08T17:46:36Z")

</div>

Hey, so I found this weird thing while experimenting with randomSeed(); void setup(){ for(int i = -100;i\<100;i++){ randomSeed(i); println(i,int(random(100))); } } this code prints the i, then the first rand…

---

## [Wrong line numbers in error messages when using .java files](https://discourse.processing.org/t/wrong-line-numbers-in-error-messages-when-using-java-files/43983)

<div class="topic-metadata">

**Author:** [@quirin](https://discourse.processing.org/u/quirin)\
**Replies:** 10\
**Last updated:** [February 26, 2024, 5:08pm UTC](https://discourse.processing.org/t/wrong-line-numbers-in-error-messages-when-using-java-files/43983 "2024-02-26T17:08:39Z")

</div>

My sketch contains two files: BrokenErrorMessage.pde, whose content is irrelevant, and SomeJavaCodeWithErrors.java:public class SomeJavaCodeWithErrors // line 1 { // line 2 public st…

---

## [Working on a Simon says game](https://discourse.processing.org/t/working-on-a-simon-says-game/43955)

<div class="topic-metadata">

**Author:** [@cattclawzz](https://discourse.processing.org/u/cattclawzz)\
**Replies:** 7\
**Last updated:** [February 20, 2024, 10:26am UTC](https://discourse.processing.org/t/working-on-a-simon-says-game/43955 "2024-02-20T10:26:44Z")

</div>

having issues with line 27 and 28, I’m not sure how to properly write that line \<//r,b,g,y boolean colours = {false,false,false,false}; color coloursTrue = {color(255, 0, 0) , color(0,0,255) , color(0,255,0) , color(2…

---

## [How to move an image (without redrawing it)](https://discourse.processing.org/t/how-to-move-an-image-without-redrawing-it/43875)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 19\
**Last updated:** [February 14, 2024, 3:23am UTC](https://discourse.processing.org/t/how-to-move-an-image-without-redrawing-it/43875 "2024-02-14T03:23:12Z")

</div>

I want to load a large image (PImage img;), change some of the pixels, move the image horizontally or vertically, change some more pixels, move the image again, and so on… This should be easy, but I can’t find a way to …

---

## [Problems with Processing](https://discourse.processing.org/t/problems-with-processing/43754)

<div class="topic-metadata">

**Author:** [@Noodlybanan](https://discourse.processing.org/u/Noodlybanan)\
**Replies:** 4\
**Last updated:** [January 29, 2024, 2:11pm UTC](https://discourse.processing.org/t/problems-with-processing/43754 "2024-01-29T14:11:40Z")

</div>

This isn’t supposed to harrass anyone or bash on the language! Sadly processing has a giant lack of documentation, stuff that is not incredibly basic is not in the new docs, only on old forums where almost all links are…

---

## [Value will not go negative (move and bounce)](https://discourse.processing.org/t/value-will-not-go-negative-move-and-bounce/43742)

<div class="topic-metadata">

**Author:** [@WillyGrz](https://discourse.processing.org/u/WillyGrz)\
**Replies:** 3\
**Last updated:** [January 24, 2024, 4:39pm UTC](https://discourse.processing.org/t/value-will-not-go-negative-move-and-bounce/43742 "2024-01-24T16:39:23Z")

</div>

I’ve used almost exact code before but its not working this time. Any idea why? float obstacleX; float obstacleMoveX; … square(obstacleX, obstacleY, 80); obstacleMoveX = 2; obstacleX = obstacleX + obstacleMoveX; if (…

---

## [SaveFrame specific area](https://discourse.processing.org/t/saveframe-specific-area/43748)

<div class="topic-metadata">

**Author:** [@WormLover36](https://discourse.processing.org/u/WormLover36)\
**Replies:** 1\
**Last updated:** [January 24, 2024, 2:12pm UTC](https://discourse.processing.org/t/saveframe-specific-area/43748 "2024-01-24T14:12:36Z")

</div>

Hey everyone, I’m new to Processing and coding in general and I have to code something for uni in the form of a photobooth that utilizes the webcam and has a recording function. I use the following code for that: void …

---

## [Score won't stay](https://discourse.processing.org/t/score-wont-stay/43739)

<div class="topic-metadata">

**Author:** [@WillyGrz](https://discourse.processing.org/u/WillyGrz)\
**Replies:** 4\
**Last updated:** [January 23, 2024, 8:17pm UTC](https://discourse.processing.org/t/score-wont-stay/43739 "2024-01-23T20:17:21Z")

</div>

I’m making a stupid little game for fun. The square follows you, and however long it follows you, you get score. While the ‘play’ is true, you get score. And when it is ‘gameOver’ it displays a rounded amount. Yet when I…

---

## [Running a Processing script without Java installed](https://discourse.processing.org/t/running-a-processing-script-without-java-installed/43705)

<div class="topic-metadata">

**Author:** [@3xotic109](https://discourse.processing.org/u/3xotic109)\
**Replies:** 4\
**Last updated:** [January 17, 2024, 11:12pm UTC](https://discourse.processing.org/t/running-a-processing-script-without-java-installed/43705 "2024-01-17T23:12:11Z")

</div>

So I need to be able to run a processing script without having java installed. Is it possible to run it in the browser maybe? I need to be able to run it on a different device other than just my own as well, if that matt…

---

## [Proper buffer memory management for PImage created inside a function, and used outside it](https://discourse.processing.org/t/proper-buffer-memory-management-for-pimage-created-inside-a-function-and-used-outside-it/43616)

<div class="topic-metadata">

**Author:** [@MuddyGardener](https://discourse.processing.org/u/MuddyGardener)\
**Replies:** 1\
**Last updated:** [January 4, 2024, 4:08pm UTC](https://discourse.processing.org/t/proper-buffer-memory-management-for-pimage-created-inside-a-function-and-used-outside-it/43616 "2024-01-04T16:08:06Z")

</div>

This code works, as you can see, but I’m not sure if it SHOULD work. I am reserving the buffer space for the Test Pimage inside a function, and returning the values that have been set inside the function. I have a wei…

---

## [Puzzle - effect of alpha value depends on RGB value of pixel?](https://discourse.processing.org/t/puzzle-effect-of-alpha-value-depends-on-rgb-value-of-pixel/42983)

<div class="topic-metadata">

**Author:** [@MuddyGardener](https://discourse.processing.org/u/MuddyGardener)\
**Replies:** 5\
**Last updated:** [January 4, 2024, 12:14pm UTC](https://discourse.processing.org/t/puzzle-effect-of-alpha-value-depends-on-rgb-value-of-pixel/42983 "2024-01-04T12:14:31Z")

</div>

Here is a little test case that illustrates my puzzle. In both c1 and c3, alpha is set to 255. We should see the fill value showing over the background as declared via the RGB values, and this is what happens. In c1…

---

## [How does Processing handle methods drawing objects outside of the screen coordinates?](https://discourse.processing.org/t/how-does-processing-handle-methods-drawing-objects-outside-of-the-screen-coordinates/43590)

<div class="topic-metadata">

**Author:** [@Erik](https://discourse.processing.org/u/Erik)\
**Replies:** 2\
**Last updated:** [December 31, 2023, 3:00pm UTC](https://discourse.processing.org/t/how-does-processing-handle-methods-drawing-objects-outside-of-the-screen-coordinates/43590 "2023-12-31T15:00:04Z")

</div>

The reason I ask is because my code generates points that travels in a 3d trajectory within and outside of the screen coordinates. (Please note that I’m not using translate()). Currently, the point() method - that handl…

---

## [java.lang.ArrayIndexOutOfBoundsException](https://discourse.processing.org/t/java-lang-arrayindexoutofboundsexception/43529)

<div class="topic-metadata">

**Author:** [@Kaluz](https://discourse.processing.org/u/Kaluz)\
**Replies:** 4\
**Last updated:** [December 22, 2023, 7:31am UTC](https://discourse.processing.org/t/java-lang-arrayindexoutofboundsexception/43529 "2023-12-22T07:31:48Z")

</div>

Hello, i’m new here and a beginner in Java. Also english is not my native language, but i hope u can understand my problem. I have a problem with my code and can’t solve it myself. I get this error: “java.lang.ArrayIn…

---

## [Float array "limitation"?](https://discourse.processing.org/t/float-array-limitation/43469)

<div class="topic-metadata">

**Author:** [@boytedinho](https://discourse.processing.org/u/boytedinho)\
**Replies:** 2\
**Last updated:** [December 15, 2023, 1:52am UTC](https://discourse.processing.org/t/float-array-limitation/43469 "2023-12-15T01:52:59Z")

</div>

Hi there! I’m just playing around with arrays, learning how to work with them, but there’s one problem happening and I can’t figure it out why The program is written as follows: float\[\] bar = new float\[100\]; void set…

---

## [Execute code on PGraphics](https://discourse.processing.org/t/execute-code-on-pgraphics/43365)

<div class="topic-metadata">

**Author:** [@Noodlybanan](https://discourse.processing.org/u/Noodlybanan)\
**Replies:** 1\
**Last updated:** [December 1, 2023, 8:55pm UTC](https://discourse.processing.org/t/execute-code-on-pgraphics/43365 "2023-12-01T20:55:53Z")

</div>

Hi, i have a quesetion! I have a class: class Thing { int x = 0; Thing() { x = 50; } void create(int x\_) { this.x = x\_; } void display() { circle(width/2, height/2, x); } } i also have a Pgraphics: PGraphics ui; void…

---

## [Are there selection shortcuts in Processing?](https://discourse.processing.org/t/are-there-selection-shortcuts-in-processing/43354)

<div class="topic-metadata">

**Author:** [@laya](https://discourse.processing.org/u/laya)\
**Replies:** 2\
**Last updated:** [November 30, 2023, 12:53pm UTC](https://discourse.processing.org/t/are-there-selection-shortcuts-in-processing/43354 "2023-11-30T12:53:30Z")

</div>

pls help, thanks

---

## [Brand New the Processing - Need help!](https://discourse.processing.org/t/brand-new-the-processing-need-help/43286)

<div class="topic-metadata">

**Author:** [@Amamallama](https://discourse.processing.org/u/Amamallama)\
**Replies:** 7\
**Last updated:** [November 23, 2023, 3:42am UTC](https://discourse.processing.org/t/brand-new-the-processing-need-help/43286 "2023-11-23T03:42:41Z")

</div>

PImage img; void setup() { size(1000, 1000); img = loadImage( "rickroll.jpg" ); } void draw() { loadPixels(); img.loadPixels(); for (int x = 0; x \< img.width; x++ ) { for (int y = 0; y \< img.height; y…

---

## [How to use extended code completion?](https://discourse.processing.org/t/how-to-use-extended-code-completion/43245)

<div class="topic-metadata">

**Author:** [@laya](https://discourse.processing.org/u/laya)\
**Replies:** 2\
**Last updated:** [November 18, 2023, 9:53am UTC](https://discourse.processing.org/t/how-to-use-extended-code-completion/43245 "2023-11-18T09:53:42Z")

</div>

I type “for” and then ctrl+space, but it does not autocompletes. Please help.

---

## [Sorting circles by radius and avoiding overlap between random circles?](https://discourse.processing.org/t/sorting-circles-by-radius-and-avoiding-overlap-between-random-circles/43157)

<div class="topic-metadata">

**Author:** [@i-draw-monkeys](https://discourse.processing.org/u/i-draw-monkeys)\
**Replies:** 3\
**Last updated:** [November 8, 2023, 11:49am UTC](https://discourse.processing.org/t/sorting-circles-by-radius-and-avoiding-overlap-between-random-circles/43157 "2023-11-08T11:49:43Z")

</div>

I have code that generates a certain number of circles of random radii that don’t overlap. I want to be able to order them from smallest to largest in terms of radius so that circle\[0\] is the smallest. I want them sorted…

---

## [Is it a good way to empty an arrayList?](https://discourse.processing.org/t/is-it-a-good-way-to-empty-an-arraylist/43167)

<div class="topic-metadata">

**Author:** [@amundsen](https://discourse.processing.org/u/amundsen)\
**Replies:** 4\
**Last updated:** [November 8, 2023, 4:18am UTC](https://discourse.processing.org/t/is-it-a-good-way-to-empty-an-arraylist/43167 "2023-11-08T04:18:25Z")

</div>

Hello, I use an arrayList to store points making a polyline and I want to replace the points each time I press the mouse button. Instead of using a for loop to iterate through the arrayList and remove the items one by …

---

## [Basic drawing of circles with segments of lines doesn't function - must be really basic](https://discourse.processing.org/t/basic-drawing-of-circles-with-segments-of-lines-doesnt-function-must-be-really-basic/43161)

<div class="topic-metadata">

**Author:** [@amundsen](https://discourse.processing.org/u/amundsen)\
**Replies:** 2\
**Last updated:** [November 7, 2023, 4:06pm UTC](https://discourse.processing.org/t/basic-drawing-of-circles-with-segments-of-lines-doesnt-function-must-be-really-basic/43161 "2023-11-07T16:06:48Z")

</div>

Hello, Tthis sketch doesn’t draw circles using segments of lines as it is expected to do. The positions do not evolve and I don’t understand why. It must be as plain as the nose on your face but I can’t see it… …

---

## [Save 2 pictures at same time with different stroke & fill parameters](https://discourse.processing.org/t/save-2-pictures-at-same-time-with-different-stroke-fill-parameters/43152)

<div class="topic-metadata">

**Author:** [@Gabriel](https://discourse.processing.org/u/Gabriel)\
**Replies:** 3\
**Last updated:** [November 6, 2023, 8:27pm UTC](https://discourse.processing.org/t/save-2-pictures-at-same-time-with-different-stroke-fill-parameters/43152 "2023-11-06T20:27:17Z")

</div>

Hello, I’m not a coder but wish to solve a little problem : How do i save 2 pictures at same time with mousePressed fonction with 2 different “stroke” & “fill” parameters like : PImage img; // Variable init int count…

[Previous page](https://discourse.processing.org/c/processing/processing-beginners/14.md?page=2)

[Next page](https://discourse.processing.org/c/processing/processing-beginners/14.md?page=4)
