I am using a BitmapFont to render text the problem is that I decided to use TrueTypeFontFactory.createBitmapFont method to create the BitmapFont so I can use my own font instead of the default one. The text is rendered with no problems except it is fliped in the y axis, before using the TrueTypeFontFactory.createBitmapFont method I would just create a BitmapFont and pass true in the constructor in order to flip it, but now that I am using the TrueTypeFontFactory I can't do it that way, and I don't seem to be able to do it after the BitmapFont is created because there are no methods to do so. So I was wondering how could I flip the font in this case?
6
votes
3 Answers
13
votes
2
votes
You can use FreeTypeFontParameter of flip=true function (parameter.flip=true) default is false
FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("font/font.ttf"));
FreeTypeFontParameter parameter = new FreeTypeFontParameter();
parameter.size = 12;
parameter.flip=true;
BitmapFont font = generator.generateFont(parameter); // font size 12 pixels