我正在为iOS开发游戏。我使用Texturepacker创建一个sprite表,它生成2个文件.plist和.png文件。当我在我的代码中使用这些文件时,我发现所有精灵的图像都是低质量的,颜色是苍白的非常苍白,我认为这是因为texturepacker程序。 我想要你的建议我该怎么做才能解决这个问题。
答案 0 :(得分:2)
我猜你没有改变缓冲像素格式。你可以试试这个。
使用像素格式化kEAGLColorFormatRGBA8而不是kEAGLColorFormatRGB565。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Create the main window
window_ = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Create an CCGLView with a RGB565 color buffer, and a depth buffer of 0-bits
CCGLView *glView = [CCGLView viewWithFrame:[window_ bounds]
pixelFormat:kEAGLColorFormatRGBA8 //Guru - replaced kEAGLColorFormatRGBA8 / kEAGLColorFormatRGB565
depthFormat:0 //GL_DEPTH_COMPONENT24_OES
preserveBackbuffer:NO
sharegroup:nil
multiSampling:NO
numberOfSamples:0];