I'm trying to create a game with libGDX in Android Studio, and I am struggling with my code to add a command to the program to do something when I press the button.
I have added an ImageButton
, but now I struggle to get it to do something when I click on it.
Here's my code:
bplay.addListener( new ClickListener(){
public void clicked(InputEvent event, float x, float y){
batch.begin();
batch.draw( splash, 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight() );
batch.end();
}
});