Page 1 of 1

Resizing group to stack size

Posted: Tue Jan 01, 2013 2:26 pm
by rleiman
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

Re: Resizing group to stack size

Posted: Tue Jan 01, 2013 5:33 pm
by Klaus
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

Re: Resizing group to stack size

Posted: Tue Jan 01, 2013 10:03 pm
by rleiman
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.

Re: Resizing group to stack size

Posted: Wed Jan 02, 2013 1:37 am
by Simon
Hi rleiman,
Look up screenRect in the dictionary.

Simon