java - Button ClickLIstener is not Working in LibGdx game? -


i developing android game using libgdx; there 4 button in menu screen, click listener of these button not working.

 // retrieve custom skin our 2d widgets skin skin = super.getskin(); // create table actor , add stage table = new table( skin ); table.width = stage.width(); table.height = stage.height(); stage.addactor( table ); // retrieve table's layout tablelayout layout = table.gettablelayout(); // register button "start game" textbutton startgamebutton = new textbutton( "start game", skin ); startgamebutton.setclicklistener( new clicklistener() { @override public void click(actor actor,float x,float y ) { system.out.println("hiii"); assets.load(); //game.getsoundmanager().play( tyriansound.click ); game.setscreen( new gamescreen(game) ); } } ); layout.register( "startgamebutton", startgamebutton ); 

how handle clicklistener of button in libgdx? not image button, layout button.

you have add button stage , call

gdx.input.setinputprocessor(stage); 

Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

c++ - Accessing inactive union member and undefined behavior? -

php - Get uncommon values from two or more arrays -