How to make animations stay smooth while loading data?

Hi all,

I have a loading screen with a loading animation while I load some text data from disk. The loading is pretty intensive and so it actually stops the loading animation completely in its tracks until it is done. Is there anyway to yield to corona so that the animation can continue smoothly while I do the loading?

Thanks!

Would it be possible to break up what is loaded into smaller chunks and then start to load each successive chunk when the previous chunk has been completed? I don’t know if that is the proscribed method for resolving this, but it’s work for on a few projects.

The problem I don’t know how to solve is yielding time back to Corona SDK to update the screen. If I broke my loading up in to chunks I think it would still freeze the screen. 

For example:

// Loading all at once function scene:onCreate() DoLoadingAnimation() LoadAll() end // Chunks function scene:onCreate() DoLoadingAnimation() LoadChunk1() LoadChunk2() LoadChunk3() end

We don’t know what your animation is - but perhaps look at it from both sides.

Can your animation be broken up into chunks? and then take turn about load data chunk, do small animation, then next data chunk…

It all depends on the animation and if there are natural breaks that you could put in.

it’s not perfect and simple - but sometimes when you have reduced control over certain factors (native code vs corona) - you have to get creative to smash that square peg into that round hole.

T.

Would it be possible to break up what is loaded into smaller chunks and then start to load each successive chunk when the previous chunk has been completed? I don’t know if that is the proscribed method for resolving this, but it’s work for on a few projects.

The problem I don’t know how to solve is yielding time back to Corona SDK to update the screen. If I broke my loading up in to chunks I think it would still freeze the screen. 

For example:

// Loading all at once function scene:onCreate() DoLoadingAnimation() LoadAll() end // Chunks function scene:onCreate() DoLoadingAnimation() LoadChunk1() LoadChunk2() LoadChunk3() end

We don’t know what your animation is - but perhaps look at it from both sides.

Can your animation be broken up into chunks? and then take turn about load data chunk, do small animation, then next data chunk…

It all depends on the animation and if there are natural breaks that you could put in.

it’s not perfect and simple - but sometimes when you have reduced control over certain factors (native code vs corona) - you have to get creative to smash that square peg into that round hole.

T.