# Can't use size() in setup()

**URL:** https://discourse.processing.org/t/cant-use-size-in-setup/43008
**Category:** Beginners
**Created:** [October 19, 2023, 3:44am UTC](https://discourse.processing.org/t/cant-use-size-in-setup/43008 "2023-10-19T03:44:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![berndbausch](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@berndbausch](https://discourse.processing.org/u/berndbausch)
#### Post date: [October 19, 2023, 3:44am UTC](https://discourse.processing.org/t/cant-use-size-in-setup/43008/1 "2023-10-19T03:44:50Z")

</div>

Trying to run [a large sketch I cloned from Github](https://github.com/ertdfgcvb/TheAbyss/), I get the error

```auto
size() cannot be used here, see https://processing.org/reference/size_.html

```

Documentation says:

> the **size()** function must be the first line of code inside **setup()**, and the **setup()** function must appear in the code tab with the same name as your sketch folder.

This is the case: size() is called exactly once as the first statement in setup() in a tab named _TheAbyss_. This is also the name of the sketch and the name of the folder in which the sketch files reside.

How can I find out why Processing doesn’t like size() at this location? Thanks for any input.

The sketch is much too large to copy here, but for what it’s worth, here is the beginning of the _TheAbyss_ tab:

```auto
/**
 * The Abyss
 * 2010-13
 */

CreatureManager creatureManager;
boolean useBackdrop = true;

void setup() {
  size(displayWidth, displayHeight, P3D);  
  smooth(8);
  frameRate(60);
  creatureManager = new CreatureManager(this);
  // creatureManager.toggleManagerInfo(); // turn info off

  initShaders();
} 

void draw() { 
...

```

---

<div class="post-metadata">

### Author: ![berndbausch](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@berndbausch](https://discourse.processing.org/u/berndbausch)
#### Post date: [October 19, 2023, 3:55am UTC](https://discourse.processing.org/t/cant-use-size-in-setup/43008/2 "2023-10-19T03:55:43Z")

</div>

Documentation also says

> To run a sketch that fills the screen, use the fullScreen() function, rather than using size(displayWidth, displayHeight).

The error goes away when I replace `displayWidth` and `displayHeight` with numbers, or use fullScreen() instead of size().

---

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [October 19, 2023, 7:50am UTC](https://discourse.processing.org/t/cant-use-size-in-setup/43008/3 "2023-10-19T07:50:48Z")

</div>

> **[settings() / Reference](https://processing.org/reference/settings_.html)**
>
> The settings() function is new with Processing 3.0. It's not needed in most sketches. It's only useful when it's absolutely necessary to define the parameters to size() with a variable. …
