项目由3.9升级到3.17.2版本发现原来拼接的地图在滑动时出现了缝隙,精灵设置抗锯齿无效(部分设备)
2020/11/20更:
打开此开关导致部分图片渲染异常,图片锯齿感增强(非矩形资源),圆形图片边缘丢失、形状挤压。。。
经过查找解决方案如下:
将base/ccConfig.h文件中的 CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL开启即可
/** @def CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
* If enabled, the texture coordinates will be calculated by using this formula:
* - texCoord.left = (rect.origin.x*2+1) / (texture.wide*2);
* - texCoord.right = texCoord.left + (rect.size.width*2-2)/(texture.wide*2);
* The same for bottom and top.
* This formula prevents artifacts by using 99% of the texture.
* The "correct" way to prevent artifacts is by using the spritesheet-artifact-fixer.py or a similar tool.
* Affected nodes:
* - Sprite / SpriteBatchNode and subclasses: LabelBMFont, TMXTiledMap.
* - LabelAtlas.
* - QuadParticleSystem.
* - TileMap.
* To enabled set it to 1. Disabled by default.
* @since v0.99.5
*/
#ifndef CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
#define CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL 1
#endif