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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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