Scaling assets for mobile devices in AIR



One of the issues when creating a game for mobile devices is assets for multiple sizes and resolutions. Multiple solutions comes to mind:

  • The first solution is to use vector assets built in Flash for instance, exported as an SWC or SWF file. The main issue is that vector graphics use a lot a processing charge and are not at all suitable for mobile devices.
  • Another approach is to create multiple spritesheets for every resolution. But there is a lot of different resolutions for mobile devices, and getting the nearest matching resolution is a problem because resizing the textures on the fly results in a bad graphics quality. The other issue is that the file size will go up quickly.
  • The last solution uses a SWC file with the vector graphics. The assets will be instanced and resized at runtime, and will be rasterized as bitmap datas. This way, the quality will be perfect, and the file size will be very contained. There are still some drawbacks: there is a loading time for each level, since the rasterizing will be done on runtime, and memory management is trickier.

Still, this is the last solution that I use for resizing assets for my games, essentially in NightMaze.