Dialog's Object Position Libgdx
I have a Dialog : Dialog dialog=new Dialog('',style); dialog.setSize(400, 500); dialog.setPosition(Gdx.graphics.getWidth()/2-200, Gdx.graphics.getHeight()/2-300); I added a two bu
Solution 1:
The buttons of a libgdx dialog get added to the ButtonTable of the Dialog, you can get this table by calling getButtonTable()
method and then arrange the buttons like you would do it with any other Table
.
The following code would place goButton below the stopButton for example:
dialog.button(stopButton);
dialog.getButtonTable().row();
dialog.button(goButton);
If you want to fine-tune the layout more, you could just add the buttons to the table and use some TableLayout methods, like for example the below code would add some padding:
dialog.getButtonTable().add(stopButton).pad(20);
dialog.getButtonTable().add(goButton).pad(20);
Post a Comment for "Dialog's Object Position Libgdx"