How can I scale a Bitmapfont object in LibGDX? It seems the method setScale is no longer available.
But the downfall is that it can look pixelated especially when scaling upwards. A fancy large bitmap font can take up a lot of space and if you need many different fonts you might go over your budget. By using Gdx.Freetype you are able to create bitmapfonts at runtime from small .ttf files.
By using Gdx.Freetype you are able to create bitmapfonts at runtime from small .ttf files. This means you only need to ship the .ttf files with your app and can generate a font based on user settings like resolution. Other then scaling and the freetype solution is having multiple bitmaps of different font sizes.
gdx-freetype is not compatible with HTML5. However, you may use the gdx-freetype-gwt library by Intrigus to enable HTML5 functionality. Version 1.9.10.1 remains compatible with never versions of libGDX, including 1.10.0.
Use bitmapFont.getData().setScale(float x, float y)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With