Multiple files and size()

If there are two or more files in one project and the second file has setup(), an error size() cannot be used here, see https://processing.org/reference/size_.html occurs. Is there any rules around the order of files when there are multiple files?

The details are as follows.

Environment

  • Processing 3.3.3, PDE
  • Ubuntu 16.10

Code

a.pde

class Foo {}

b.pde

void setup() {
  size(100, 100);
}
void draw() {
  background(0);
}

File order: a.pde, b.pde

Behavior

  • After pressing "Run" button, the error size() cannot be used here, see https://processing.org/reference/size_.html occurs although the arguments of size() are constants.
  • If the file order is b.pde, a.pde, the error doesn't occur.
  • If I use settings() instead of setup(), the error doesn't occur.

Answers

Sign In or Register to comment.