问题描述
所以我正在创建一个横向滚动射击游戏,但偶尔会遇到一些图形问题.我遇到了这条出现的神秘线.正如您在下图中看到的那样,它出现在一些但不是所有的精灵上.我该如何解决这个问题?这是我的还是艺术家的错误?
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?
我正在使用 Cocos2d 开发并使用 CCSpriteBatchNode,我的精灵表是 .png,不确定信息是否相关,只是想我会留下尽可能多的信息.
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.
有什么想法吗???
推荐答案
我也在我的一个 cocos2D 游戏中观察到了同样的事情.我通过做两件事解决了这个问题.
I also observed the same thing in one of my cocos2D games. I fixed this problem by doing 2 things.
一个:
在 ccConfig.h 中定义这个
One:
In ccConfig.h define this
#ifndef CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
#define CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL 1
#endif
第二个:
检查你的 spriteSheet,在 sprite Spacing 中使用 2 个像素的间隙.(我用过Zwoptex) 有一个选项.
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.
这篇关于iOS 图形问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!