# Beginners

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

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

**Page:** 26

---

## [How can I set a move while hold a key?](https://discourse.processing.org/t/how-can-i-set-a-move-while-hold-a-key/23346)

<div class="topic-metadata">

**Author:** [@viniciusbrbio](https://discourse.processing.org/u/viniciusbrbio)\
**Replies:** 6\
**Last updated:** [August 19, 2020, 12:05pm UTC](https://discourse.processing.org/t/how-can-i-set-a-move-while-hold-a-key/23346 "2020-08-19T12:05:52Z")

</div>

Hi everyone, I made this little code and I want to hold the ‘d’ key to make the ball move to the right. I want to move the ball until the edge of the screen just holding ‘d’ key. In the way that the code is, I need to …

---

## [I need a line with different random numbers that have been picked once](https://discourse.processing.org/t/i-need-a-line-with-different-random-numbers-that-have-been-picked-once/23163)

<div class="topic-metadata">

**Author:** [@lu\_mime](https://discourse.processing.org/u/lu_mime)\
**Replies:** 2\
**Last updated:** [August 10, 2020, 8:18am UTC](https://discourse.processing.org/t/i-need-a-line-with-different-random-numbers-that-have-been-picked-once/23163 "2020-08-10T08:18:26Z")

</div>

I’m trying to solve an exercise, that i have to do a line, with for cycle. I need that it looks like this 6 8 9 3 1 but the only thing that I have is multiple numbers, in the same place, multiple times. I don’t kno…

---

## [Accessing PApplet methods in static](https://discourse.processing.org/t/accessing-papplet-methods-in-static/23112)

<div class="topic-metadata">

**Author:** [@SemAntys](https://discourse.processing.org/u/SemAntys)\
**Replies:** 2\
**Last updated:** [August 7, 2020, 8:24pm UTC](https://discourse.processing.org/t/accessing-papplet-methods-in-static/23112 "2020-08-07T20:24:22Z")

</div>

Hi, I’m trying to access PApplet methods in a static class, in this case the color() method. I’ve tried following this discussion, but I can’t make it work. I’ve written this: static class myclass { static int myc…

---

## [How to increase number?](https://discourse.processing.org/t/how-to-increase-number/23024)

<div class="topic-metadata">

**Author:** [@Rai](https://discourse.processing.org/u/Rai)\
**Replies:** 14\
**Last updated:** [August 7, 2020, 6:22am UTC](https://discourse.processing.org/t/how-to-increase-number/23024 "2020-08-07T06:22:42Z")

</div>

int i = 33; void setup() { } void draw() { for (char c = char(i); c \< i+58; c++) println( i + " : " + c); } how to increase number i to 34, 35, 36, etc thanks

---

## [String Array {}](https://discourse.processing.org/t/string-array/23082)

<div class="topic-metadata">

**Author:** [@NoName](https://discourse.processing.org/u/NoName)\
**Replies:** 9\
**Last updated:** [August 6, 2020, 3:13pm UTC](https://discourse.processing.org/t/string-array/23082 "2020-08-06T15:13:45Z")

</div>

can i re-declare the variables in curly braces after declaring the string array? / String \[\] test = new String \[500\]; void setup(){} void draw(){ test \[\] = {“shshsj”, “sjjsjsjs”, “2+288383”}; } \</ this does not w…

---

## [How do I call fill() in a function?](https://discourse.processing.org/t/how-do-i-call-fill-in-a-function/23043)

<div class="topic-metadata">

**Author:** [@alkilum](https://discourse.processing.org/u/alkilum)\
**Replies:** 4\
**Last updated:** [August 5, 2020, 1:17am UTC](https://discourse.processing.org/t/how-do-i-call-fill-in-a-function/23043 "2020-08-05T01:17:47Z")

</div>

So I have a function tied to rendering and I used fill in it like this: public static int rd(int k){ fill(#ff0000); line(0,0,0,k); return k; } It said something along the lines of you can’t call fill() in a stati…

---

## [I can't add stuff to my array](https://discourse.processing.org/t/i-cant-add-stuff-to-my-array/18772)

<div class="topic-metadata">

**Author:** [@alkilum](https://discourse.processing.org/u/alkilum)\
**Replies:** 10\
**Last updated:** [August 2, 2020, 4:48am UTC](https://discourse.processing.org/t/i-cant-add-stuff-to-my-array/18772 "2020-08-02T04:48:38Z")

</div>

I have an short\[\] array, and i want to add a bunch of 0s to it. Here is my code: size(800,600); short \[\] visible; for(int n=0;n\<2985984;n+=1) { visible.add(0); } I get an error saying “Cannot invoke add(int) an th…

---

## [Cannot specify sphereDetail when using createShape SPHERE](https://discourse.processing.org/t/cannot-specify-spheredetail-when-using-createshape-sphere/22912)

<div class="topic-metadata">

**Author:** [@danieltorrer](https://discourse.processing.org/u/danieltorrer)\
**Replies:** 3\
**Last updated:** [August 2, 2020, 2:41am UTC](https://discourse.processing.org/t/cannot-specify-spheredetail-when-using-createshape-sphere/22912 "2020-08-02T02:41:34Z")

</div>

When creating a sphere() you are able to specify the number of vertices it has if you previously call sphereDetail(). However seems that there is no way to specify the detail when using createShape(SPHERE, size). Does a…

---

## [Can I make fill() static?](https://discourse.processing.org/t/can-i-make-fill-static/22978)

<div class="topic-metadata">

**Author:** [@alkilum](https://discourse.processing.org/u/alkilum)\
**Replies:** 4\
**Last updated:** [August 2, 2020, 2:01am UTC](https://discourse.processing.org/t/can-i-make-fill-static/22978 "2020-08-02T02:01:04Z")

</div>

So I wanted to call fill() in a subroutine and it apparently cannot be called in a static function. So I removed the static keyword and now there is no error, but the function doesn’t work anymore, it simply renders the …

---

## [loadImage does not Load Image from data folder](https://discourse.processing.org/t/loadimage-does-not-load-image-from-data-folder/22951)

<div class="topic-metadata">

**Author:** [@JohnnyWhy](https://discourse.processing.org/u/JohnnyWhy)\
**Replies:** 7\
**Last updated:** [August 1, 2020, 12:46pm UTC](https://discourse.processing.org/t/loadimage-does-not-load-image-from-data-folder/22951 "2020-08-01T12:46:51Z")

</div>

2020-07-31T07:00:00Z (UTC) I am using the loadImage example, and definately have the image saved in the data folder of the active sketch. Except for the web URL example below, I get the error message: “The file “moire.…

---

## [How to load the HTLM from HTTPS](https://discourse.processing.org/t/how-to-load-the-htlm-from-https/22956)

<div class="topic-metadata">

**Author:** [@Dozii](https://discourse.processing.org/u/Dozii)\
**Replies:** 1\
**Last updated:** [July 31, 2020, 8:11pm UTC](https://discourse.processing.org/t/how-to-load-the-htlm-from-https/22956 "2020-07-31T20:11:37Z")

</div>

I try to load the html from https, but loadImage doesn’t work. Load from https://unicorninwonderland.com/ void setup(){ // Load from https://unicorninwonderland.com/ PImage image = loadImage( "https://unicorninwond…

---

## [ArrayList out of boundary](https://discourse.processing.org/t/arraylist-out-of-boundary/22817)

<div class="topic-metadata">

**Author:** [@klap](https://discourse.processing.org/u/klap)\
**Replies:** 3\
**Last updated:** [July 26, 2020, 2:19pm UTC](https://discourse.processing.org/t/arraylist-out-of-boundary/22817 "2020-07-26T14:19:33Z")

</div>

Hi, Playing with objects and ArrayList. I’ve trouble removing objects from the ArrayList when they disappear from the screen. IndexOutOfBoundsException: Index: 49, Size: 49 ArrayList\<Bubble\> bubble = new ArrayList\<Bu…

---

## [Error message when attempting to import Java library](https://discourse.processing.org/t/error-message-when-attempting-to-import-java-library/22799)

<div class="topic-metadata">

**Author:** [@11OutOf10](https://discourse.processing.org/u/11OutOf10)\
**Replies:** 2\
**Last updated:** [July 24, 2020, 9:59pm UTC](https://discourse.processing.org/t/error-message-when-attempting-to-import-java-library/22799 "2020-07-24T21:59:52Z")

</div>

As the title says. I was attempting to import java.util.random using “import java.util.random;” and got an error message: Libraries must be installed in a folder named ‘libraries’ inside the sketchbook folder (see the P…

---

## [Java Access Modifiers](https://discourse.processing.org/t/java-access-modifiers/22821)

<div class="topic-metadata">

**Author:** [@Markus](https://discourse.processing.org/u/Markus)\
**Replies:** 3\
**Last updated:** [July 24, 2020, 8:31pm UTC](https://discourse.processing.org/t/java-access-modifiers/22821 "2020-07-24T20:31:06Z")

</div>

https://processing.org/reference/private.html: This keyword is used to disallow other classes access to the fields and methods within a class. The private keyword is used before a field or method that you want to be ava…

---

## [Parent function not using overwritten array from child](https://discourse.processing.org/t/parent-function-not-using-overwritten-array-from-child/22796)

<div class="topic-metadata">

**Author:** [@NikolafTheGreat](https://discourse.processing.org/u/NikolafTheGreat)\
**Replies:** 3\
**Last updated:** [July 24, 2020, 9:12am UTC](https://discourse.processing.org/t/parent-function-not-using-overwritten-array-from-child/22796 "2020-07-24T09:12:22Z")

</div>

I am coding an application and ran into an issue where I have created a function in the parent class that references an array also in the parent class. I then overwrite the array in a child class and run the parent funct…

---

## [Top-down game template](https://discourse.processing.org/t/top-down-game-template/22770)

<div class="topic-metadata">

**Author:** [@Edgard142ofWelshdale](https://discourse.processing.org/u/Edgard142ofWelshdale)\
**Replies:** 1\
**Last updated:** [July 22, 2020, 1:51am UTC](https://discourse.processing.org/t/top-down-game-template/22770 "2020-07-22T01:51:03Z")

</div>

This is a template I have been using personally to get started quick with a new top-down game without doing all the simple stuff like player movement for the tenth time. I’m posting this in the Beginners section because …

---

## [Objects in objects](https://discourse.processing.org/t/objects-in-objects/22486)

<div class="topic-metadata">

**Author:** [@carnalizer](https://discourse.processing.org/u/carnalizer)\
**Replies:** 10\
**Last updated:** [July 21, 2020, 10:13am UTC](https://discourse.processing.org/t/objects-in-objects/22486 "2020-07-21T10:13:42Z")

</div>

Hi, I have a mostly theoretical question about objects that have objects (or contain an ArrayList of objects). Inside the nested objects, there’s no ‘built in’ way of getting to the original object, right? I can solve t…

---

## [Object Property Implementation](https://discourse.processing.org/t/object-property-implementation/22628)

<div class="topic-metadata">

**Author:** [@VegasBob](https://discourse.processing.org/u/VegasBob)\
**Replies:** 18\
**Last updated:** [July 17, 2020, 3:43pm UTC](https://discourse.processing.org/t/object-property-implementation/22628 "2020-07-17T15:43:51Z")

</div>

Just getting started with Java using the Processing IDE, and I can’t seem to find a way to properly code my Classes to produce properties that will behave like genuine properties - meaning that I can use: Employee.Name …

---

## [When do you use keyPressed as function?](https://discourse.processing.org/t/when-do-you-use-keypressed-as-function/22278)

<div class="topic-metadata">

**Author:** [@klap](https://discourse.processing.org/u/klap)\
**Replies:** 5\
**Last updated:** [July 16, 2020, 3:52pm UTC](https://discourse.processing.org/t/when-do-you-use-keypressed-as-function/22278 "2020-07-16T15:52:53Z")

</div>

There seems to be multiple ways to use keyPressed. if (keyPressed == true) { … or void keyPressed() { … When do you use it as function and when not? When and how do you combine both?

---

## [Keyword "new" and arrays - clarification](https://discourse.processing.org/t/keyword-new-and-arrays-clarification/22598)

<div class="topic-metadata">

**Author:** [@mnoble](https://discourse.processing.org/u/mnoble)\
**Replies:** 8\
**Last updated:** [July 14, 2020, 6:59pm UTC](https://discourse.processing.org/t/keyword-new-and-arrays-clarification/22598 "2020-07-14T18:59:29Z")

</div>

Hello Forum, This question is about explaining arrays simply to beginners…please correct or clarify, thank you :slight\_smile: When an array is declared and initialized at the same time like this: int mySet\[\] = {15,75,…

---

## [Optimization, CSV files and how to know which functions are easier for the computer?](https://discourse.processing.org/t/optimization-csv-files-and-how-to-know-which-functions-are-easier-for-the-computer/22596)

<div class="topic-metadata">

**Author:** [@jessy87](https://discourse.processing.org/u/jessy87)\
**Replies:** 1\
**Last updated:** [July 13, 2020, 10:54pm UTC](https://discourse.processing.org/t/optimization-csv-files-and-how-to-know-which-functions-are-easier-for-the-computer/22596 "2020-07-13T22:54:25Z")

</div>

Hey guys ! I’m currently trying to learn processing with the amazing videos by the Coding Train on Youtube. So I’m pretty new to programming and I started using CVS files to keep a good bunch of data I could otherwise p…

---

## [How to add Hindi Font in Processing?](https://discourse.processing.org/t/how-to-add-hindi-font-in-processing/11653)

<div class="topic-metadata">

**Author:** [@Anmol](https://discourse.processing.org/u/Anmol)\
**Replies:** 9\
**Last updated:** [July 13, 2020, 10:08am UTC](https://discourse.processing.org/t/how-to-add-hindi-font-in-processing/11653 "2020-07-13T10:08:21Z")

</div>

Hi, I’m trying to add Hindi fonts in Processing for typography but it’s not working? Any idea how it can be achieved. I’m getting the following error:

---

## [Garbage collection](https://discourse.processing.org/t/garbage-collection/22537)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 1\
**Last updated:** [July 10, 2020, 4:44pm UTC](https://discourse.processing.org/t/garbage-collection/22537 "2020-07-10T16:44:52Z")

</div>

I’m handling a big arrayList in my program to create a terrain, however I want the users to be able to load their own files, so that anything you can retrieve saves or simply create terrains using a txt file. Issue is on…

---

## [Pass parameter through selectFile()/selectFolder();](https://discourse.processing.org/t/pass-parameter-through-selectfile-selectfolder/22522)

<div class="topic-metadata">

**Author:** [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Replies:** 2\
**Last updated:** [July 9, 2020, 8:44pm UTC](https://discourse.processing.org/t/pass-parameter-through-selectfile-selectfolder/22522 "2020-07-09T20:44:07Z")

</div>

selectInput("Select a file to process:", "fileSelected"); How do I pass the parameter for a variable I wish to update in this type of function? void fileSelected(File selection){ if(selection != null)BMS.File.value =…

---

## [What is PSurface used for?](https://discourse.processing.org/t/what-is-psurface-used-for/22409)

<div class="topic-metadata">

**Author:** [@Ruchi](https://discourse.processing.org/u/Ruchi)\
**Replies:** 2\
**Last updated:** [July 6, 2020, 12:10pm UTC](https://discourse.processing.org/t/what-is-psurface-used-for/22409 "2020-07-06T12:10:24Z")

</div>

Sorry if this is very trivial question but I can’t seem to find any documentation for this. http://processing.github.io/processing-javadocs/core/processing/core/PSurfaceNone.html The above link is what I found but the …

---

## [Expected DOT, found 'array name'](https://discourse.processing.org/t/expected-dot-found-array-name/22347)

<div class="topic-metadata">

**Author:** [@what42](https://discourse.processing.org/u/what42)\
**Replies:** 5\
**Last updated:** [July 4, 2020, 11:42pm UTC](https://discourse.processing.org/t/expected-dot-found-array-name/22347 "2020-07-04T23:42:17Z")

</div>

I think I’ve found a bug with the IDE. If it’s not a bug, please tell what I’m doing wrong. Whenever I have something like this byte\[\] TestByteArray = new byte\[\] { 0b0 }; it gives me this error: expecting DOT, found…

---

## [About SaveTable()](https://discourse.processing.org/t/about-savetable/22295)

<div class="topic-metadata">

**Author:** [@SouSageYa](https://discourse.processing.org/u/SouSageYa)\
**Replies:** 1\
**Last updated:** [July 1, 2020, 8:25am UTC](https://discourse.processing.org/t/about-savetable/22295 "2020-07-01T08:25:41Z")

</div>

So here is the problem I want to save Floats but it can save integers and string is there a way to save FPN’s ?

---

## [Issue with default rounding numbers in Processing Java Mode](https://discourse.processing.org/t/issue-with-default-rounding-numbers-in-processing-java-mode/22280)

<div class="topic-metadata">

**Author:** [@Optyfen\_met\_Eenden](https://discourse.processing.org/u/Optyfen_met_Eenden)\
**Replies:** 2\
**Last updated:** [June 30, 2020, 2:14pm UTC](https://discourse.processing.org/t/issue-with-default-rounding-numbers-in-processing-java-mode/22280 "2020-06-30T14:14:56Z")

</div>

Dear ladies and gentlemen, Recently, I realised I faced a problem with default settings and specifically the rounding numbers ability. When I let Processing count up the first sum using the float function, it doesn’…

---

## [Setting size of display window to a percentage of screen size](https://discourse.processing.org/t/setting-size-of-display-window-to-a-percentage-of-screen-size/22228)

<div class="topic-metadata">

**Author:** [@luckyboy](https://discourse.processing.org/u/luckyboy)\
**Replies:** 1\
**Last updated:** [June 29, 2020, 5:51am UTC](https://discourse.processing.org/t/setting-size-of-display-window-to-a-percentage-of-screen-size/22228 "2020-06-29T05:51:45Z")

</div>

I’m trying to make a program where users input values and the program spits out a final value through an equation. This is all pretty simple, but the one thing I can’t seem to figure out is display window sizing. My di…

---

## [Easing, don't get it fully](https://discourse.processing.org/t/easing-dont-get-it-fully/22154)

<div class="topic-metadata">

**Author:** [@klap](https://discourse.processing.org/u/klap)\
**Replies:** 3\
**Last updated:** [June 27, 2020, 12:07pm UTC](https://discourse.processing.org/t/easing-dont-get-it-fully/22154 "2020-06-27T12:07:35Z")

</div>

I don’t think I fully understand easing. Maybe it’s my math, but I don’t see why the two ellipses, end up in the same position with the ‘\* easing’ part. float x = 0.0; float easing = 0.05; void setup() { size(100, 10…

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

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