Hi, I’m using a .java file to contain an enum with extended variables an behaviours, but I want it to contain an object of one of the classes contained in a .pde file, however the compiler says that that class does not exist.
enums.java:
enum ECAM_Buttons
{
ECAM_Engines (0,0),
ECAM_Clr_R(5,2.2f);
float x_desfase_factor,y_desfase_factor;
static final int size = ECAM_Buttons.values().length;
Coordenada btn_desfase=new Coordenada(72, 50);
ECAM_Buttons(float xdes,float ydes){
this.x_desfase_factor = xdes;
this.y_desfase_factor = ydes;
}
// ECAM_Buttons(int xdes,int ydes){
// this.x_desfase_factor = float(xdes);
// this.y_desfase_factor = float(ydes);
// }
ECAM_Buttons(Number xdes,Number ydes){
this.x_desfase_factor = xdes.floatValue();
this.y_desfase_factor = ydes.floatValue();
}
}
coordenada.pde:
class Coordenada{
float x;
float y;
Coordenada(){
x=0;
y=0;
}
Coordenada(float _x){
x=_x;
y=0;
}
Coordenada(float _x,float _y){
x=_x;
y=_y;
}
Coordenada(Coordenada c){
x=c.x;
y=c.y;
}
}
I’m trying to do that because otherwise I can’t seem to get an Object of the class Coordenada within the enum, if there’s a better way to do so I’m here to learn
Thanks!