Using FlxUILoadingScreen
-
Hi all,
Has anyone a working example using FlxUILoadingScreen?
It's for a FlxUIState .create() method which is a bit long. Ideally I would like to do the whole thing in one fuction (create()), where I would create the FlxUILoadingScreen substate, refresh the screen/update, do a bit of work, set 10% progress, refresh/update, do a bit more work, set 20%, etc.
Tried something like that but it did not work (black screen):
@:access(flixel.FlxGame) override public function create():Void { super.create() loading = new FlxUILoadingScreen(FlxColor.GREEN); openSubState(loading); FlxG.game.step(); FlxG.game.draw(); ... loading.set(0.1); FlxG.game.step(); FlxG.game.draw(); ...
Thanks!
-
Maybe this can help:
http://haxeflixel.com/demos/FlxAsyncLoop/
-
Thanks @DleanJeans. The FlxAsyncLoop example you provide works well.