Merge pull request #135 from grifotv/patch-1
Calculate offset of trimmed frames in sprite sheet
This commit is contained in:
commit
c9a51f90ac
1 changed files with 2 additions and 3 deletions
|
@ -82,10 +82,9 @@ PIXI.SpriteSheetLoader.prototype.onJSONLoaded = function()
|
|||
|
||||
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!
|
||||
PIXI.TextureCache[i].trim.x = PIXI.TextureCache[i].realSize.x / rect.w;
|
||||
PIXI.TextureCache[i].trim.y = PIXI.TextureCache[i].realSize.y / rect.h;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue