示例#1
0
  @Override
  protected void initComponents() {
    super.initComponents();

    pauseUiController = new PauseUiController();
    ClickListener buttonListener = new PauseButtonListener();

    lbTitle = new Label("Arsphema", UiStyles.getSpaceLabelStyle(0));
    lbPause = new Label("Paused...", UiStyles.getTitleLabelStyle(0));
    btnBack = new Button(new TextureRegion(UiStyles.UI_ICON_TEXTURE_REGION, 600, 0, 300, 300));
    btnBack.setClickListener(buttonListener);
    btnHome = new Button(new TextureRegion(UiStyles.UI_ICON_TEXTURE_REGION, 600, 600, 300, 300));
    btnHome.setClickListener(buttonListener);
  }
 public BlackoutScreen(final CritterCaptors game, final BattleScreen battleScreen) {
   super(game);
   final int lostCash = game.getCharacter().blackout();
   final Button okButton = new TextButton("Ok", skin.getStyle(TextButtonStyle.class), "ok");
   okButton.setClickListener(
       new ClickListener() {
         @Override
         public void click(Actor actor, float arg1, float arg2) {
           for (Creature creature : game.getCharacter().getOwnedCreatures()) creature.heal();
           battleScreen.endBattle();
         }
       });
   Window window = new Window("Blackout", skin);
   window.add(
       new Label(
           "You have blacked out\nand lost $"
               + lostCash
               + ".\nYou have been healed, but\n"
               + "please take better care\nnext time, as your creatures\n"
               + "are not pleased by this\nbehavior.\nReinserting into world...",
           skin));
   window.row();
   window.add(okButton);
   window.pack();
   window.x = Gdx.graphics.getWidth() / 2 - window.width / 2;
   window.y = Gdx.graphics.getHeight() / 2 - window.height / 2;
   stage.addActor(window);
 }