You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A sample would be nice, too.
A loading bar sample would be great.
For a loading bar we should have two coroutines:
one for the the loading bar each step moving and yielding,
one for the GUI loading one piece and then yielding.
The text was updated successfully, but these errors were encountered:
It would be nice to have a global utility function to perform operations as coroutines, like:
function performAsCoroutine(_function, _param)
local thread = MOAICoroutine.new()
thread:run(_function, _param)
end
so in the _function we can use
coroutine.yield()
I already use this method in my projects , passing the other function to execute at the end of _function as _param.
like:
function performAsCoroutine(_function, _param)
local thread = MOAICoroutine.new()
thread:run(_function, _param)
end
function toPerformAfterCoroutine()
print("coroutine finished")
end
function fCoroutine(nextFunction)
--do something
coroutine.yield()
--other
coroutine.yield()
--other
coroutine.yield()
nextFunction()
end
performAsCoroutine(fCoroutine, toPerformAfterCoroutine)
EDIT:
A sample would be nice, too.
A loading bar sample would be great.
For a loading bar we should have two coroutines:
one for the the loading bar each step moving and yielding,
one for the GUI loading one piece and then yielding.
The text was updated successfully, but these errors were encountered: