Skip to main content
Inspiring
February 5, 2013
Question

copyPixels lag issue

  • February 5, 2013
  • 2 replies
  • 520 views

I'm currently working on a mobile app wich is supposed to be a store of interactive books for kids. These books, being interactive, cannot be loaded SWFs as the app will have to work in both iOS and android, and as you may know that simply doesn't work in iOS (apple always HAS to be different -.-). Having that in mind I moved to create a my own AssetLoader system that will get urls from an xml file, load everything and finally display it. Sounds easy right? Well, it is. The major problem here is the animations: they are 2 files (a png spritesheet and a json) wich are parsed using this library, but the tiles can be small, medium, big, wathever, and when they're big the blitting operation (copyPixels) takes too long. While the sounds have already been loaded and are playing, no images are displayed untill copyPixels has finished it's job.

(tl;dr starts here)

So, is there anyway of preloading copyPixels? I could perfectly add an ADDED_TO_STAGE event on the sprite that contains the animtion, pause all sounds, and just play them when it fires. It works, but what will actually happen is the user looking at a preloader at 100% while the event isn't fired yet, I'm sure the majority of them will just think the app crashed, kill it, and try again. It's not "honest" programming, it's hard-coded, deffinetly not what I need. I'm also open to different suggestions.

This topic has been closed for replies.

2 replies

Nabren
Inspiring
February 6, 2013

I would highly recommend looking at Starling: http://gamua.com/starling/

It's free, supported/recommended by Adobe, takes advantage of Stage3D and will definitely get you the performance you are looking for especially on mobile.

The best part is you are already working with sprite sheets so converting over to textures is not going to be a problem at all. If you know any basics of 3D you will find this a breeze and even if you don't Starling makes it easy.

A_Sad_SamAuthor
Inspiring
February 6, 2013

Well, I eventually solved my problem, but thanks for the suggestion Nabren.