Sizing

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
cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Sizing

Post by cusingerBUSCw5N » Wed Nov 07, 2012 2:02 am

I have been setting up my app using a tablet and an Android Galaxy S3.

The devices tell me that their stackheight and stackwidth are follows:

Tablet: 960 x 640
Galaxy S3 1230 x 720

The actual size of the device is quite different

Tablet is 6 x 3 3/4 inches (sorry - US is still not doing metric)
Galaxy is 4 x 2.5 inches

Now I'm setting it up for an iphone

The Iphone is 960 x 640 which appears to be the same size (in pixels) as my tablet, but it's actual size is
3 1/4 x 2 1/4 inches.

so...how is Livecode supposed to size something for my tablet and the iphone when it thinks the widths and heights are about the same - and have it look OK in both?

i.e. I have it looking great on a tablet but on the iphone it looks squished and a mess.

What am I doing wrong?

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

Re: Sizing

Post by Simon » Wed Nov 07, 2012 3:12 pm

Isn't this a case for mobilePixelDensity?
It wont solve your graphics problem but it will indicate when you are on a high density retina display.

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

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: Sizing

Post by cusingerBUSCw5N » Wed Nov 14, 2012 4:38 am

I find that Livecode can resize most text and boxes, etc., but images are pixelated and look lousy. So, my solution in dealing with the different mobile device sizes is as follows:

1) I set up my app at the beginning to only have one orientation, with this code:
if the environment is "mobile" then
mobileSetAllowedOrientations "portrait,portrait upside down"
end if

2) I set up three sets of parameters - mobile with stackheight >750 - has large pictures and larger text sizes and widths, mobile with stackheight <750 - has small pictures and small fonts and widths, and web - with larger pictures and widths. I put the common items in global variables so I only have to set them once for each of the scenarios. The others, I set in the pre-open card part of every card. This way, I can change the settings for one set of devices without affecting any others. (I set button heights, textsizes, button icons and field widths (although most times a field width can just be a % of the stackwidth). Livecode is able to do the resizing for the exact dimensions - but the resizing isn't significant enough to make the images look bad - and it doesn't resize because of orientation changes. Livecode could actually resize all the button heights and stuff - but I feel more in control if it stays with my three choices. What it can't do is resize images properly.)

3) I can "test" the different layouts on my computer, before testing on a mobile device (much quicker) - by doing a universal change from environment="mobile" where stackheight >750 to environment="development" - and when I'm done switch it back.

Anyway...I'm sure there are better ways, but wanted to share at least one solution.

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

Re: Sizing

Post by Simon » Wed Nov 14, 2012 2:16 pm

You might want to look at this:
http://runtime-revolution.278305.n4.nab ... l#a4652595
AltMobileResizer by Chipp, it's cool.

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

Post Reply