javaandroidlibgdxfreetypebitmap-fonts

GdxFreetype and camera: fonts become blurry


I generate my BitmapFonts at runtime with GdxFreetype. As the parameter.size is in pixels and I use a camera which scales up the scene, the font becomes blurry (even with texture filters at higher resolutions).

I need a way to create fonts based on the current resolution. How can I achieve that?


Solution

  • Just use two different cameras! One for your game that could have virtual size(say 16x20) and one pixel perfect camera. Draw those bitmap fonts using the second one. And for dynamically setting parameter size while generating them i personally use

     ORIGINAL_SCREEN_HEIGHT/SOME_CONSTANT