[solved] HTML5 Preloader



  • Hi guys!

    As Im towards the completion of the Html5 of my game, I tried to add a preloader, by just cloning the FlxPreloader class, and setting it on the .XML by doing:

    <!--<app preloader="Preloader" />-->
    

    It didn't work on HTML5. As I digged into the original code, I noticed:

    #if !js
    

    ... that means, is ignoring HTML5 on purpose. Then, it fallbacks to NMEPreloader, which seems like is dinamically generated :(

    Question is then, how to do a preloader on HTML5 target?

    Many many thanks in advance!


  • administrators

    There's a pending pull request adding HTML5 support to the preloader, but it hasn't been merged yet.



  • OMG thanks a lot. That info surely will come in handy, thanks thanks :heart_decoration:



  • Got it working :)

    alt text

    In case it helps anyone, what I did was replacing my HaxeFlixel files, for @Nallebeorn ones: FlxBasePreloader.hx and FlxPreloader.hx, then on your project.XML file make sure you got: <app preloader="flixel.system.FlxPreloader" />

    I use 4.0.1 version. If not mistaken, the next release will include this by default. I thought I might share in case someone else finds it useful.


Log in to reply