Java Code Examples for com.badlogic.gdx.scenes.scene2d.ui.Button#setDisabled()

The following examples show how to use com.badlogic.gdx.scenes.scene2d.ui.Button#setDisabled() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DieSettingsWindow.java    From dice-heroes with GNU General Public License v3.0 5 votes vote down vote up
private void updateChangeNameButton(Button button, Params params) {
    final Item coin = Config.items.get("coin");
    button.setDisabled(params.die.renames == 0 && params.userData.getItemCount(coin) == 0);
    button.clearChildren();
    if (params.die.renames == 0) {
        button.add(new LocLabel("ui-change-name-for")).padLeft(4);
        Image image = new Image(Config.skin, "item/coin");
        image.setScaling(Scaling.none);
        button.add(image).padTop(0).padBottom(-4);
        button.add("1").padRight(4);
    } else {
        button.add(new LocLabel("ui-change-name"));
    }
}
 
Example 2
Source File: TrackListPanel.java    From gdx-soundboard with MIT License 4 votes vote down vote up
private void enableDisable(List<Track> trackList, Button add, Button remove){
    add.setDisabled(state == null);
    remove.setDisabled(trackList.getSelected() == null || trackList.getItems().size == 0);
}