I have submitted this as a bug feature request as suggested. Case #7524
Hi everyone, we desperately need a way to flatten a display group into a single image *on all devices. Our levels when fully constructed can have quite a few images inside one screen, and this kills the frame rate. Many of our level items are actually static within the level area, so flattening certain images is an option for us.
Flattening the image vastly improves frame rate. In one of our levels there are 160 display objects (images,shadows,masks) in one level, and when flattened, reduces to… *drum-roll*… 1! This has a massive effect on performance.
We’re currently making use of display.save() with iOS which works impressively well, but as stated in the docs this is very limited on Android devices. Plus it takes a little extra time on the device to write to disk and load back from the disk. We don’t plan to release to Android until after iOS, so we thought a request now, just might mean a the feature will appear by the time we need it.
Basically, we would like to be able to do this:
[code]local flattenedLevelBackground = staticObjectsDisplayGroup:flatten()
staticObjectsDisplayGroup:removeSelf()[/code]
The display group would be flattened, and the new image returned as a new display object (instead of writing to disk).
We think this would benefit anyone where their levels involve a significant amount of display objects which are static.
Thank you kindly for your consideration [import]uid: 35618 topic_id: 13884 reply_id: 313884[/import]