multiple line buttons
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
multiple line buttons
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
Ellery
Re: multiple line buttons
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
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
Ellery
-
- VIP Livecode Opensource Backer
- Posts: 92
- Joined: Wed May 29, 2013 1:54 am
- Location: Sydney, Australia
Re: multiple line buttons
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:
Note that I am using "return" instead of "cr".
Alternatively, you can put this code in the script of the button itself:
Both should work.
Code: Select all
set the label of button "myButton" to "line 1" & return & "line 2"
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
Re: multiple line buttons
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
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
Hey thats cool klaus! Didn't know you could do that. Thanks!
Re: multiple line buttons
ok awesome thank you everyone!