Skip to content

Commit c9a6793

Browse files
committed
Added OnFileStart signal to loader
We've had a number of people in the channel ask for the ability to know when a file has started loading and to get the file names of said files. Added the OnFileStart signal to do just that.
1 parent c1ff6ef commit c9a6793

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/loader/Loader.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ Phaser.Loader = function (game) {
9494
*/
9595
this.baseURL = '';
9696

97+
98+
/**
99+
* @property {Phaser.Signal} onFileStart - Event signal.
100+
*/
101+
this.onFileStart = new Phaser.Signal();
102+
97103
/**
98104
* @property {Phaser.Signal} onFileComplete - Event signal.
99105
*/
@@ -879,6 +885,8 @@ Phaser.Loader.prototype = {
879885
console.warn('Phaser.Loader loadFile invalid index ' + this._fileIndex);
880886
return;
881887
}
888+
889+
this.onFileStart.dispatch(this.progress, this._fileList[this._fileIndex]);
882890

883891
var file = this._fileList[this._fileIndex];
884892
var _this = this;

0 commit comments

Comments
 (0)