diff --git a/templates/haxe/ApplicationMain.hx b/templates/haxe/ApplicationMain.hx index fbf75ea30..bdbca0e50 100644 --- a/templates/haxe/ApplicationMain.hx +++ b/templates/haxe/ApplicationMain.hx @@ -63,6 +63,7 @@ class ApplicationMain { public static function create ():Void { preloader = new ::if (PRELOADER_NAME != "")::::PRELOADER_NAME::::else::lime.app.Preloader::end:: (); + preloader.onComplete.add (registerLibrary); #if !munit app = new ::APP_MAIN:: (); @@ -170,10 +171,15 @@ class ApplicationMain { #end - public static function start ():Void { + private static function registerLibrary ():Void { lime.Assets.registerLibrary ("default", new DefaultAssetLibrary ()); + } + + + public static function start ():Void { + #if !munit var result = app.exec ();