Very good questions Caleb, let me try to address each one. I’m sure we have all of this in a guide somewhere, but it won’t hurt to restate it.
1. I’ve made my game for the iPad, but I was wondering if Corona’s dynamic content scaling will work for me? I mean I have 1024x768 as the width x height, will that work on an iPhone, for example?
A lot depends on what you have in your config.lua file. Assuming you’ve set it to be 1024 x 768 and you are using letterbox scaling what will happen is that on the iPhone 4 and 4s, Corona will scale your graphics down to fit into a 640x854 box, centered in the screen. There will be 106 total pixels end up in black letterbox bars (53 each side)… assuming your backgrounds are 1024x768. You can make your backgrounds bigger, (1152x768 to be precise) and the background will fill the screen, but your 0,0 location will not be the top left corner, and your display.contentWidth, display.contentHeight will not be your bottom right either. I"m going to assume landscape out of general principle. 0,0 will be 53 pixels away from the left edge, and the other corner will have 53 pixels on the other side of far bottom, left point.
This isn’t the end of the world, because if you position something at 1120, 760 it will be on screen just beyond the 1024 point. Corona with regards to display.contentWidth thinks its off screen. Likewise on the other side to position something near the edge you would have to give it a negative X value.
The iPhone 5 adds even more space to the left of 0,0 and to the right of display.contentWidth, display.contentHeight. Your background would need to be 1363x768 to fill the iPhone 5 screen.
For the iPhone 3Gs (the oldest supported model), Corona will scale the images down accordingly, however be aware that if you expand your background to cover the letterboxed areas, that background is going to be a 2048x2048 texture and will take up 16MB of memory and the 3Gs only has 256MB and you don’t get all of that. Also the 3Gs’s processor is going to be busy downsizing all those graphics, so your performance on that device may be limited.
2. Very broad question: How do I get from folder with Lua files, sound, and art --> App on device?
The first step is to have Corona build your app. File->Build->iOS or CMD-B will bring up the build dialog. Prior to this you have many steps you have to do on the Apple Developer Provisioning Portal. You need a Key/Certificate pair for development and a pair for distribution. You need to add your test devices using the UDID for each device. Then you need to create an AppID which will give you a bundle identifier like “com.yourname.yourapp” that has to be unique. There’s a random 10 digit/letter code that is also added, but you generally don’t need to worry too much about that.
Next you create a Provisioning Profile that marries the certificate, devices, and appID into a block of code that Apple’s XCode uses to sign your application. To keep things simple, its best to use the Distirubtion AdHoc profile to build and test with. This is way too much to go into here. I recommend reading:
http://developer.coronalabs.com/forum/2012/01/10/ios-walkthrough-creating-your-certificates
and
http://developer.coronalabs.com/content/building-devices-iphoneipad
Once you have your provisioning profile, downloaded and installed in the right place, restart Corona SDK if its running or cold start it. Now you will use the Build command to build your app, selecting the provisioning profile you just created. This will produce two files in the location you said to output the build to. One will simply be your app build, the other will be a zipp’ed version. The app build is really a folder with a hidden extension of .app. The zip version bundles it up to a single file. When Corona finishes, it gives you the option to upload to the app store. You DO NOT want to do this yet. When you have your final build and you’re using the Distribution profile, you will then use this to upload to iTunes. But for testing, skip it.
Now at this point, you don’t need the zip file, it’s what gets uploaded to iTunes. At this point you have several options to get the file onto your device.
-
Use Xcode’s Organizer. This is the simplest. Plug your phone in, launch XCode, if you have not done so, click the “Use this device for development” button. Your device will show up in the left side bar and this button is on one of the screens. Click on Applications and there is an Add button at the bottom. If everything is good, you can install the app bundle directly.
-
Use iTunes to install it. This requires you making a special kind of file called an IPA file. Search Google to learn out. Its really easy, but this post is getting rather long and I still have more questions to answer. You drag the IPA file into the Apps area in itunes, then sync your device. I find this slower, but its the best way to give it to testers to try (You have to have their devices installed in your provisioning portal and have rebuild the provisioning profile before they can run the app)
-
Use TestFlightApp.com. This is good if your going to have a test team, but you upload your IPA file to them and they email you with a link to install it over the air.
Once its on device, play away. And as another plug for using Xcode’s Organizer for testing, is you can monitor the device’s console.log looking for errors. Truely the best way to test your app.
3. When I test the app out on the device, are there any restrictions regarding Apple?
That is another pretty broad question. Generally, I would say no. But if you’re using Game Center, In App Purchases and such, there are special test procedures that you have to go through to test them in the sandbox and not in the live environment.
4. What about Xcode simulator? What’s that about? I have the Xcode app, but what about the simulator that everyone keeps talking about?
Just like Corona gives us a simulator to test on, if you were to write an app directly in Objective C with XCode, Apple provides a simulator to test on. Corona can use that simulator to test your app bulds on by picking Simulator on the build screen. I don’t find it very useful, but others do since Corona will launch the Xcode simulator for you. The Simulator outputs its debugging information to the Mac’s “console” app which I find hidden and harder to work with, but that’s just me. But it can be faster than installing on the app if you’re testing things like Facebook or ads that don’t run in the simulator.
Hope this answers your questions.
[import]uid: 199310 topic_id: 34459 reply_id: 137011[/import]