當前位置: 首頁>>代碼示例>>Java>>正文


Java Dialog.setModal方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.scenes.scene2d.ui.Dialog.setModal方法的典型用法代碼示例。如果您正苦於以下問題:Java Dialog.setModal方法的具體用法?Java Dialog.setModal怎麽用?Java Dialog.setModal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.scenes.scene2d.ui.Dialog的用法示例。


在下文中一共展示了Dialog.setModal方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: deleteSessionConfirm

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
protected ClickListener deleteSessionConfirm(final int session, final Image btnTrashcan,
		final TextButton btnSession) {
	return new ClickListener() {
		@Override
		public void clicked(InputEvent event, float x, float y) {
			Dialog confirmDelete = new Dialog("ᎯᎠᏍ ᏣᏚᎵᎭ?", skin) {
				protected void result(Object object) {
					if ("YES".equals(object)) {
						SlotFolder.getSlotFolder(session).deleteDirectory();
						btnSession.setText(EMPTY_SLOT+"\n"+nextSessionIndicationText(0l, 0));
						btnTrashcan.setColor(Color.LIGHT_GRAY);
						btnTrashcan.clearListeners();
					}
				};
			};
			confirmDelete.button("ᎥᎥ - YES", "YES");
			confirmDelete.button("ᎥᏝ - NO", "NO");
			confirmDelete.text("Are you sure you want\n" + "to delete this session?\n" + "This cannot be undone!");
			confirmDelete.setModal(true);
			confirmDelete.pack();
			confirmDelete.show(stage);
		}
	};
}
 
開發者ID:CherokeeLanguage,項目名稱:cll1-gdx,代碼行數:25,代碼來源:SelectSession.java

示例2: onBack

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
@Override
protected boolean onBack() {
	userPause();
	pausedStage.getRoot().clearChildren();
	Dialog cancelSession = new Dialog("[PAUSED] CANCEL SESSION?", skin) {
		@Override
		protected void result(Object object) {
			if ("YES".equals(object)) {
				game.previousScreen();
			}
			userResume();
		}
	};
	cancelSession.setModal(true);
	cancelSession.getTitleLabel().setAlignment(Align.center);
	cancelSession.button("ᎥᎥ - YES", "YES");
	cancelSession.button("ᎥᏝ - NO", "NO");
	cancelSession.getContentTable().row();
	cancelSession.text("Are you sure you want to cancel?");
	cancelSession.getContentTable().row();
	cancelSession.text("You will lose all of your");
	cancelSession.getContentTable().row();
	cancelSession.text("progress if you choose ᎥᎥ!");
	cancelSession.show(pausedStage);
	return true;
}
 
開發者ID:CherokeeLanguage,項目名稱:cll1-gdx,代碼行數:27,代碼來源:LearningSession.java

示例3: createDialog

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
private static Dialog createDialog(TaflGame game, Object title, Skin skin, LocaleService ls, DeviceSettings deviceSettings) {

        String localTitle = ls.get(title);
        if (localTitle == null) {
            localTitle = Constants.HudConstants.DEFAULT_DIALOG_TITLE;
        }

        Dialog dialog = new Dialog(localTitle, skin, Assets.Skin.SKIN_STYLE_DIALOG);
        dialog.setMovable(false);
        dialog.setModal(true);

        dialog.padTop(50);

        dialog.getCell(dialog.getButtonTable()).pad(deviceSettings.dialogSpacing);
        dialog.getContentTable().defaults().padTop(deviceSettings.dialogSpacing);
        dialog.getContentTable().defaults().padLeft(deviceSettings.dialogSpacing);
        dialog.getContentTable().defaults().padRight(deviceSettings.dialogSpacing);
        dialog.getButtonTable().defaults().spaceTop(deviceSettings.dialogSpacing);
        dialog.getButtonTable().defaults().spaceBottom(deviceSettings.dialogSpacing);
        dialog.getButtonTable().defaults().padLeft(deviceSettings.dialogSpacing);
        dialog.getButtonTable().defaults().padRight(deviceSettings.dialogSpacing);
        dialog.getButtonTable().defaults().size(deviceSettings.dialogButtonWidth,
                deviceSettings.dialogButtonHeight);

        return dialog;
    }
 
