iPhone retina display not scaling correctly in test

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
tankiller
Posts: 4
Joined: Thu Jun 28, 2012 4:34 am

iPhone retina display not scaling correctly in test

Post by tankiller » Thu Jun 28, 2012 4:44 am

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?

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

Re: iPhone retina display not scaling correctly in test

Post by Klaus » Thu Jun 28, 2012 5:39 pm

Hi tankiller,

1. welcome to the forum :D

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 8)


Best

Klaus

tankiller
Posts: 4
Joined: Thu Jun 28, 2012 4:34 am

Re: iPhone retina display not scaling correctly in test

Post by tankiller » Fri Jun 29, 2012 4:04 am

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.

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

Re: iPhone retina display not scaling correctly in test

Post by Klaus » Fri Jun 29, 2012 11:42 am

Hi tankiller,

ah, ok, I was just guessing, sice I do not develop for iOS (yet).


Best

Klaus

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: iPhone retina display not scaling correctly in test

Post by sturgis » Fri Jun 29, 2012 3:37 pm

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.

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Contact:

Re: iPhone retina display not scaling correctly in test

Post by endernafi » Sat Jun 30, 2012 11:51 am

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
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Contact:

Re: iPhone retina display not scaling correctly in test

Post by endernafi » Sat Jun 30, 2012 11:53 am

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
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

tankiller
Posts: 4
Joined: Thu Jun 28, 2012 4:34 am

Re: iPhone retina display not scaling correctly in test

Post by tankiller » Tue Jul 03, 2012 10:58 pm

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 :(

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Contact:

Re: iPhone retina display not scaling correctly in test

Post by endernafi » Tue Jul 03, 2012 11:06 pm

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
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

tankiller
Posts: 4
Joined: Thu Jun 28, 2012 4:34 am

Re: iPhone retina display not scaling correctly in test

Post by tankiller » Wed Jul 04, 2012 2:26 am

The website is not letting me post any links to my dropbox folder. How can I send these do you?

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Contact:

Re: iPhone retina display not scaling correctly in test

Post by endernafi » Wed Jul 04, 2012 8:11 am

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
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

Post Reply