Ejemplo n.º 1
0
  /** Draw score counters */
  private void drawScore(SpriteBatch batch) {
    BitmapFont font = getFont();

    if (!bareScoreCnt.isStopped()) {
      bareScoreCnt.update(Gdx.graphics.getDeltaTime());

      String str = "" + bareScoreCnt.getValue();
      font.draw(
          batch, str, -(str.length() * font.getSpaceWidth()) / 2.0f, font.getXHeight() + 150.0f);
    } else if (!additionalPointsCnt.isStopped()) {
      additionalPointsCnt.update(Gdx.graphics.getDeltaTime());

      String str = bareScoreCnt.getValue() + " + " + additionalPointsCnt.getValue();
      font.draw(
          batch, str, -(str.length() * font.getSpaceWidth()) / 2.0f, font.getXHeight() + 150.0f);
    } else {
      String str = bareScoreCnt.getValue() + " + " + additionalPointsCnt.getValue() + scoreText;
      font.draw(
          batch, str, -(str.length() * font.getSpaceWidth()) / 2.0f, font.getXHeight() + 150.0f);
    }
  }
Ejemplo n.º 2
0
  /** Draw score counters and badges */
  private void drawStats(SpriteBatch batch) {
    BitmapFont font = getFont();

    /* Level cleared text */
    font.draw(
        batch,
        levelClearedText,
        -(levelClearedText.length() * font.getSpaceWidth()) / 2.0f,
        font.getXHeight() + 250.0f);

    drawScore(batch);
    drawBadges(batch);
  }
Ejemplo n.º 3
0
  @Override
  public void update(float deltaTime) {
    getSpriteBatch().begin();

    String text = getAshEngine().getCurrentCalendar().getFormattedCalendarString();

    mDefaultFont.draw(
        getSpriteBatch(),
        text,
        Gdx.graphics.getWidth() - (text.length() * mDefaultFont.getXHeight()),
        50);

    getSpriteBatch().end();
  }
Ejemplo n.º 4
0
  public CommonDrawer() {
    myTextureChecker = new TextureChecker();
    w = Gdx.graphics.getWidth();
    h = Gdx.graphics.getHeight();
    r = w / h;
    mySpriteBatch = new SpriteBatch();

    final FileHandle fontFile = FileManager.getInstance().getFontsDirectory().child("main.fnt");
    myFont = new BitmapFont(fontFile, true);
    myFont.setUseIntegerPositions(false);

    myOrigFontHeight = myFont.getXHeight();

    layout = new GlyphLayout();
  }
Ejemplo n.º 5
0
 public int getEX() {
   return (int) bitmapFont.getXHeight();
 }