Formspec: Allow labels to be multi-line

User avatar
Traxie21
Member
 
Posts: 753
Joined: Mon Dec 31, 2012 10:48

Formspec: Allow labels to be multi-line

by Traxie21 » Sun Mar 10, 2013 14:51

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.
 

ashenk69
Member
 
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Sun Mar 10, 2013 20:41

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.
 

User avatar
Traxie21
Member
 
Posts: 753
Joined: Mon Dec 31, 2012 10:48

by Traxie21 » Sun Mar 10, 2013 20:58

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.
 

User avatar
0gb.us
Member
 
Posts: 841
Joined: Sun Sep 16, 2012 01:55

by 0gb.us » Sun Mar 10, 2013 21:23

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.
 

User avatar
Traxie21
Member
 
Posts: 753
Joined: Mon Dec 31, 2012 10:48

by Traxie21 » Sun Mar 10, 2013 21:32

Depends on the font/screen resolution.
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Mon Mar 11, 2013 01:49

Yes, this sounds like an excellent little enhancement. I'm all for it.
 


Return to Minetest Features

Who is online

Users browsing this forum: Bing [Bot] and 5 guests

cron