Porting from Flash to iOS
This article describes the process of porting a Stencyl-made Flash game to iOS. Porting involves 3 steps.
Convert the game to a mobile game
Clean up behaviors that use Flash-specific functionality
Import double-resolution graphics
Before You Begin...
Back up your game, just in case something goes wrong.
If the game uses any Code Mode behaviors (as opposed to Design Mode behaviors with embedded code), you must remove those behaviors before porting your game over.
Step 1: Convert to a Mobile Game
First, check the File menu for the option “Convert to Mobile Game.”
You’ll be prompted to save the game. Click yes. After that, the game will automatically close and reopen.
If you’re on a Mac, try running the game in the simulator right away. If you’re lucky, it’ll run without a hitch. If not, read on...
Step 2: Clean Up Behaviors
Your game may be using functionality that’s only available in our Flash engine. If you try running your game as-is, and it crashes or is missing functionality, this might be the case.
The good news is that resolving this issue is fairly simple. First, locate any blocks that have the Flash icon on them.
Wrap logic that uses these blocks in a “do only in Flash” block (Flow > Advanced). That’s it!
If you continue running into issues, consult our Debugging guide for details.
Step 3: Import 2x Graphics
After confirming that your game runs, you’ll want to import all the graphics back in at double-resolution, or else they will appear pixelated on newer devices that contain a Retina (HD) Display.
Consult the Retina Display guide for details.
Note: If you plan to make an iOS game, you should plan this from the beginning before you create any game graphics. Short of using utilities such as scale2X to re-size your graphics, the only way to ensure your game will look good is to create higher resolution graphics from the get-go.
Tips & Gotchas
1) Convert mouse input to the equivalent touch blocks (show below). They work with both touch and the mouse!
2) Objects are smaller than you’d expect on an iPhone or iPod touch. The actual dots per inch (DPI) is significantly higher, which means anything displayed will appear smaller. You may need to increase their size when porting over to the iPhone.
3) Mobile devices are more sensitive when it comes to performance. Keep that in mind when designing your game.
4) Text Drawing can drag performance down. Use Labels instead.
5) You may get a message about the Atlas size being exceeded. Consult the Atlas guide for details.
Last Updated: 2012-04-03 by Jon
12578 have read this article
Disclaimer: The Stencyl Team does not actively monitor comments on articles. If you're seeking help for your game,
please ask a question on the forums. Thanks!
Sign In to Comment