Hi, I'm developing a game which requires a one of piece of precalculation. This means I will need to execute a function once (per level) which contains a good deal of processing that will block the cpu for a few seconds. I would rather have a loading bar here than block the phone.
Is there anyway of setting a function to run in the background, so frame updates still take place? I don't think Lua coroutines can help here, as there still won't be frame updates if my function blocks for a while.
The only other method would be to divide the precalculation into small blocks, and call them over a period of time. This is obviously less elegant code-wise and I was just wondering if there is any other solution?
Thanks!