コード例 #1
0
  private void createHUD() {
    gameHUD = new HUD();
    scoreText = new Text(0, 0, resourcesManager.gameFont, "Loading...", vbom);
    scoreText.setSkewCenter(0, 0);
    scoreText.setText("Score: 0");
    scoreText.setColor(Color.BLACK);
    gameHUD.attachChild(scoreText);

    timeText = new Text(380, 10, resourcesManager.gameFont, "Loading...", vbom);
    timeText.setSkewCenter(0, 0);
    timeText.setText(String.valueOf(timeLeft));
    timeText.setColor(Color.BLACK);
    gameHUD.attachChild(timeText);

    gameHUD.setChildScene(joystick);
    camera.setHUD(gameHUD);
  }
コード例 #2
0
ファイル: GameScene.java プロジェクト: haquang/pulsardev
 private void createHUD() {
   gameHUD = new HUD();
   t_score_text =
       new Text(
           shift_row / 2,
           6 * GameActivity.getCameraHeight() / 7,
           m_resource_manager.font,
           "Score: 0123456789",
           new TextOptions(org.andengine.util.adt.align.HorizontalAlign.CENTER),
           m_vbom);
   t_score_text.setSkewCenter(0, 0);
   t_score_text.setText("Score: \n 0");
   t_score_text.setPosition(t_score_text.getWidth(), 6 * GameActivity.getCameraHeight() / 7);
   gameHUD.attachChild(t_score_text);
   m_camera.setHUD(gameHUD);
   _score = new Score(_level);
   _score.setTextScore(t_score_text);
 }