nicotr014 Posted December 20, 2013 Share Posted December 20, 2013 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 More sharing options...
rich Posted December 20, 2013 Share Posted December 20, 2013 You may be interested in the most recent commit to the dev branch https://github.com/photonstorm/phaser/commit/3cbb820349c7a32256fec154a75c6069ea1d3b71 In the examples/wip folder look at mod.js - shows how to use it with the callback process. Also you'll notice it's happily playing back Protracker files Link to comment Share on other sites More sharing options...
nicotr014 Posted December 22, 2013 Author Share Posted December 22, 2013 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 More sharing options...
nicotr014 Posted December 22, 2013 Author Share Posted December 22, 2013 Problem solved! I installed grunt and used it to build the files insteadnpm 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 lodashNow inside the Phaser-dev folder, run grunt Link to comment Share on other sites More sharing options...
rich Posted December 22, 2013 Share Posted December 22, 2013 Yeah grunt is the way you can also do 'grunt examples' to just rebuild the json example list too. Link to comment Share on other sites More sharing options...
Recommended Posts