How to simulate a large amount of data to the Preloader?

Hello you bunch of Haxe munchers :slight_smile:

How would you go about simulating a large about of data in the assets folder to the Preloader state, so that for example you can test a loading bar?

Thank you!


It’s not well documented, but -Dsimulate-preloader should make for a fake preloader progress (I think it defaults 2 seconds?) for writing a preloader. You can set a value (I think it’s in milliseconds) also to control exactly how long it will take (-Dsimulate-preloader=20000) :slight_smile:

1 Like

Holy Comic Sans, thank you again @signmajesty :slight_smile:

Wow it works, But is there a way to minify the js at the same time… i have tried this html5 -final-Dsimulate-preloader=20000? Doesn’t seems to work. I thought about compiling a separate for -final and -Dsimulate-preloader=20000, then replace it with minify js, But im not sure if it is a safe way to do it…

Won’t openfl test html5 -minify do it?

openfl test html5 -minify

I just tried it using “PiratePig”, I’m right, it is milliseconds, but the default is 3 seconds (similar to -Dsimulate-preloader=3000) if the define is enabled

On HTML5, I noticed that it continues, even if preloading has not completed at all. This means that it may be more helpful to use on the desktop (where there is no loading time), or to ensure the loading time is long enough that everything is loaded.

Using -final with -Dsimulate-preloader and PiratePig works for me, but if another sample fails to work with -final enabled, please let me know :slight_smile:

1 Like