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


Java Dialog.text方法代碼示例

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


在下文中一共展示了Dialog.text方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: showAddFontSizeError

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
private void showAddFontSizeError(String name) {
    Dialog dialog = new Dialog("", getSkin(), "bg");
    
    dialog.getContentTable().defaults().pad(10.0f);
    Label label = new Label("Error adding font...", getSkin(), "title");
    dialog.getContentTable().add(label);
    
    dialog.getContentTable().row();
    dialog.text("Unable to add font \"" + name +
            "\". Ensure image dimensions\nare less than max texture dimensions (" +
            maxTextureWidth + "x" + 
            maxTextureHeight + ").\nSee project settings.");
    
    dialog.getButtonTable().defaults().padBottom(10.0f).minWidth(50.0f);
    dialog.button("Ok");
    dialog.key(Keys.ENTER, null).key(Keys.ESCAPE, null);
    dialog.show(getStage());
}
 
開發者ID:raeleus,項目名稱:skin-composer,代碼行數:19,代碼來源:DialogFonts.java

示例4: showDeleteStyleDialog

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
public void showDeleteStyleDialog(Skin skin, Stage stage) {
    StyleData styleData = main.getRootTable().getSelectedStyle();

    Dialog dialog = new Dialog("Delete Style", skin, "bg") {
        @Override
        protected void result(Object object) {
            if ((Boolean) object) {
                main.getUndoableManager().addUndoable(new DeleteStyleUndoable(styleData, main), true);
            }
        }
    };
    dialog.getTitleLabel().setAlignment(Align.center);
    dialog.getContentTable().defaults().padLeft(10.0f).padRight(10.0f);
    dialog.text("Are you sure you want to delete style " + styleData.name + "?");
    dialog.getContentTable().getCells().first().pad(10.0f);

    dialog.getButtonTable().defaults().padBottom(10.0f).minWidth(50.0f);
    dialog.button("Yes, delete the style", true).button("No", false);
    dialog.getButtonTable().getCells().first().getActor().addListener(main.getHandListener());
    dialog.getButtonTable().getCells().get(1).getActor().addListener(main.getHandListener());

    dialog.key(Input.Keys.ENTER, true).key(Input.Keys.ESCAPE, false);

    dialog.show(stage);
}
 
開發者ID:raeleus,項目名稱:skin-composer,代碼行數:26,代碼來源:DialogFactory.java

示例5: yesNoDialog

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
public void yesNoDialog(String title, String text,
        ConfirmationListener listener) {
    Dialog dialog = new Dialog(title, main.getSkin(), "bg") {
        @Override
        protected void result(Object object) {
            listener.selected((int) object);
        }
    };
    dialog.getTitleTable().getCells().first().padLeft(5.0f);
    Label label = new Label(text, main.getSkin());
    label.setAlignment(Align.center);
    dialog.text(label);
    dialog.getContentTable().getCells().first().pad(10.0f);
    dialog.getButtonTable().defaults().padBottom(10.0f).minWidth(50.0f);
    dialog.button("Yes", 0);
    dialog.button("No", 1);
    dialog.getButtonTable().getCells().first().getActor().addListener(main.getHandListener());
    dialog.getButtonTable().getCells().get(1).getActor().addListener(main.getHandListener());
    dialog.key(Input.Keys.ESCAPE, 1);
    dialog.show(main.getStage());
}
 
開發者ID:raeleus,項目名稱:skin-composer,代碼行數:22,代碼來源:DialogFactory.java

示例6: yesNoCancelDialog

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
public void yesNoCancelDialog(String title, String text,
        ConfirmationListener listener) {
    Dialog dialog = new Dialog(title, main.getSkin(), "bg") {
        @Override
        protected void result(Object object) {
            listener.selected((int) object);
        }
    };
    dialog.getTitleTable().getCells().first().padLeft(5.0f);
    Label label = new Label(text, main.getSkin());
    label.setAlignment(Align.center);
    dialog.text(label);
    dialog.getContentTable().getCells().first().pad(10.0f);
    dialog.getButtonTable().defaults().padBottom(10.0f).minWidth(50.0f);
    dialog.button("Yes", 0);
    dialog.button("No", 1);
    dialog.button("Cancel", 2);
    dialog.getButtonTable().getCells().first().getActor().addListener(main.getHandListener());
    dialog.getButtonTable().getCells().get(1).getActor().addListener(main.getHandListener());
    dialog.getButtonTable().getCells().get(2).getActor().addListener(main.getHandListener());
    dialog.key(Input.Keys.ESCAPE, 2);
    dialog.show(main.getStage());
}
 
