Porting from Flash to iOS

来源:互联网 发布:美橙互联域名如何备案 编辑:程序博客网 时间:2024/06/06 01:47

This article describes the process of porting a Stencyl-made Flash game to iOS. Porting involves 3 steps.

  1. Convert the game to a mobile game
  2. Clean up behaviors that use Flash-specific functionality
  3. 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.

原创粉丝点击