Flash Mobile Drawing: Using Graphics in Small Doses

This is an update from the original article Flash Mobile Drawing Performance: The Best Way?

Working with Jake from byHook and testing the graphics.drawRect() approach, we have come to an interesting intitial conclusion.

Using the graphics rendering solution by far outperforms the alternatives when a relatively small number of items have to be drawn.  When testing 10-15 graphics (64×64) in CPU mode, the average fps was nearly double that of using ‘copyPixels’. On the original Motorola Droid, 15 graphics resulted in a consistent fps of 41-43 — pretty good considering the device.

The problem is that this solution fails to gracefully scale.  The other solutions suggested by byHook start to outperform the graphics.drawRect approach once you start getting higher in the number of graphics drawn on screen.  Also, this solution appears to have performance issues when in GPU mode (more research necessary).

In the end, there is no single best solution for every use case. It all comes down to knowing your game and implementing the solution that works best given your requirements.

*I have since the source code from tests.

Stay update to date on the latest in interactive technology news, releases, trends and, of course, our latest tutorials and experiments by following us on Twitter.

Share:
  • Twitter
  • Digg
  • Yahoo! Buzz
  • Reddit
  • StumbleUpon
  • del.icio.us
  • Mixx
  • FriendFeed
  • Technorati
  • Facebook
  • RSS

One Comment

  1. [...] suggested this approach definitely performs well but in very specific scenarios — read our Using Graphics in Small Doses article for [...]

Leave a Comment

Please leave these two fields as-is: