Hello Processing Community,
I have the following problem, maybe someone knows a workaround or a solution for me...
I'm programming in Java Mode - so i can't use in the "*.java" files the import statement for the library (or better: i can use it, but processing doesn't find the library then). In "*.pde" files it works great. I think the problem is, that the sketchbook/libraries folder isn't in the java classpath - but i dont know, what i can do (except: write the library parts all in a "*.pde" file).
I do not use eclipse - only the normal processing environment (and the library i try to get running in "*.java" files is "procontroll").
Thanks for any Ideas!
EDIT:No response yet, so i think its a good idea to expand my post with source code for demonstration:GamePad.java doesnt find the library
Code:import procontroll.*;
import net.java.games.input.*;
import processing.core.*;
import java.io.*;
public class GamePad extends Object{
// procontroll stuff
protected ControllIO controll;
protected ControllDevice device;
protected ControllStick stick;
protected ControllButton button;
protected PApplet pApp;
float totalX = width/2;
float totalY = height/2;
public GamePad(PApplet pApp){
this.pApp = pApp;
//prokontroll stuff
controll = ControllIO.getInstance(this);
device = controll.getDevice(3);
device.setTolerance(0.05f);
ControllSlider sliderX = device.getSlider(2);
ControllSlider sliderY = device.getSlider(3);
stick = new ControllStick(sliderX,sliderY);
button = device.getButton("0");
totalX = constrain(totalX + stick.getX(),10,width-10);
totalY = constrain(totalY + stick.getY(),10,height-10);
}
}
But in a pde, similiar Code works without problems:
Code:import procontroll.*;
import net.java.games.input.*;
import java.io.*;
// procontroll stuff
ControllIO controll;
ControllDevice device;
ControllStick stick;
ControllButton button;
float totalX = width/2;
float totalY = height/2;
void setup(){
//prokontroll stuff
controll = ControllIO.getInstance(this);
device = controll.getDevice(3);
device.setTolerance(0.05f);
ControllSlider sliderX = device.getSlider(2);
ControllSlider sliderY = device.getSlider(3);
stick = new ControllStick(sliderX,sliderY);
button = device.getButton("0");
totalX = constrain(totalX + stick.getX(),10,width-10);
totalY = constrain(totalY + stick.getY(),10,height-10);
}