Plasmacore:iOS Projects

From Plasmaworks

Jump to: navigation, search

Contents

Notes

  • While you can develop your game on Windows, you must be using a Mac to actually compile your app for iPhone.
  • The instructions below will work for iPad as well as iPhone.
    • Set the "Targeted Device Family" build property to support iPhone and/or iPad as desired. If you only support iPhone the app will still run on iPad but it won't take advantage of the extra resolution.
    • If you project targets both iPhone and iPad, use Display.size (Vector2) to determine which device you're on. One of the dimensions (Display.size.x or Display.size.y) will be 768 if you're on an iPad.
  • The high-res iPhone 4 display is now supported. The feature is disabled by default to avoid the "smeary" look of an interpolated app. To enable it, type "ios-vm" or "ios-xc" at least once and then edit "platforms/ios/main.mm" - you'll see the setting to change.


Setup

  1. Join the iPhone developer program and install the iPhone SDK.
  2. Set up Plasmacore for your computer.
  3. Type "./gogo install", then pick "plasmacore-ios-project" from the list. Type "./gogo" again to complete the install.


VM Builds

The Virtual Machine (VM) Plasmacore build is ideal for development. It compiles much faster but runs a little slower. In addition, any null-pointer exceptions will be caught instead of crashing the program.

  1. Type "./gogo ios-vm" to create a virtual machine build for iOS. This will also set up some defaults in the platforms/ios directory.
  2. Open platforms/ios/plasmacore_ios.xcodeproj in Xcode.
  3. You must manually add all music and sound effects to the Xcode project. Right click on "plasmacore_ios" list item at the top, pick Add->Existing Files..., and select the sound files. When the next window pops up, check both "plasmacore-vm" and "plasmacore-xc" to add the sounds to.
  4. Using the top-left drop-down button in Xcode, set your project to "Simulator | Release | plasmacore-vm", then click "Build & Debug" in the top-middle.


XC Builds

Use the Cross-Compiled (XC) build for creating the release version of your app. Compared to the VM build it compiles (much) more slowly, generates a larger executable, and runs faster. Assuming that you've run the VM build at least once to set up the project and added the sound effects as described above, you'll then do the following:

  1. Make sure you have installed a provisioning profile per the instructions on http://developer.apple.com/ios
  2. In the Build Properties menu (All Configurations), set the Code Signing Identity
  3. Edit "Info.plist" and choose an app name that's compatible with your developer identity (e.g. com.plasmaworks.silo).
  4. Type "./gogo ios-xc" to cross-compile your project into C++.
  5. Using the top-left drop-down button in Xcode, set your project to "Device | Release | plasmacore-xc", then click "Build & Debug" in the top-middle.


Tips

  1. If you get "{branch out of range}" errors on the XC build, edit the build properties and uncheck "Compile for Thumb".