Non-square/irregularly shaped buttons

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
yitzchok
Posts: 14
Joined: Tue May 10, 2011 9:12 am

Non-square/irregularly shaped buttons

Post by yitzchok » Tue Jun 28, 2011 6:41 am

Is it possible to have a non-square/irregularly shaped button, or a button using a non-square/irregularly shaped image (or an image with a transparent background), and only have the area with the image work and be visible?
Thanks!

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

Re: Non-square/irregularly shaped buttons

Post by Klaus » Tue Jun 28, 2011 11:54 am

Hi yitzchok,

yes, using (semi-) transparent PNG (or GIF) images will do what yo need.
They will only "react" when you click on the non-transparent parts.


Best

Klaus

yitzchok
Posts: 14
Joined: Tue May 10, 2011 9:12 am

Re: Non-square/irregularly shaped buttons

Post by yitzchok » Tue Jun 28, 2011 1:11 pm

I'll try that - thanks!
One more question-
Is it possible to change which image is being used for a button using code, while the program is running?
Thanks!

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

Re: Non-square/irregularly shaped buttons

Post by Klaus » Tue Jun 28, 2011 1:17 pm

Hi yitzchok,

yes, sure!
Just set the ICON of a button to the ID of the image you want to see in the button!
...
set the icon of btn "your button here" to 1004
...
You can also set the "hiliteIcon", "hoverIcon" etc. on the fly!


Best

Klaus

Post Reply