Skip to content
Advertisement

Processing: starting screen background error

I am trying to create a starting screen background for my first game in Processing and it keeps erroring with the following message:

JavaScript

I’ve tried to solve the problem by following the message and by searching around but I don’t manage to solve it.

this is the part for the background:

JavaScript

If needed I’ll send the whole part but this is where I believe the problem exist

thanks in advance

Advertisement

Answer

The settings() method in processing has only been added in 3.0, and a lot of people just ignore it’s existence. It’s a great add, though, which permits stuff which the setup() method didn’t (such as defining the window size using variables, for example).

Just move your size() line in a new settings() method, exactly as the program says.

(Also, if you are animating the sketch, you should draw the background in the draw() loop.)

JavaScript

Have fun!

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement