iOS Graphical Issue(iOS 图形问题)
问题描述
所以我正在创建一个横向滚动射击游戏,但偶尔会遇到一些图形问题.我遇到了这条出现的神秘线.正如您在下图中看到的那样,它出现在一些但不是所有的精灵上.我该如何解决这个问题?这是我的还是艺术家的错误?
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 图形问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:iOS 图形问题


基础教程推荐
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01