本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.ImageButton.setDisabled方法的典型用法代码示例。如果您正苦于以下问题:Java ImageButton.setDisabled方法的具体用法?Java ImageButton.setDisabled怎么用?Java ImageButton.setDisabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.ui.ImageButton
的用法示例。
在下文中一共展示了ImageButton.setDisabled方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addToolBarButton
import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; //导入方法依赖的package包/类
private void addToolBarButton(Skin skin, ImageButton button, String icon, String text, String tooltip) {
ImageButtonStyle style = new ImageButtonStyle(skin.get(ButtonStyle.class));
TextureRegion image = Ctx.assetManager.getIcon(icon);
style.imageUp = new TextureRegionDrawable(image);
try {
TextureRegion imageDisabled = Ctx.assetManager.getIcon(icon + "_disabled");
if(imageDisabled != null)
style.imageDisabled = new TextureRegionDrawable(imageDisabled);
} catch (Exception e) {
}
button.setStyle(style);
// button.row();
// button.add(new Label(text, skin));
add(button);
button.setDisabled(true);
TextTooltip t = new TextTooltip(tooltip, skin);
button.addListener(t);
}
示例2: addToolBarButton
import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; //导入方法依赖的package包/类
public void addToolBarButton(ImageButton button, String icon, String text, String tooltip) {
TextureRegion image = Ctx.assetManager.getIcon(icon);
TextureRegion imageDisabled = Ctx.assetManager.getIcon(icon + "_disabled");
ImageButtonStyle style = new ImageButtonStyle(skin.get("plain", ButtonStyle.class));
style.imageUp = new TextureRegionDrawable(image);
if(imageDisabled != null)
style.imageDisabled = new TextureRegionDrawable(imageDisabled);
button.setStyle(style);
button.pad(6,3,6,3);
addActor(button);
button.setDisabled(true);
TextTooltip t = new TextTooltip(tooltip, skin);
button.addListener(t);
}
示例3: ChapterList
import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; //导入方法依赖的package包/类
public ChapterList(Skin skin) {
super(skin);
list.setCellRenderer(listCellRenderer);
initBtn = new ImageButton(skin);
toolbar.addToolBarButton(initBtn, "ic_check", "Set init chapter",
"Set init chapter");
initBtn.setDisabled(false);
toolbar.hideCopyPaste();
initBtn.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
setDefault();
}
});
}
示例4: createControllerMenu
import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; //导入方法依赖的package包/类
private void createControllerMenu() {
mControllerTable = new Table(mSkin);
mControllerTable.setFillParent(true);
mControllerOverTable = new Table(mSkin);
mControllerOverTable.setFillParent(true);
ImageButton imageButton;
imageButton = new SiggdImageButton("data/gfx/backButton.png").getButton();
imageButton.setColor(1, 1, 1, .75f);
imageButton.addListener(mMainMenu);
imageButton.addListener(mClickListener);
mControllerTable.add(imageButton).space(mVerticalSpacing, mHorizontalSpacing,
mVerticalSpacing, mHorizontalSpacing);
imageButton = new SiggdImageButton("data/gfx/controllerconfig1.png").getButton();
imageButton.setDisabled(true);
mControllerTable.add(imageButton);
imageButton = new SiggdImageButton("data/gfx/backButton.png").getButton();
imageButton.addListener(mMainMenu);
imageButton.addListener(mClickListener);
mControllerTable.add(imageButton).space(mVerticalSpacing, mHorizontalSpacing,
mVerticalSpacing, mHorizontalSpacing);
imageButton.setDisabled(true);
imageButton.setVisible(false);
mControllerLeft = new Image(new Texture(Gdx.files.internal("data/gfx/controllerleft.png")));
mControllerRight = new Image(
new Texture(Gdx.files.internal("data/gfx/controllerright.png")));
mControllerPoof = new Image(new Texture(Gdx.files.internal("data/gfx/controllerpoof.png")));
mControllerSolid = new Image(
new Texture(Gdx.files.internal("data/gfx/controllersolid.png")));
mControllerStart = new Image(
new Texture(Gdx.files.internal("data/gfx/controllerstart.png")));
mControllerDown = new Image(new Texture(Gdx.files.internal("data/gfx/controllerdown.png")));
mControllerUp = new Image(new Texture(Gdx.files.internal("data/gfx/controllerup.png")));
}
示例5: initialize
import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; //导入方法依赖的package包/类
@Override
public void initialize(AssetManager assetManager) {
interfaces = new Array<IGuiInterface>();
float pad30 = 30 * GlobalConf.SCALE_FACTOR;
float pad10 = 10 * GlobalConf.SCALE_FACTOR;
// User interface
ui = new Stage(new ScreenViewport(), GlobalResources.spriteBatch);
skin = GlobalResources.skin;
center = new Table();
center.setFillParent(true);
center.center();
ImageButton logo = new OwnImageButton(skin, "gaiasky-logo");
logo.setDisabled(true);
center.add(logo).center();
center.row().padBottom(pad30);
center.add(new Label(I18n.bundle.get("notif.loading.wait"), skin, "header"));
center.row();
// SCREEN MODE BUTTON - TOP RIGHT
screenMode = new Container<Button>();
screenMode.setFillParent(true);
screenMode.top().right();
screenMode.pad(pad10);
Image smImg = new Image(skin.getDrawable("screen-mode"));
OwnTextIconButton screenModeButton = new OwnTextIconButton("", smImg, skin);
screenModeButton.setCursor(GlobalResources.linkCursor);
screenModeButton.addListener(new EventListener() {
@Override
public boolean handle(Event event) {
if (event instanceof ChangeEvent) {
GlobalConf.screen.FULLSCREEN = !GlobalConf.screen.FULLSCREEN;
EventManager.instance.post(Events.SCREEN_MODE_CMD);
return true;
}
return false;
}
});
screenMode.setActor(screenModeButton);
// MESSAGE INTERFACE - BOTTOM
notificationsInterface = new NotificationsInterface(skin, lock, false, false, false);
center.add(notificationsInterface);
interfaces.add(notificationsInterface);
rebuildGui();
}