Preloader on native targets

Is there a way to show a preloader on for instance an iPad before the application loads? Now I just see the background color for a long time because I’m loading multiple assets. I’ve tried this but it still acts the same.

One way I’ve done this before is to load an image on the first frame and then load the rest of the assets afterwards. I did this using something like:

showSplashImage();
Timer.delay( loadRestOfGame(), 100 );

You would just add a full screen image to the stage in showSplashImage and then that would be everything that happens in the first frame. When the Haxe Timer catches up it will load the rest of the game using the loadRestOfGame function but by this point the splash image will already have been rendered.

You could extend this method and break down loading your assets into smaller sections and have some kind of progress animation but that will be more work.

Hope this helps.

1 Like