Page 1 of 1

Resizing group to match size of device screen

Posted: Sun Jan 06, 2013 2:54 pm
by rleiman
Hi Everyone,

Since there are several possible apple ios screen sizes, I would like to find out how to determine what the height and width of the device screen size is.

This will help me to resize images, groups, etc. based on what the device is since I don't know what the user installs the app onto.

I have used this which is good for the card but I would also like to adjust the card size based on the device screen size.

Code: Select all

on preOpenStack
   set the width of group "big ben group" to the width of this cd
   set the height of group "big ben group" to the height of this cd
end preOpenStack
Thanks.

Re: Resizing group to match size of device screen

Posted: Sun Jan 06, 2013 3:09 pm
by Klaus
Hi rleiman,

check "the screenrect" in the dictionary, this will tell you width and heigth of the current screen.


Best

Klaus

Re: Resizing group to match size of device screen

Posted: Sun Jan 06, 2013 3:17 pm
by rleiman
Thanks Klaus. :D

Re: Resizing group to match size of device screen

Posted: Sun Jan 06, 2013 4:14 pm
by rleiman
screenrect worked perfectly for me.

Code: Select all

put screenrect() into theScreenSize
   
set the width of group "big ben group" to word 1 of item 3 of the field "theScreenSize" 
set the height of group "big ben group" to word 1 of item 4 of the field "theScreenSize" 
Is there a way to scale the image inside the group to match this size? I don't care if the aspect ratio is off. I wish to fill the entire group with the image.

Re: Resizing group to match size of device screen

Posted: Sun Jan 06, 2013 4:20 pm
by rleiman
I just realized that coding lock up the app!

The group resized nicely but I don't know what adding those lines of code lock up the app because commenting them out allows the app to run.

Re: Resizing group to match size of device screen

Posted: Mon Jan 07, 2013 3:37 am
by dunbarx
Hi.

Lose the word "the" before "field". This is syntactically incorrect.

Craig Newman

Re: Resizing group to match size of device screen

Posted: Mon Jan 07, 2013 11:46 am
by rleiman
Thanks Craig,

I also found by transferring the code from preOpenStack to preOpenCard there is no lockup. :D