Get line count for wrapped text (newRetinaText)

Just a plain simple question for the brilliant minds out there:

Is there any possible way to know how many lines a text created and wrapped with display.newRetinaText() will produce?

It will be very useful when inserting it into a scrollView to know exactly the height it has to have to get a nice scrolling behavior.

Thanks! [import]uid: 13811 topic_id: 23108 reply_id: 323108[/import]

can be found using the .height param i.e

[lua]local t = display.newRetinaText(“lots of text…”,100,100,100,100,nil,15);

print(t.height);[/lua] [import]uid: 24641 topic_id: 23108 reply_id: 92440[/import]

Thanks! I’ve also noticed the text gets the perfect height when defining height to 0 and width to the value you need it to wrap, so I used that without the need to know the exact number of lines. It’s documented but I didn’t notice it at first.

Anyway, thanks! I appreciate it :slight_smile: [import]uid: 13811 topic_id: 23108 reply_id: 92445[/import]