Pass loader that completed, fixes #213

This commit is contained in:
Chad Engler 2014-02-09 12:02:33 -08:00
parent 09d1354b32
commit c4a0185c0f

View file

@ -112,8 +112,8 @@ PIXI.AssetLoader.prototype.load = function()
{ {
var scope = this; var scope = this;
function onLoad() { function onLoad(evt) {
scope.onAssetLoaded(); scope.onAssetLoaded(evt.loader);
} }
this.loadCount = this.assetURLs.length; this.loadCount = this.assetURLs.length;
@ -145,11 +145,11 @@ PIXI.AssetLoader.prototype.load = function()
* @method onAssetLoaded * @method onAssetLoaded
* @private * @private
*/ */
PIXI.AssetLoader.prototype.onAssetLoaded = function() PIXI.AssetLoader.prototype.onAssetLoaded = function(loader)
{ {
this.loadCount--; this.loadCount--;
this.dispatchEvent({type: 'onProgress', content: this}); this.dispatchEvent({ type: 'onProgress', content: this, loader: loader });
if (this.onProgress) this.onProgress(); if (this.onProgress) this.onProgress(loader);
if (!this.loadCount) if (!this.loadCount)
{ {