Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Strange preloader behaviour


BitlasLT
 Share

Recommended Posts

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 :D
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

OH sry ,
But I found problem myself :D

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

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 :D

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 :D
Sry for my English.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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