Esempio n. 1
0
 private void drawUI() {
   if (game.getGameState() == Game.GameState.START) {
     if (!infoLabel.isVisible()) infoLabel.setVisible(true);
   } else if (game.getGameState() == Game.GameState.RUNNING) {
     if (infoLabel.isVisible()) infoLabel.setVisible(false);
   }
 }
Esempio n. 2
0
  @Override
  public void show() {
    super.show();

    gameTimeLabel.setPosition(
        SCREEN_WIDTH / 2 - (gameTimeLabel.getPrefWidth() / 2), SCREEN_HEIGHT * 0.8f);
    uiStage.addActor(gameTimeLabel);

    infoLabel.setPosition(SCREEN_WIDTH / 2 - (infoLabel.getPrefWidth() / 2), SCREEN_HEIGHT * 0.5f);
    infoLabel.setVisible(false);
    uiStage.addActor(infoLabel);

    Gdx.input.setInputProcessor(game);
  }