開發者ID:apotapov,項目名稱:tafl,代碼行數:27,代碼來源:HudFactory.java

示例4: firstTime

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
protected void firstTime() {
	log("SHOWING FIRST TIME DIALOG");
	userPause();
	pausedStage.getRoot().clearChildren();
	Dialog firstTimeNotice = new Dialog("HOW THIS WORKS", skin) {
		@Override
		protected void result(Object object) {
			userResume();
			stage.addAction(actionLoadNextChallengeQuick());
		}
	};
	firstTimeNotice.setModal(true);
	firstTimeNotice.setFillParent(true);
	firstTimeNotice.getTitleLabel().setAlignment(Align.center);
	firstTimeNotice.button("ᎰᏩ");

	Table contentTable = firstTimeNotice.getContentTable();
	contentTable.row();
	Table noticeTable = new Table(skin);
	noticeTable.defaults().expand().fill();
	contentTable.add(noticeTable).expand().fill();
	String txt = Gdx.files.internal("text/how-this-works.txt").readString(UTF_8.name());
	Label message = new Label(txt, skin);
	message.setFontScale(.8f);
	message.setWrap(true);
	noticeTable.add(message);
	firstTimeNotice.show(pausedStage);
}
 
開發者ID:CherokeeLanguage,項目名稱:cll1-gdx,代碼行數:29,代碼來源:LearningSession.java

示例5: read

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
@Override
public Actor read(Json json, JsonValue jv, Class arg2) {
	Dialog dialog = new Dialog(jv.getString("title"), Asset.skin);
	dialog.setModal(jv.getBoolean("modal"));
	dialog.setMovable(jv.getBoolean("move"));
	dialog.setResizable(jv.getBoolean("resize"));
	readActor(jv, dialog);
	return dialog;
}
 
開發者ID:pyros2097,項目名稱:GdxStudio,代碼行數:10,代碼來源:Serializer.java

示例6: showFinalStats

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
private void showFinalStats() {
	log("SHOWING FINAL STATS");
	userPause();
	pausedStage.getRoot().clearChildren();
	Dialog finalStats = new Dialog(CLL1.APP_NAME+" FINAL STATS", skin) {
		@Override
		protected void result(Object object) {
			userResume();
			game.previousScreen();
		}
	};
	finalStats.setModal(true);
	finalStats.setFillParent(true);
	finalStats.getTitleLabel().setAlignment(Align.center);
	TextButton howa = new TextButton("ᎰᏩ", skin);
	howa.setDisabled(true);
	finalStats.button(howa);

	DeckStats stats = DeckStats.calculateStats(activeDeck);
	StringBuilder txt = new StringBuilder();
	txt.append("LEVEL: ");
	txt.append(stats.level.getEnglish());
	txt.append("\n");
	txt.append("Active cards: ");
	txt.append(stats.activeCards);
	txt.append("\n");
	txt.append("Score: ");
	txt.append(stats.lastScore);
	txt.append("\n");
	txt.append("Proficiency: ");
	txt.append(stats.proficiency);
	txt.append("%");
	
	int chapter = 0;
	for (ICard<CardData> card: activeDeck.getCards()) {
		chapter=Math.max(chapter, card.getData().chapter);
	}
	txt.append("\n");
	txt.append("Book Chapter: ");
	txt.append(chapter/10);

	Table contentTable = finalStats.getContentTable();
	contentTable.row();
	Table noticeTable = new Table(skin);
	noticeTable.defaults().expand().fill();
	contentTable.add(noticeTable).expand().fill();
	Label message = new Label(txt.toString(), skin);
	message.setAlignment(Align.center);
	message.setWrap(true);
	message.setFontScale(1.2f);
	noticeTable.add(message);
	finalStats.show(pausedStage);

	pausedStage.addAction(actionSaveActiveDeck(howa));
}
 
開發者ID:CherokeeLanguage,項目名稱:cll1-gdx,代碼行數:56,代碼來源:LearningSession.java


注:本文中的com.badlogic.gdx.scenes.scene2d.ui.Dialog.setModal方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。