For texturepacker compatiblity, make sure 'frame' property exists before attempting to use it
This commit is contained in:
parent
6dacba9b33
commit
bd5f5352b7
1 changed files with 11 additions and 8 deletions
|
@ -69,16 +69,19 @@ PIXI.SpriteSheetLoader.prototype.onLoaded = function()
|
|||
for (var i in frameData)
|
||||
{
|
||||
var rect = frameData[i].frame;
|
||||
PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
|
||||
|
||||
if(frameData[i].trimmed)
|
||||
if (rect)
|
||||
{
|
||||
//var realSize = frameData[i].spriteSourceSize;
|
||||
PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
|
||||
PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
|
||||
// calculate the offset!
|
||||
PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {x:rect.x, y:rect.y, width:rect.w, height:rect.h});
|
||||
|
||||
if(frameData[i].trimmed)
|
||||
{
|
||||
//var realSize = frameData[i].spriteSourceSize;
|
||||
PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
|
||||
PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
|
||||
// calculate the offset!
|
||||
}
|
||||
// this.frames[i] = ;
|
||||
}
|
||||
// this.frames[i] = ;
|
||||
}
|
||||
|
||||
if(this.texture.hasLoaded)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue