本文整理汇总了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);
}