We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi everyone.
I've been experimenting with multiple windows (as shown in this post: http://forum.processing.org/one/topic/multiple-windows-2-4-2011.html), and I've succeeded in using the main window (the red one) to control the Second Applet by using void mousePressed(), then changing the framerate through s.frameRate().
How do I do this the other way around?
-- MenteCode
Answers
You need to pass the main PApplet reference to any other class which needs to control the main sketch! %%-
Do you mean to say that I should make a class for the main applet as well, so I could control it?
-- MenteCode
No! I've meant that you have to pass that reference to your other class. Usually through its constructor. :(|)
Of course in order for that to work, you have to instantiate that class within the main sketch.
And use
this
keyword as the passing argument! :-BThis way,
this
means the sketch's own instance reference. Not from some other object's reference!