開發者ID:raeleus,項目名稱:skin-composer,代碼行數:24,代碼來源:DialogFactory.java

示例7: showDialogError

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
public void showDialogError(String title, String message, Runnable runnable) {
    Dialog dialog = new Dialog(title, main.getSkin(), "bg") {
        @Override
        public boolean remove() {
            if (runnable != null) {
                runnable.run();
            }
            return super.remove();
        }

    };

    dialog.text(message);
    dialog.button("OK");
    dialog.getButtonTable().getCells().first().getActor().addListener(main.getHandListener());
    dialog.show(main.getStage());
}
 
開發者ID:raeleus,項目名稱:skin-composer,代碼行數:18,代碼來源:DialogFactory.java

示例8: FramedDialog

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
public FramedDialog(Skin skin, String title, String message) {
  this.skin = skin;

  frame = new Image(skin.getPatch("frame"));

  // TODO find why title is outside the box
  dialog = new Dialog(title, skin) {
    @Override
    protected void result(Object object) {
      fadeOut();
    }
  };
  dialog.setBackground(skin.getTiledDrawable("menuTexture"));
  dialog.getContentTable().defaults().expandX().fillX();
  dialog.getButtonTable().defaults().expandX().fillX();

  Label label = new Label(message, skin);
  label.setAlignment(Align.center);
  label.setWrap(true);

  dialog.text(label);
}
 
開發者ID:guillaume-alvarez,項目名稱:ShapeOfThingsThatWere,代碼行數:23,代碼來源:FramedDialog.java

示例9: inviteSelected

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
public void inviteSelected(String[] availableMods, Stage stage, final CardshifterClient client) {
    if (selected == null) {
        return;
    }

    Dialog dialog = new Dialog("Invite " + selected.getName(), skin) {
        @Override
        protected void result(Object object) {
        	if (object != null) {
                client.send(new StartGameRequest(selected.getId(), (String) object));
                callback.callback((String) object);
        	}
        }
    };
    dialog.text("Which mod do you want to play?");
    for (String mod : availableMods) {
        dialog.button(mod, mod);
    }
    dialog.button("Cancel");
    dialog.show(stage);
}
 
開發者ID:Cardshifter,項目名稱:Cardshifter,代碼行數:22,代碼來源:UsersList.java

示例10: onClientConnected

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
@Override
public void onClientConnected(IOException e) {
	connectingDialog.setVisible(false);
	if (e == null) {
		game.pushScreen("lobby");
	} else {
		game.setCurrentSession(null);

		Dialog dialog = new Dialog("Fehler", skin);
		dialog.text(e.getMessage());
		dialog.button("Ok", true);
		dialog.key(Keys.ENTER, true);
		dialog.show(stage);
	}
}
 
開發者ID:eskalon,項目名稱:ProjektGG,代碼行數:16,代碼來源:ServerBrowserScreen.java

示例11: onHostStarted

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
@Override
public void onHostStarted(IOException e) {
	connectingDialog.setVisible(false);
	if (e == null) {
		game.pushScreen("lobby");
	} else {
		game.setCurrentSession(null);
		Dialog dialog = new Dialog("Fehler", skin);
		dialog.text(e.getMessage());
		dialog.button("Ok", true);
		dialog.key(Keys.ENTER, true);
		dialog.show(stage);
	}
}
 
開發者ID:eskalon,項目名稱:ProjektGG,代碼行數:15,代碼來源:LobbyCreationScreen.java

示例12: showConfirmDeleteDialog

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
/**
 * Shows a dialog to confirm deletion of all TintedDrawables based on the
 * provided drawable data. This is called when the delete button is pressed
 * on a drawable in the drawable list.
 * @param drawable 
 */
private void showConfirmDeleteDialog(DrawableData drawable) {
    Dialog dialog = new Dialog("Delete duplicates?", getSkin(), "bg"){
        @Override
        protected void result(Object object) {
            if ((boolean) object) {
                main.getProjectData().setChangesSaved(false);
                removeDuplicateDrawables(drawable.file);
                gatherDrawables();
                sortBySelectedMode();
            }
        }
    };
    
    dialog.getTitleTable().padLeft(5.0f);
    dialog.getContentTable().padLeft(10.0f).padRight(10.0f).padTop(5.0f);
    dialog.getButtonTable().padBottom(15.0f);
    
    dialog.text("Deleting this drawable will also delete one or more tinted drawables.\n"
            + "Delete duplicates?");
    dialog.button("OK", true);
    dialog.button("Cancel", false);
    dialog.getButtonTable().getCells().first().getActor().addListener(main.getHandListener());
    dialog.getButtonTable().getCells().get(1).getActor().addListener(main.getHandListener());
    dialog.key(Input.Keys.ENTER, true);
    dialog.key(Input.Keys.ESCAPE, false);
    dialog.show(getStage());
}
 
