iOS Graphical Issue

2019-01-26 00:08发布

问题:

so I am creating a side scrolling shooter game but am having an issue with some of the graphics occasionally. I'm running into this mysterious line that appears. As you can see on the image below it appears on some but not all the sprites. How can I go about fixing this? Is this mine or the artists mistake?

I am developing with Cocos2d and using a CCSpriteBatchNode and my sprite sheet is a .png, not sure if the information is relevant just thought I'd leave as much info possible.

Any ideas???

回答1:

I also observed the same thing in one of my cocos2D games. I fixed this problem by doing 2 things.

One:
In ccConfig.h define this

#ifndef CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
#define CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL 1
#endif

Second:

Check your spriteSheet, use 2 pixel gap in sprite Spacing.(I used Zwoptex) there's an option.

I believe first one should surely solve your problem.. Happy Coding.