cocos2d-x 图片拼接出现缝隙或者黑边问题解决方案

最近做一个滚动背景图出现多长背景图之间衔接出现黑边(坐标是正确的)。解决方法如下:

 

1、对出现黑边的精灵调用以下方法:

CCSprite * sp = CCSprite::create("xxx.png");

sp->getTexture()->setAliasTexParameters();

 

2、在 bool AppDelegate::applicationDidFinishLaunching()中添加

CCDirector *pDirector = CCDirector::sharedDirector();

pDirector->setProjection(kCCDirectorProjection2D);//指定cocos2d2d模式

 

3、对于图片的坐标位置尽可能使用int而不是float。

posted on 2013-11-21 23:05  Ryan_Y  阅读(2665)  评论(0编辑  收藏  举报