Jump to content

Is it possible to delay "complete" until an asynchronous load in "preload" completes?


nicotr014
 Share

Recommended Posts

Hello, I'm wondering if theres a way to delay "complete" callback from happening until a custom file has been loaded. What I'm trying to do is load an "xm" file via xmlhttprequest for use with FlodJS. I would like to wait for the xhr to complete before calling "complete"

 

Will I be able to do this, or is there a better way to load binary files with Phaser?

 

Thanks

Link to comment
Share on other sites

Excellent!! Looks great, thanks.

 

So I believe I have to build a new Phaser.js/Phaser-min.js with the development src. From a hint, i ran "php build.php" and it did create a file but its very short, only the top part of what should be a large file.

(function (root, factory) {    if (typeof define === 'function' && define.amd) {        define(factory);    } else if (typeof exports === 'object') {        module.exports = factory();    } else {        root.Phaser = factory();    }}(this, function ( {    return Phaser;}));

I might be doing something wrong, any idea? 

 

Thanks again

Link to comment
Share on other sites

Problem solved! I installed grunt and used it to build the files instead

npm install -g grunt-clinpm install gruntnpm install grunt-contrib-cleannpm install grunt-contrib-concatnpm install grunt-contrib-connectnpm install grunt-contrib-copynpm install grunt-contrib-uglifynpm install lodash

Now inside the Phaser-dev folder, run 

grunt
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...