Return to Starling Playback Library

Restoring from Lost Context

Questions related to Starling playback library should be asked here.

Restoring from Lost Context

Postby Sean Duffy » March 10th, 2015, 7:54 am

I'm trying to build an AIR app for mobile that works in both portrait and landscape orientations.

When rotating the device (especially on android) the context is lost.
Starling can handle this by enabling _starling.handleLostContext=true; and either loading assets using the AssetManager or manually restoring the texture from original BitmapData using the texture.root.onRestore method.
How do I restore the assets loaded via the gaf starling playback library? Is there a reference to the original TextureAtlas bitmaps? Or is there something already in the API which handles this? At the moment the app's throwing a Error #2015: Invalid BitmapData when trying to restore the GAFMovieClip (well its textures anyway)

Anyone know how to restore from a lost context?

User avatar
Sean Duffy
Posts: 2
Joined: March 10th, 2015, 2:49 am

Re: Restoring from Lost Context

Postby Назар Левицкий » March 11th, 2015, 1:38 am

Hi, Sean Duffy.
Did you set ZipToGAFAssetConverter.keepImagesInRAM to true?
For now if you want the Starling to restore the textures you need to set this property to true as well as Starling.handleLostContext property.
Оtherwise all instances of BitmapData will be disposed by ZipToGAFAssetConverter after the textures are created.
User avatar
Назар Левицкий
Posts: 12
Joined: June 6th, 2014, 12:01 am

Return to Starling Playback Library

Who is online

Users browsing this forum: No registered users and 2 guests