Button ClickListener is not working in LibGDX game

后端 未结 2 895
时光取名叫无心
时光取名叫无心 2020-12-18 19:31

I am developing an Android game using LibGDX. There are 4 buttons in a menu screen, but the ClickListener of these buttons is not working.

//         


        
2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-18 19:42

    You have to add the button to the stage and call

    Gdx.input.setInputProcessor(stage);
    

提交回复
热议问题