iPhone app running on iPad

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Tester2
Posts: 102
Joined: Wed May 18, 2011 7:02 pm

iPhone app running on iPad

Post by Tester2 » Thu Apr 18, 2013 7:01 pm

I have an app built for iPhone-only.

I would like to show it on the iPad, using the 2x/1x resize feature (like with normal iPhone apps that you can open on an iPad).

When I open my app on the iPad I get the small iPhone window centered in the middle and the 2x button in the bottom right - good.

However, it only displays the top left corner of my cards. :( Is there something in my stack script that I can tweak to make this view properly on the iPad?

Thanks.

Stack Script:

local sPlayerId

on preopenStack
if the environment is "mobile" then
iphoneUseDeviceResolution "true" -- For Retina True Display (doesn't work in openStack)
--Portrait , Portrait Upside Down , Landscape , Landscape Right are the 4 Parameters to be passed in the function iphoneSetAllowedOrientations
put "portrait,portrait upside down,landscape,landscape right" into theallowed
-- Function Call
set the acceleratedRendering of this stack to "true"
iphoneSetAllowedOrientations theallowed
mobileLockOrientation
else
exit preopenStack
put iphoneDeviceResolution() into tScreenResolution
go to card "Main Menu"
end if
end preOpenStack

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

Re: iPhone app running on iPad

Post by endernafi » Thu Apr 18, 2013 10:34 pm

Hi Tester2,

Your stack size is 640*960, probably
and when you run your app in iPad Retina it should display all of the card, again probably 8)
At least, my quick test was that way.

You have two options:
* Create 3 substacks:
One for iPhone 3 & iPad
One for iPhone 4 & iPad Retina
One for iPhone 5
On preOpenStack determine the device and direct to the right substack.
You can use this script to determine the device.

* Write a resize script so that your stack adapts itself to the screen real-estate.
Choosing this path has another advantage, you don't constrain yourself to iPhone and force your app to run in compatibility mode in iPads.
You can choose iPod, iPhone and iPad in Standalone Application Settings, freely.

Hope it helps...

Best,

~ Ender Nafi
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

Post Reply