Brian Lin
Brian Lin

Reputation: 331

How to optimized a big size jpeg on AIR IOS? (AS3)

I am developing a ipad game using AS3. Because of the detail of the game, I have to switch between around 5 backgrounds with the size of 4800x1800. Normally, I use the the switch function the turn off the visible of all background movieclips then turn on the one I need, but everytime, I function will work ok for the first time but crack on the second. I have traced and found it is really of the switch visible of the backgrounds. After that, I try to use bitmapdata and redraw every screen starts. But it even worse, crack for the first time I test. Seem it is not ok for the processor to handle such big bitmapdata. Anyone have a good way to due with something like this?

P/s: My game run perfectly on PC, not a single error, it is just crack on the iPad and I have debugged that it stop while running the switch bg function.

Upvotes: 0

Views: 497

Answers (1)

Jonathan Dunlap
Jonathan Dunlap

Reputation: 2631

Are you subdividing the bitmapdata into smaller tiles for culling? If not, this is definitely the way to go. You want your engine to work like a puzzle, with only the pieces of the viewable puzzle put together. Ideally for a platform like iOS, you will want the sizes to be around 250x250 for optimal memory management (based on some of the tests I've done). IMHO, 4800x1800 is far too large of a dataset to handle as a single entity.

Basics of bitmap tiling: http://as3adventure.blogspot.com/2011/06/bitmapfill-and-tiles-and-scrolling-it.html

Hope this helps!

Upvotes: 3

Related Questions