Libgdx Find out where the lines ends

56 Views Asked by At

So I have a label - 200 width with wrap set to true. Before a set text to my label I want to check where first line ends, then when the second line end etc. Is it possible to check this? I'm working on text justify algorithm for label and I need to know where lines end.

1

There are 1 best solutions below

1
Deniz Yılmaz On BEST ANSWER

GlypLayout may be useful.

glyplayout.width gives you exact length when you draw on screen so you can find out that how many chars can be drawn until you exceed 200 pixel width.