Ejemplo n.º 1
0
  @Override
  public void render() {
    panels[currentPageIndex].render();
    if (buttonBuy.checkButton()) {
      if (!panels[currentPageIndex].buySelectedItem()) {
        setErrorText(panels[currentPageIndex].getErrorText());
        animatedText.startAnimation();

      } else {
        resetGoldValue();
      }
    }
    if (buttonExit.checkButton()) {
      mainClass.setCurrentSate(StateOfGame.MENU);
    }
    if (buttonNext.checkButton()) {
      currentPageIndex++;
      if (currentPageIndex >= panels.length) {
        currentPageIndex = 0;
      }
    }
    if (buttonPrevious.checkButton()) {
      currentPageIndex--;
      if (currentPageIndex <= -1) {
        currentPageIndex = (byte) (panels.length - 1);
      }
    }
    StaticBitmapFont.begin();
    StaticBitmapFont.draw(playerGoldTextGlyph, goldTextX, goldTextY);
    StaticBitmapFont.draw(playerGoldValueGlyph, goldNumberX, goldNumberY);
    animatedText.render();

    StaticBitmapFont.end();
  }
Ejemplo n.º 2
0
 public void resetGoldValue() {
   playerGoldValueGlyph.setText(
       StaticBitmapFont.getBitmapFont(),
       "" + FastClicker.getMoney(),
       Color.YELLOW,
       0,
       Align.left,
       false);
   goldNumberX = (int) ((FastClicker.WIDTH - playerGoldValueGlyph.width) / 2);
 }