Recently, i found that:
when i add a SpriteFrames files into CCSpriteFrameCache,
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("thefile.plist");
and then get a sprite with one SpriteFrame’s name
CCSprite::spriteWithSpriteFrameName('theframename');
the sprite texture’s edges will appear other images’ edges.
At first, i try to resolved the problem with TexturePacker. When i build the plist file, i will change it’s Border Padding more than 1.
it’s ok, now.
But, i think it is not TexturePacker’s problem.
Because, the plist and png file are both correctly.
So, i read the source codes,
i found the wrong point in CCSprite::updateTextureCoords
there is the code (two parts):
left = rect.origin.x/atlasWidth;
right = left+rect.size.height/atlasWidth;
top = rect.origin.y/atlasHeight;
bottom = top+rect.size.width/atlasHeight;
left = rect.origin.x/atlasWidth;
right = left + rect.size.width/atlasWidth;
top = rect.origin.y/atlasHeight;
bottom = top + rect.size.height/atlasHeight;
i think it’s shoud be:
<pre>
left = rect.origin.x/atlasWidth;
right = left/atlasWidth;
top = rect.origin.y/atlasHeight;
bottom = top/atlasHeight;
</pre>**
<pre>
left = rect.origin.x/atlasWidth;
right = left + /atlasWidth;
top = rect.origin.y/atlasHeight;
bottom = top + /atlasHeight;
</pre>