After analysis of engine source code I had come to conclusion that there is no way to specify BitmapText’s text alignment. Alignment is hidden in StringBlock instance, which is inaccessible outside.
I have to use reflection to get round it:
[java]
BitmapText hint;
…
Field field = BitmapText.class.getDeclaredField(“block”);
field.setAccessible(true);
StringBlock block = (StringBlock) field.get(hint);
block.setAlignment(BitmapFont.Align.Center);
[/java]
It works as I want, but… I hope that a “legal” way escaped my attention or will be implemented soon=))
I guess it safe to add accessors to do that, so you don’t have to use reflection
Update to last SVN, you have now a setAlignment and getAlignment method on the BitmapText class.
1 Like
Thank you)