Resizing group to stack size

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
rleiman
Posts: 56
Joined: Fri Dec 14, 2012 11:28 am
Contact:

Resizing group to stack size

Post by rleiman » Tue Jan 01, 2013 2:26 pm

Hi Everyone,

Can you show me the needed coding I need to use to dynamically change the size of a group to match the same size as the stack?

Thanks.

Truly,
Emad

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

Re: Resizing group to stack size

Post by Klaus » Tue Jan 01, 2013 5:33 pm

Hi Emad,

you could add a "resizestack" handler to the card or stack script like this:

Code: Select all

on resizestack
  set the rect of grp "your group here..." to the rect of this card
  ## I leave the correct object resizing and layout of the objects in the group up to you, 
  ## if that is what you are looking for ;-)

  ## more resize stuff here, if neccessary...
end resizestack
Best

Klaus

rleiman
Posts: 56
Joined: Fri Dec 14, 2012 11:28 am
Contact:

Re: Resizing group to stack size

Post by rleiman » Tue Jan 01, 2013 10:03 pm

Hi Klaus,

I'm actually looking to make sure the image on the group will always scale to the stack for all the possible screen sizes such as iPhone, iPad, etc.

Can you show me some coding that would do that?

Thanks.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Resizing group to stack size

Post by Simon » Wed Jan 02, 2013 1:37 am

Hi rleiman,
Look up screenRect in the dictionary.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply