We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hi all, i get an error when creating a GLMovie object within a class like:
class Film {
GLMovie vid;
String filename;
Film(String tempFilename) {
filename = tempFilename;
vid = new GLMovie(this,filename); //error:
//The constructor "GLMovie(Film,String)" does not exist
vid.loop();
}
}
also the use of "this" is not clear to me ...
thanks:) ps: the formatting looks a bit strange here!? sorry for that
Answers
(highlight code, press ctrl-o. i've done that for you)
this
is probably meant to be PApplet. but if you move the call into a class thenthis
becomes the class, which is probably why it isn't working.you need to pass the PApplet into you class, as another argument in your Film constructor.
All loading resources should go to setup(). Then you can pass the already loaded resource to your classes' constructor:
thanks koogs for the PApplet hint. (also for the edit). i found this on the topic: https://forum.processing.org/one/topic/reference-papplet-of-sketch.html
thanks GoToLoop too.