Hi there !
I followed this tutorial https://code.google.com/p/libgdx/wiki/scene2d#InputListener :
When a button is pressed, I would like that an sql query is executed.
So i just added 2 lines inside the touchDown() function :
But this won't compile because "myVariable" is not defined in the class, "myVariable" is defined in the main file.
I followed this tutorial https://code.google.com/p/libgdx/wiki/scene2d#InputListener :
Code:
actor.addListener(new InputListener() {
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
System.out.println("down");
return true;
}
public void touchUp (InputEvent event, float x, float y, int pointer, int button) {
System.out.println("up");
}
});
When a button is pressed, I would like that an sql query is executed.
So i just added 2 lines inside the touchDown() function :
Code:
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
System.out.println("down");
db = new Database();
scores = db.UpdateScore(myVariable);
return true;
}
But this won't compile because "myVariable" is not defined in the class, "myVariable" is defined in the main file.