How to Center Text In Libgdx

Josh Libgdx Leave a Comment

CodeProject An interesting dilemma that I ran into when working on my game in Libgdx with your favorite subject! Fonts, specifically today,  I wanted to talk about how to center text in Libgdx. For example let’s say you want to have text on an HP bar. How would you keep it in the center? You might try to manually position …

How to run your Libgdx game your desktop

Josh Libgdx Leave a Comment

CodeProject When just starting out in Libgdx to develop a mobile game I came into a fast realization. It’s a big pain in the butt to constantly test my changes from the game to my phone. Luckily, I quickly realized that you can run your game on your desktop instead of Android. Hurray for cross-platform! Here’s a little brief guide …

Higher Quality Small Font Size in Libgdx

Josh Libgdx Leave a Comment

CodeProject So continuing from my previous post about using a True Font Type for LibGDX, there’s a problem you might notice that will happen when your font size is too small. The quality suffers! Check this out for example:  vs  On the left side you can see that the font looks horrible and you can’t make anything out. On the …

Using AssetManager to Store Your Bitmap Fonts in Libgdx

Josh Libgdx Leave a Comment

CodeProject I’ve been running into a lot of problems with using fonts recently, so here’s another problem I encountered when I was trying to use an AssetManager to help me managet my BitmapFont class. If you looked up something similar to Libgdx asset manager font on Google you might find the link to the AssetManager wiki and while it explained …

Using True Fonts For Your Libgdx project

Josh Libgdx Leave a Comment

CodeProject I just spent a good 20 minutes trying to figure out how to use my own custom fonts for my games so this should is a short little guide on how to use a font file (.tff) to create and use a font in LibGdx. I’m sure there are other ways, but here’s how I was able to do …