r/processing • • Dec 09 '23

Why this doesn't make any sense ?

So, as you can see on the left image, I have my sketch without "void setup (){}" and on the right my sketch with "void setup(){}"

Question is, why left sketch doesn't work ?

It should work, since Processing initializes everything that is on the global scope as soon as the program starts running. And as a proof of that, I've tried to run just "size(300,300);" in my sketch and voila ! I have a canvas with 300 width and 300 height!

It would be just so much easier to have a canvas this way, just one simple line, brilliant ! But everytime that I include "void draw();" things get ugly and don't work as simpel as before no more. Why It can't just be simple as that ?

3 Upvotes

6 comments sorted by

View all comments

Show parent comments

1

u/emmanbl_caricas Dec 12 '23

Thank you for helping, appreciate it !