Is parent parameter of Capture ever not "this"?

I’ve just been playing around with the Capture class, and the default first (parent) parameter when declaring a new Capture object is “this” - which I understand to refer to the parent of the object…i.e. the current sketch that the object is being declared in. My question is, is there ever a situation where it wouldn’t be referring to the current sketch?

Java’s keyword this refers to an instance of the same datatype of the class it is in. :coffee:

Capture’s 1st parameter is of datatype PApplet, btW. :nerd_face:

1 Like

If you look at the source code for the library, you will see that the constructors always take PApplet as the first argument. This is true for most Processing libraries – having a copy of the sketch object is how they gain access to Processing canvas methods like image, pixels, etc.

2 Likes