Page 1 of 1
multiple line buttons
Posted: Thu May 30, 2013 12:45 am
by Ellery
Is there a way to make the name of a button break and go on multiple lines so you can fit bigger font on a smaller screen?
Ellery
Re: multiple line buttons
Posted: Thu May 30, 2013 12:49 am
by sturgis
If you "set the label of button "buttonname" to ("My first line" & cr & "my second line") it will work. Or you can turn off the display of the label in properties and overlay a label field, or you can create an image that has the text you want to show, in the size you want to show it, and set the icon of the button to that image.
Re: multiple line buttons
Posted: Thu May 30, 2013 4:16 am
by Ellery
I tried the first way and it isnt working? It shows "My first line" & cr & "my second line" but they dont break at the " & cr &" is there some setting I need to check? The label idea works nicely. The problem with using an image is it looks very rough when scaling from an I-phone screen (320x 480) to a i-pad retina or google tablet( I think there new 10" tablet is 2600x1800). Im trying to make my app so it works on all devices. Thank you for your help though if I cant get the first way to work I will probably just use a label!
Ellery
Re: multiple line buttons
Posted: Thu May 30, 2013 6:47 am
by icouto
I think the problem there may that you may be trying to type the code into the Inspector. Try typing it into the
message box, like this:
Code: Select all
set the label of button "myButton" to "line 1" & return & "line 2"
Note that I am using
"return" instead of "cr".
Alternatively, you can put this code in the script of the button itself:
Code: Select all
on mouseUp
set the label of me to "line 1" & return & "line 2"
end mouseUp
Both should work.

Re: multiple line buttons
Posted: Thu May 30, 2013 12:20 pm
by Klaus
Hi Ellery,
you CAN indeed enter multiline LABELS for buttons in the inspector!
Looks like Livecode uses FORMAT to check and apply the entered text
as a buttons label, so you can use the NEW LINE characters BACKSLASH + n
instead of a "real" RETURN (CR) in the inspector.
Copy this line to the LABEL field in the inspector and see yourself:
line 1\nline 2
Or this one:
line 1\nline 2\line 3\nline 4\netc...
Best
Klaus
Re: multiple line buttons
Posted: Thu May 30, 2013 1:07 pm
by sturgis
Hey thats cool klaus! Didn't know you could do that. Thanks!
Re: multiple line buttons
Posted: Thu May 30, 2013 5:46 pm
by Ellery
ok awesome thank you everyone!