We are about to switch to a new forum software. Until then we have removed the registration on this forum.
As the DRAW and SETUP when used as functions, are they command words? Is there a case where you can make up your own function names (such as in python)? Is there a list of FUNCTION names in a glossary?
Answers
See the reference.
class
PApplet.Next to setup() and draw() there are other functions that get called automatically: keyPressed(), keyReleased(), mousePressed(), mousereleased(), mouseWheel() etc. - see reference. They all have written
()
after the name (which says I am a function and not a variable).(It is not recommended to call setup() and draw() and the others manually as in writing their title to call them since they're called automatically.)
But you can of course define your own functions like
and call it by saying
initGame();
eg. indraw()
or elsewhereSee also
https://github.com/Kango/Processing-snippets/wiki/programming-and-functions
Chrisir ;-)
@netrate -- For an overview that briefly explains
setup()
anddraw()
, read the overview:...specifically, the section "Hello mouse".
For more details, read the reference entry for each: