Page 1 of 1

Formspec: Allow labels to be multi-line

PostPosted: Sun Mar 10, 2013 14:51
by Traxie21
Although we have multi line input, we do not have multi-line display in formspecs. Suppose someone wanted to make a books mod? Ts easy to write the book, but if one wanted to display the lines of a book, it would have to use a complicated system of string splitting and label generating.

I propose something like this:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
label[X,Y;MaxLineWidth,MaxLines;Text]

or

multilabel[X,Y;MaxLineWidth,MaxLines;Text]



Would be very helpful if this was implemented.

PostPosted: Sun Mar 10, 2013 20:41
by ashenk69
You actually can do multiline texts with labels. Within the text parameter you can insert line breaks with "\n". When I had worked with this before I think I remember that you can only fit about 3 lines because labels have a fixed height. You can do this with most of the strings in minetest but it might not display correctly.

PostPosted: Sun Mar 10, 2013 20:58
by Traxie21
Yeah, Actually, only two lines are supported, and the width of the label is only about 25 characters. The issue is when you want user input to be displayed in formspecs.

PostPosted: Sun Mar 10, 2013 21:23
by 0gb.us
Traxie21 wrote:Yeah, Actually, only two lines are supported, and the width of the label is only about 25 characters. The issue is when you want user input to be displayed in formspecs.


Last I checked, it wasn't even a full two lines. The second line gets cut off, so you only see the top of the text.

PostPosted: Sun Mar 10, 2013 21:32
by Traxie21
Depends on the font/screen resolution.

PostPosted: Mon Mar 11, 2013 01:49
by prestidigitator
Yes, this sounds like an excellent little enhancement. I'm all for it.