Thanks a lot for that. I followed your instructions - I had previously made a class outside of a package and I hadn't set up the build path. I've managed to make my first helloLibrary package.
Eclipse:
Code:
package helloLibrary;
import processing.core.*;
public class Hello{
PApplet parent;
public int myInt = 0;
public Hello(PApplet parent){
this.parent = parent;
parent.registerDispose(this);
}
public void helloWorld(){
myInt++;
parent.println("Hello World");
parent.line(0, 0, 100, 100);
}
public void dispose(){
}
}
Processing:
Code:
Hello hello;
void setup(){
hello = new Hello(this);
println(hello.myInt);
hello.helloWorld();
println(hello.myInt);
}
So I'm cool for now, thanks. I think that for the AI library most of the stuff that happens is going to be internal math, I'll just need some tips on how to keep what is going on in the library quiet from the user.
One question though:
I get a warning from Eclipse on
parent.println("Hello World");
The static method println(String) from the type PApplet should be accessed in a
static way
It says it compiles with errors but runs anyway. Is there a better way I should be calling println()? Or should I just ignore it.