開發者ID:raeleus,項目名稱:skin-composer,代碼行數:34,代碼來源:DialogDrawables.java

示例13: showDrawableError

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
/**
 * Show an setStatusBarError indicating a drawable that exceeds project specifications
 */
private void showDrawableError() {
    Dialog dialog = new Dialog("Error...", getSkin(), "bg");
    
    dialog.getTitleTable().padLeft(5.0f);
    dialog.getContentTable().padLeft(10.0f).padRight(10.0f).padTop(5.0f);
    dialog.getButtonTable().padBottom(15.0f);
    
    Label label = new Label("Error while adding new drawables.\nEnsure that image dimensions are\nless than maximums specified in project.\nRolling back changes...", getSkin());
    label.setAlignment(Align.center);
    dialog.text(label);
    dialog.button("OK");
    dialog.show(getStage());
}
 
開發者ID:raeleus,項目名稱:skin-composer,代碼行數:17,代碼來源:DialogDrawables.java

示例14: showRemoveDuplicatesDialog

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
/**
 * Shows a dialog to confirm removal of duplicate drawables that have the
 * same name without extension. This is called after selecting new drawables.
 * @param unhandledFiles
 * @param backup
 * @param filesToProcess 
 */
private void showRemoveDuplicatesDialog(Array<FileHandle> unhandledFiles, Array<DrawableData> backup, Array<FileHandle> filesToProcess) {
    Dialog dialog = new Dialog("Delete duplicates?", getSkin(), "bg"){
        @Override
        protected void result(Object object) {
            if ((boolean) object) {
                for (FileHandle fileHandle : unhandledFiles) {
                    removeDuplicateDrawables(fileHandle);
                    filesToProcess.add(fileHandle);
                }
            }
            finalizeDrawables(backup, filesToProcess);
        }
    };
    
    dialog.getTitleTable().padLeft(5.0f);
    dialog.getContentTable().padLeft(10.0f).padRight(10.0f).padTop(5.0f);
    dialog.getButtonTable().padBottom(15.0f);
    
    dialog.text("Adding this drawable will overwrite one or more drawables\n"
            + "Delete duplicates?");
    dialog.button("OK", true);
    dialog.button("Cancel", false);
    dialog.getButtonTable().getCells().first().getActor().addListener(main.getHandListener());
    dialog.getButtonTable().getCells().get(1).getActor().addListener(main.getHandListener());
    dialog.key(Input.Keys.ENTER, true);
    dialog.key(Input.Keys.ESCAPE, false);
    dialog.show(getStage());
}
 
開發者ID:raeleus,項目名稱:skin-composer,代碼行數:36,代碼來源:DialogDrawables.java

示例15: showCloseDialog

import com.badlogic.gdx.scenes.scene2d.ui.Dialog; //導入方法依賴的package包/類
public void showCloseDialog() {
    if (main.getProjectData().areChangesSaved() || main.getProjectData().isNewProject()) {
        Gdx.app.exit();
    } else {
        if (!showingCloseDialog) {
            showingCloseDialog = true;
            Dialog dialog = new Dialog("Save Changes?", main.getSkin(), "bg") {
                @Override
                protected void result(Object object) {
                    if ((int) object == 0) {
                        main.getMainListener().saveFile(() -> {
                            if (main.getProjectData().areChangesSaved()) {
                                Gdx.app.exit();
                            }
                        });
                    } else if ((int) object == 1) {
                        Gdx.app.exit();
                    }

                    showingCloseDialog = false;
                }
            };
            dialog.getTitleTable().getCells().first().padLeft(5.0f);
            Label label = new Label("Do you want to save\nyour changes before you quit?", main.getSkin());
            label.setAlignment(Align.center);
            dialog.text(label);
            dialog.getContentTable().getCells().first().pad(10.0f);
            dialog.getButtonTable().defaults().padBottom(10.0f).minWidth(50.0f);
            dialog.button("Yes", 0).button("No", 1).button("Cancel", 2);
            dialog.getButtonTable().getCells().first().getActor().addListener(main.getHandListener());
            dialog.getButtonTable().getCells().get(1).getActor().addListener(main.getHandListener());
            dialog.getButtonTable().getCells().get(2).getActor().addListener(main.getHandListener());
            java.awt.Toolkit.getDefaultToolkit().beep();
            dialog.show(main.getStage());
        }
    }
}
 
開發者ID:raeleus,項目名稱:skin-composer,代碼行數:38,代碼來源:DialogFactory.java


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