Center label on a graphic button

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kolia
Posts: 82
Joined: Thu May 28, 2015 3:53 pm

Center label on a graphic button

Post by kolia » Thu May 28, 2015 4:01 pm

Hello,

I have numerous graphics button with 3 pics. I'm wondering whether there is a mean to set a label centered in both direction over the image. Is there a way to set a color to this label? This would avoid the creation of many images, 3 for each button which is quite cumbersome.
Thank you.
Nicolas
LC 7.1 on Windows 8.1 and on MAC OS 10.10.5 Xcode 6.4 - 7.1

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Center label on a graphic button

Post by Klaus » Thu May 28, 2015 4:15 pm

Hi kolia,

1. welcome to the forum! :D

2. Yes, there is new "icongravity" property that you can use:
...
set the icongravity of btn "you button here" to "center"
...
will do what you need, check the dictionary for more info!
For color, set the TEXT color of your button in the inspector!


Best

Klaus

kolia
Posts: 82
Joined: Thu May 28, 2015 3:53 pm

Re: Center label on a graphic button

Post by kolia » Fri May 29, 2015 12:43 pm

Hi Klaus
This is just excellent news. This will save a lot of long hours designing nice butons. Thanks a lot. As far as I understand this property has to be set by code, am I right?

Just fyi, I've been developping stacks using Hypercard in the ... 90's. It was a fantastic environment. Since then, I've been mainly using several flavors of Visual Studio. I'm very enthousiastic to develop code with LC.
Nicolas
LC 7.1 on Windows 8.1 and on MAC OS 10.10.5 Xcode 6.4 - 7.1

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Center label on a graphic button

Post by Klaus » Fri May 29, 2015 12:52 pm

Hi kolia,
kolia wrote:As far as I understand this property has to be set by code, am I right?
that is correct, there is no setting in the "Inspector" for this.
kolia wrote:Just fyi, I've been developping stacks using Hypercard in the ... 90's. It was a fantastic environment. Since then, I've been mainly using several flavors of Visual Studio. I'm very enthousiastic to develop code with LC.
You will love it, and maybe hate it from time to time :D


Best

Klaus

kolia
Posts: 82
Joined: Thu May 28, 2015 3:53 pm

Re: Center label on a graphic button

Post by kolia » Fri May 29, 2015 1:03 pm

8)
Cheers
Nicolas
Nicolas
LC 7.1 on Windows 8.1 and on MAC OS 10.10.5 Xcode 6.4 - 7.1

Post Reply