LÖVE
https://love2d.org./forums/
How to get the size of rendered text?
https://love2d.org./forums/viewtopic.php?t=89308
Page
1
of
1
How to get the size of rendered text?
Posted:
Tue Aug 18, 2020 3:54 am
by
Ambient
rt.
Re: How to get the size of rendered text?
Posted:
Sat Aug 22, 2020 8:44 pm
by
steVeRoll
If you use love.graphics.print
You can use
Font:getHeight
to get the height of a single line, and
Font:getWidth
together with the text you're printing to get its width (wrapping isn't taken into account).
If you use
Text
objects
(recommended)
Use
Text:getWidth
and
Text:getHeight
.