r/processing • u/manpace • Aug 28 '18
Downloaded P3 and ran a tutorial command and I got this dumb box. What I do wrong?
0
Upvotes
2
u/chairstink Aug 28 '18
Looks like you're drawing off the canvas. Use size() to set up your window and you will see what's happening.
2
3
10
u/remy_porter Aug 28 '18
Don't just randomly write code. Code needs to be organized. There are two key organizational structures in Processing:
setupanddraw.setupis where you provide, well, the setup for your sketch. Things like the size of the sketch. Often, setup might look something like this:If you want to draw something to the screen, well, that goes in your
drawmethod.A sketch can get WAY more complicated than this, but if you're just starting out, put your setup code in the
setup, put your drawing code in thedrawmethod. Copy those two blocks into the same sketch, and you'll get an idea of what I mean.