mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 06:28:30 +00:00
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.
This commit is contained in:
parent
c1ff6ef0df
commit
c9a67936d8
1 changed files with 8 additions and 0 deletions
|
@ -94,6 +94,12 @@ Phaser.Loader = function (game) {
|
|||
*/
|
||||
this.baseURL = '';
|
||||
|
||||
|
||||
/**
|
||||
* @property {Phaser.Signal} onFileStart - Event signal.
|
||||
*/
|
||||
this.onFileStart = new Phaser.Signal();
|
||||
|
||||
/**
|
||||
* @property {Phaser.Signal} onFileComplete - Event signal.
|
||||
*/
|
||||
|
@ -879,6 +885,8 @@ Phaser.Loader.prototype = {
|
|||
console.warn('Phaser.Loader loadFile invalid index ' + this._fileIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
this.onFileStart.dispatch(this.progress, this._fileList[this._fileIndex]);
|
||||
|
||||
var file = this._fileList[this._fileIndex];
|
||||
var _this = this;
|
||||
|
|
Loading…
Add table
Reference in a new issue