Пример #1
0
 private TextBounds createBounds(Integer index) {
   return new Label(
           "", new LabelStyle(genericTextBoxMap.get(Helper.TEXTBOX_SIZE.get(index)), Color.WHITE))
       .getStyle()
       .font
       .getBounds(Helper.TEXTBOX_TEXT.get(index));
 }
Пример #2
0
 private void drawGameOver() {
   drawTextBox(gameOverBounds.height);
   genericTextBoxMap
       .get(Helper.TEXTBOX_SIZE.get(Helper.TEXTBOX_INDEX_GAME_OVER))
       .draw(
           batch,
           Helper.TEXTBOX_TEXT.get(Helper.TEXTBOX_INDEX_GAME_OVER),
           border + (Sizes.DEFAULT_WORLD_WIDTH) / 2 * ppux - gameOverBounds.width / 2,
           (Sizes.DEFAULT_WORLD_HEIGHT - (Sizes.TEXTBOX_OFFSET + Sizes.TEXTBOX_HEIGHT)) * ppuy);
 }
Пример #3
0
 private void drawPauseTextBox() {
   drawTextBox(pauseBounds.height);
   genericTextBoxMap
       .get(Helper.TEXTBOX_SIZE.get(Helper.TEXTBOX_INDEX_PAUSE))
       .draw(
           batch,
           Helper.TEXTBOX_TEXT.get(Helper.TEXTBOX_INDEX_PAUSE),
           border + (Sizes.DEFAULT_WORLD_WIDTH) / 2 * ppux - pauseBounds.width / 2,
           (Sizes.DEFAULT_WORLD_HEIGHT - (Sizes.TEXTBOX_OFFSET + Sizes.TEXTBOX_HEIGHT)) * ppuy);
 }
Пример #4
0
  private void drawLevelScore(GameController gamecontroller, int score) {
    drawTextBox(levelFinishedBounds.height * 3.5f);
    genericTextBoxMap
        .get(Helper.TEXTBOX_SIZE.get(Helper.TEXTBOX_INDEX_LEVEL))
        .draw(
            batch,
            Helper.TEXTBOX_TEXT.get(Helper.TEXTBOX_INDEX_LEVEL) + gamecontroller.getTextBoxLevel(),
            border + (Sizes.DEFAULT_WORLD_WIDTH) / 2 * ppux - levelFinishedBounds.width / 2,
            (Sizes.DEFAULT_WORLD_HEIGHT - (Sizes.TEXTBOX_OFFSET + Sizes.TEXTBOX_HEIGHT)) * ppuy);

    genericTextBoxMap
        .get(Helper.TEXTBOX_SIZE.get(Helper.TEXTBOX_INDEX_TIME))
        .draw(
            batch,
            Helper.TEXTBOX_TEXT.get(Helper.TEXTBOX_INDEX_TIME) + gamecontroller.getTimeNeeded(),
            border + (Sizes.DEFAULT_WORLD_WIDTH) / 2 * ppux - levelFinishedBounds.width / 2,
            (Sizes.DEFAULT_WORLD_HEIGHT
                        - (Sizes.TEXTBOX_OFFSET + Sizes.TEXTBOX_HEIGHT + Helper.BREAK_SIZE))
                    * ppuy
                - levelFinishedBounds.height);

    genericTextBoxMap
        .get(Helper.TEXTBOX_SIZE.get(Helper.TEXTBOX_INDEX_BONUS))
        .draw(
            batch,
            Helper.TEXTBOX_TEXT.get(Helper.TEXTBOX_INDEX_BONUS) + score,
            border + (Sizes.DEFAULT_WORLD_WIDTH) / 2 * ppux - levelFinishedBounds.width / 2,
            (Sizes.DEFAULT_WORLD_HEIGHT
                        - (Sizes.TEXTBOX_OFFSET + Sizes.TEXTBOX_HEIGHT + Helper.BREAK_SIZE))
                    * ppuy
                - levelFinishedBounds.height * 2);
    genericTextBoxMap
        .get(Helper.TEXTBOX_SIZE.get(Helper.TEXTBOX_INDEX_TAP))
        .draw(
            batch,
            Helper.TEXTBOX_TEXT.get(Helper.TEXTBOX_INDEX_TAP),
            border + (Sizes.DEFAULT_WORLD_WIDTH) / 2 * ppux - tapBounds.width / 2,
            (Sizes.DEFAULT_WORLD_HEIGHT
                        - (Sizes.TEXTBOX_OFFSET + Sizes.TEXTBOX_HEIGHT + Helper.BREAK_SIZE))
                    * ppuy
                - levelFinishedBounds.height * 3);
  }