Hi I’m trying to create a processing library using eclipse, everything Looks fine so far but if I use following Code for a class
package test;
import processing.core.*;
public class Testclass{
PAppplet parent;
Testclass(PApplet parent){
this.parent=parent;
parent.registerMethod(“method1”,this);
}
public float method1(float x){
return …;
}
public float method2(){
return …;
}
}
I am not sure why you are trying to register a method called method1. Can you explain because AFAIK registering a method with an arbitrary name is meaningless.
The registerMethod is used for two reasons
provide user defined processing of mouse, key and touch events
to provide methods to be called during Processing’s main execution thread e.g. pre, draw, post, dispose etc.
I assume by this you are trying to make “Processing commands” like fill(...), stroke(...) etc. again I would ask why you would want to do this.
Although in theory you could extend the PApplet class to provide additional methods but I would strongly recommend that you don’t even attempt it. The problems associated with doing this would make an angel cry