BitlasLT Posted December 31, 2013 Share Posted December 31, 2013 Hello.First of all ,than you for a wonderful library .I am facing strange issue with preloader progress.Everything works ,but i just cant get bar to show up I thought problem was "this.load.setPreloadSprite(this.preloadBar);"But it is not .I tried to listen onComplite event . And it shows that progress is always 0 .But i need to load files dynamicly(becouse big amount of images ) .So as soon i use loop like this : for(var i=0;i<this.game.levelArray.length;i++){this.load.image("thumb"+i, 'skin/thumbs/'+i+'.jpg');for(var j=0;j<this.game.levelArray[i].itemArray.length;j++){ this.load.image(this.game.levelArray[i].itemArray[j].name+this.game.levelArray[i].levelNr, this.game.levelArray[i].itemArray[j].source);}}Preloader progress and bar doesnt work anymore . Loader itself works fine .But just not bar and progress % It looks like problem is file number.I tested various places from array.if file number less than 100 ,everything works fine.But after 100 .Progress is always 0.Is 100 magical number?Is it possible to change it?IF some1 could know a reason for this .IT would be super helpfull.Sry for my English. Link to comment Share on other sites More sharing options...
rich Posted December 31, 2013 Share Posted December 31, 2013 Use the code feature in the forum to wrap code, it makes it much easier to read! There's nothing wrong with the code you've posted at a glance, so it must be more to do with the progress function. Post that up perhaps? Link to comment Share on other sites More sharing options...
BitlasLT Posted December 31, 2013 Author Share Posted December 31, 2013 OH sry ,But I found problem myself In loader.js this.progress = Math.round(this.progress + this._progressChunk);This makes progress report zeros than downloading files lenght is more than 100.Removing and ,making progress return tofixed(2) .Solved my problem. Link to comment Share on other sites More sharing options...
rich Posted December 31, 2013 Share Posted December 31, 2013 Good catch I've fixed this in the dev branch, so there is a new property now: Loader.progressFloat which contains the non-rounded progress value, useful if you've > 100 files, but not to be used for sprite cropping Link to comment Share on other sites More sharing options...
BitlasLT Posted December 31, 2013 Author Share Posted December 31, 2013 It looks nice even with croping .To not spam other boards ,but once again .Thank you very much!!!.First time in this year than i started html5/js coding iam excited about it.Phaser is wonderfull tool .As coming from flash background it was so hard and anoying to find right tools.I tried many libraries ,but in almost all cases i was left frustrated .OR performance was terrible.But phaser ... its only2 weeks iam using it , but results and workflow is wonderfull. Thank you for making me happy coder again For example on this project iam working : it is basscily starling as3 game converting.I was able to make it running in phaser really fast.Even reuse flash editor for levels and layouts.Groups are wonderfull .All data was reused without any problems or layout differences.And performance even on mobile canvas is great.Once again thank you .Keep this good work you are doing.Yours, over excited as3 programmer Sry for my English. Link to comment Share on other sites More sharing options...
rich Posted December 31, 2013 Share Posted December 31, 2013 Glad to hear it! I'd love to see your game when it's ready. Seeing games made in Phaser (and reading feedback from devs) is what motivates me to carry on Heppell08 1 Link to comment Share on other sites More sharing options...
Recommended Posts