Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help,
read this.
-
bert
- Prole
- Posts: 1
- Joined: Wed Oct 31, 2012 12:09 am
Post
by bert »
Hi all
![Smile :)](./images/smilies/ms-smile.png)
i look for a way to get the height of a multiline text. Is it possible with something like xxx:getWidth(). Anyone has an idea ?
![Smile :)](./images/smilies/ms-smile.png)
-
Xgoff
- Party member
- Posts: 211
- Joined: Fri Nov 19, 2010 4:20 am
Post
by Xgoff »
bert wrote:Hi all
![Smile :)](./images/smilies/ms-smile.png)
i look for a way to get the height of a multiline text. Is it possible with something like xxx:getWidth(). Anyone has an idea ?
![Smile :)](./images/smilies/ms-smile.png)
weird but i would guess
Code: Select all
your_font:getHeight() * select(2, your_font:getWrap("text you're printing", your_printf_width))
-
T-Bone
- Inner party member
- Posts: 1492
- Joined: Thu Jun 09, 2011 9:03 am
Post
by T-Bone »
I typically store mutliline text as a table with strings, one for each line. That makes it simpler, just
font:getHeight() * #texts
Users browsing this forum: No registered users and 3 guests