Page 1 of 1
iPhone retina display not scaling correctly in test
Posted: Thu Jun 28, 2012 4:44 am
by tankiller
So I set the main stack, the blank to the correct HxW of the iPhone renta display, I imported an image the exact same size (640px X 960px) however when tested it only shows 1/4th the image as if the iPhone tester is still set for non renta displays only. What am I doing wrong, how do I give a base command to let it scale everything I import to the renta size after I import into LiveCode?
Re: iPhone retina display not scaling correctly in test
Posted: Thu Jun 28, 2012 5:39 pm
by Klaus
Hi tankiller,
1. welcome to the forum
2. check "iphoneUseDeviceResolution" and "iphoneDeviceScale()" in the "iOS Rlease Notes" -> LiveCode: Menu: Help
Maybe they are not set correctly.
3. I will move this thread to the iOS forum now
Best
Klaus
Re: iPhone retina display not scaling correctly in test
Posted: Fri Jun 29, 2012 4:04 am
by tankiller
I read up on those and it made very little sense to me but I added both those commands in the code editor and it fixed nothing. I'm used to coding websites but I'm finding this very hard.
Re: iPhone retina display not scaling correctly in test
Posted: Fri Jun 29, 2012 11:42 am
by Klaus
Hi tankiller,
ah, ok, I was just guessing, sice I do not develop for iOS (yet).
Best
Klaus
Re: iPhone retina display not scaling correctly in test
Posted: Fri Jun 29, 2012 3:37 pm
by sturgis
You might put together a simple stack with a field to log information, and check the settings in your simulator device (I'm assuming this is in the simulator)
Put a button and a field.
In the script of the button put something like:
Code: Select all
on mouseUp
put empty into field 1
put "Device res (in pixels): " & iphonedeviceresolution() & return after field 1
put "The screenrect:" && the screenrect & return after field 1
put "Scale (2 = retina, 1 = standard):" && iphoneDeviceScale() & return after field 1
put "Any other stuff you want to check:" & return after field 1
end mouseUp
Make sure the values are what you expect for a retina display.
LIke Klaus, I can't actually check any of this stuff since I don't work with ios, but I did some reading.. When the simluator window is open does it show "retina" as part of the title bar? ( as in the lower image on this page
http://stackoverflow.com/questions/5710 ... -simulator )
Make sure you have the line klaus recommended:
iphoneUseDeviceResolution true,true -- I think if you want to deal entirely in pixels this is the setting to use.
Good luck.
Re: iPhone retina display not scaling correctly in test
Posted: Sat Jun 30, 2012 11:51 am
by endernafi
Hi tankiller,
I've faced the exact same issue a little while ago.
Copy & Paste this code:
Code: Select all
on preOpenStack
if the environment is "mobile" then
iphoneUseDeviceResolution "true", "true"
set the acceleratedRendering of this stack to "true"
end if
end preOpenStack
And if you want your app more flexible;
I mean supporting all iOS devices in different manners,
a wider view for iPad and maybe a more narrow and cozy view for iPhone,
then try to use different substacks for each device.
That was my solution...
Regards,
~ Ender Nafi
Re: iPhone retina display not scaling correctly in test
Posted: Sat Jun 30, 2012 11:53 am
by endernafi
Oops, I forgot to mention that you have to choose "Retina Display" from the "Device" menu of your iPhone Simulator app.
Or you may try your app on an actual device with retina display, of course.
Regards,
~ Ender Nafi
Re: iPhone retina display not scaling correctly in test
Posted: Tue Jul 03, 2012 10:58 pm
by tankiller
Code: Select all
on preOpenStack
if the environment is "mobile" then
iphoneUseDeviceResolution "true", "true"
set the acceleratedRendering of this stack to "true"
end if
end preOpenStack
I've entered this and edited the display menu and it still is not scaling. What do? I can't start to build any graphical elements till this is fixed

Re: iPhone retina display not scaling correctly in test
Posted: Tue Jul 03, 2012 11:06 pm
by endernafi
Could you send a sample stack?
I mean
sample 
, not your actual app;
it would be too complicated.
Please strip out irrelevant parts and your proprietary codes.
I -or maybe someone more experienced- can look over your stack for any unnoticed mistakes.
Regards,
~ Ender Nafi
Re: iPhone retina display not scaling correctly in test
Posted: Wed Jul 04, 2012 2:26 am
by tankiller
The website is not letting me post any links to my dropbox folder. How can I send these do you?
Re: iPhone retina display not scaling correctly in test
Posted: Wed Jul 04, 2012 8:11 am
by endernafi
Hi tankiller,
Click on my username, then my profile page will open.
There you can see my e-mail.
It's not jabber, don't confuse

, it's ol' good gmail address

You can send your files to that address.
I hope I can help.
Regards,
~ Ender Nafi