本文整理匯總了Java中com.badlogic.gdx.scenes.scene2d.ui.Button.setDisabled方法的典型用法代碼示例。如果您正苦於以下問題:Java Button.setDisabled方法的具體用法?Java Button.setDisabled怎麽用?Java Button.setDisabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.scenes.scene2d.ui.Button
的用法示例。
在下文中一共展示了Button.setDisabled方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addButton
import com.badlogic.gdx.scenes.scene2d.ui.Button; //導入方法依賴的package包/類
public void addButton(LabelStyle style, String label, String secondaryLabel, Runnable action, boolean active) {
Button b = new Button(skin.get(ButtonStyle.class));
if (action != null)
b.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
action.run();
}
});
b.setDisabled(!active);
b.add(new Label(label, style)).left();
if (secondaryLabel != null && !secondaryLabel.isEmpty())
b.add(new Label(secondaryLabel, style)).padRight(15f);
table.add(b).minHeight(b.getMinHeight()).prefHeight(b.getPrefHeight()).left().padLeft(1f).colspan(nbColumns);
table.row();
}
示例2: addButtonSprite
import com.badlogic.gdx.scenes.scene2d.ui.Button; //導入方法依賴的package包/類
/**
* Adds a button to the menu, with an icon on the left and label on the right.
*/
public Button addButtonSprite(Drawable icon, String label, Runnable action, boolean active) {
LabelStyle style = active ? skin.get(LabelStyle.class) : skin.get("inactive", LabelStyle.class);
Button b = new Button(skin.get(ButtonStyle.class));
if (action != null)
b.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
action.run();
}
});
b.setDisabled(!active);
b.add(new Image(icon, Scaling.fit)).left();
Label l = new Label(label, style);
l.setWrap(true);
b.add(l).padLeft(8).right().expandX().fillX();
table.add(b).minHeight(b.getMinHeight()).prefHeight(b.getPrefHeight()).left().padLeft(1f).colspan(nbColumns);
table.row();
return b;
}
示例3: updateChangeNameButton
import com.badlogic.gdx.scenes.scene2d.ui.Button; //導入方法依賴的package包/類
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"));
}
}
示例4: disableButton
import com.badlogic.gdx.scenes.scene2d.ui.Button; //導入方法依賴的package包/類
private void disableButton(Button button, boolean disable){
if( disable ){
button.setDisabled(true);
button.setTouchable(Touchable.disabled);
}else{
button.setDisabled(false);
button.setTouchable(Touchable.enabled);
}
}
示例5: updateWidgets
import com.badlogic.gdx.scenes.scene2d.ui.Button; //導入方法依賴的package包/類
private void updateWidgets () {
for (Button b : buttons)
b.setDisabled(!loaded);
}
示例6: addButton
import com.badlogic.gdx.scenes.scene2d.ui.Button; //導入方法依賴的package包/類
public void addButton (Button button) {
buttons.add(button);
button.setDisabled(!loaded);
}
示例7: addButton
import com.badlogic.gdx.scenes.scene2d.ui.Button; //導入方法依賴的package包/類
public void addButton (Button button) {
buttons.add(button);
button.setDisabled(!loaded);
}
示例8: enableDisable
import com.badlogic.gdx.scenes.scene2d.ui.Button; //導入方法依賴的package包/類
private void enableDisable(List<Track> trackList, Button add, Button remove){
add.setDisabled(state == null);
remove.setDisabled(trackList.getSelected() == null || trackList.getItems().size == 0);
}