I have a daft question…
why do get no output when I define a variable using mouseX & mouseY?
int XY = mouseX+mouseY;
void draw()
{
println(XY,mouseX+mouseY);
}
left-hand number stays at zero, right hand number changes as i move the mouse over the window.
It’s a daft question because obviously I could just put mouseX+mouseY wherever I want to return that value… so why declare a variable, except to save a few keystrokes? - but for the sake of understanding I’d like to know!
this is a command and not a standing order. It is only executed when processing executes this line. So it must be within draw() because draw() runs on and on. When it’s before draw() it is executed only once and not throughout (it doesn’t become a rule for processing to maintain the line forever and keep XY as mouseX+mouseY).