For texturepacker compatiblity, make sure 'frame' property exists before attempting to use it

This commit is contained in:
Stephen Murray 2013-04-07 12:19:46 -04:00
parent 6dacba9b33
commit bd5f5352b7

View file

@ -69,6 +69,8 @@ PIXI.SpriteSheetLoader.prototype.onLoaded = function()
for (var i in frameData)
{
var rect = frameData[i].frame;
if (rect)
{
PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
if(frameData[i].trimmed)
@ -78,7 +80,8 @@ PIXI.SpriteSheetLoader.prototype.onLoaded = function()
PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
// calculate the offset!
}
// this.frames[i] = ;
// this.frames[i] = ;
}
}
if(this.texture.hasLoaded)