Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scale a Bitmapfont in LibGDX

Tags:

How can I scale a Bitmapfont object in LibGDX? It seems the method setScale is no longer available.

like image 937
Pedro Romano Barbosa Avatar asked Apr 27 '15 22:04

Pedro Romano Barbosa


People also ask

What are the downsides of using a bitmap font?

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.

How can I create a bitmap font in Android?

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.

Is libGDX-FreeType compatible with HTML5?

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.


1 Answers

Use bitmapFont.getData().setScale(float x, float y).

like image 139
Tenfour04 Avatar answered Sep 30 '22 01:09

Tenfour04