Hello !
From the main processing sketch file, I am instantiating objectA that defines methodA, which draws stuff on a PImage, that it then draws on the main window, using the image() function. This works as expected, whenever the method is called from another basic object (an object of a class that is not extending PApplet). I am also instantiating objectB, whose class extends PApplet, to control a secondary window. In objectB, I have a knob that I want to use to control the background color of the main window: whenever the user interacts with this knob, methodA in objectA is triggered by objectB (of course, objectB is holding a valid** reference to objectA, set from the main sketch file). When methodA is called from inside objectB, nothing is displayed on the main window by the image() function (which is called inside methodA), even if I have instantiated objectA from the main sketch file. Why is that ? I would expect image() to be dependent on the object it is called from (i.e. objectA, and not objectB). Should I find a reference to the main window, instead, right from inside objectB or objectA and then do something like:
mainWindow.image(im, 0, 0);
instead of
image(im, 0, 0);
?
I hope this is somehow understandable. Thank you for stopping by, have a good day, folks
**it can print correctly to the console