2
\$\begingroup\$

is possible to get the 'Height' of a font drawed with the drawWrapped methods (with a wrapWidth) ?

getMultiLineBounds only works when \n is used, but when drawing with drawWrapped it doesn't give the right Height.

Text

String text = "hello this is very lonnnnng text without new line";
float wrapWidth = 100;

Display code :

 font.drawWrapped(batch, text, x, y, wrapWidth, alignment);

My 'get the displayed height code' :

 font.getMultiLineBounds(text).height;

Output :

 hello this is very
 lonnnnng text without
 new line

Problem :

How to have the total height of the displayed text by the methods : DrawWrapped

Can you help me please ? thanks you

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

try getWrappedBounds instead of getMultiLineBounds

\$\endgroup\$
1
  • 1
    \$\begingroup\$ My BitmapFont class does not contain this method - any ideas? \$\endgroup\$
    – magritte
    Nov 6, 2016 at 17:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .