Libgdx - BitmapFont

Hi, I need some troubleshooting about BitmapFont


//called in the const.
               font = new BitmapFont();

// called in the renderloop
                spriteBatch.setProjectionMatrix(RessourceManager.camera.combined);
		spriteBatch.disableBlending();
		spriteBatch.begin();
		font.setColor(1, 1, 1, 0);
		
		font.draw(spriteBatch, "TEST", 300, 300);
		spriteBatch.end();

The Background of the String is also rendered white, so it’s quite hard to read.
In addition it just looks weird. What am I doing wrong?

Do you have any link where I can download .fnt + .png files? google doesn’t help me, only shows .ftt or .fnt without the png file

Is it possible to use awt-font -> slick Truefont -> libgdx bitefont?
How to you render strings?
best regards

Sorry, I’m not a pro at stuff with libGDX, but have you enabled Blending first?
[icode]
Gdx.gl.glEnable(GL.GL_BLEND);
[/icode]

  • Don’t disable blending; that’s why you’re getting opaque background.
  • Don’t set alpha to zero, otherwise you won’t see it when blending is enabled.
  • Create bitmap fonts with BMFont or TWL Font Tool
  • Don’t use AWT fonts, as they won’t work on Android
  • If you need TTF there is a freetype extension for LibGDX

thx, everything works ;D
Someday I’ll write a programming book called “Don’t believe google” ::slight_smile:
best regards