简体   繁体   English

关闭CCSprite上的抗锯齿功能(Cocos2D iPhone)

[英]Turn off anti aliasing on CCSprite (Cocos2D iPhone)

When a CCSprite of mine, which uses a 16x16 image, is scaled up, there is a lot of blurring. 当我使用16x16图像的我的CCSprite按比例放大时,会出现很多模糊现象。

This image is pixel art, and therefore meant to be pixelated, but not blurred. 这个图像是像素艺术,因此意味着像素化,但不模糊。

I've tried running the method setAntiAliasTexParameters on the texture of the sprite, but it doesn't change anything. 我已经尝试在精灵的纹理上运行方法setAntiAliasTexParameters ,但它不会改变任何东西。

Here is the code: (mainSprite is CCSprite and slide1 is CCTexture2D) 这是代码:( mainSprite是CCSprite,slide1是CCTexture2D)

slide1 = [[CCTexture2D alloc] initWithImage:[UIImage imageNamed:@"slide1.png"]];
[slide1 setAntiAliasTexParameters];

[mainSprite setTexture:slide1];

Thank you, any help is appreciated! 谢谢,任何帮助表示赞赏!

Use setAliasTexParameters instead of setAntiAliasTexParameters . 使用setAliasTexParameters而不是setAntiAliasTexParameters That should turn off antialiasing for your chosen sprite. 这应该关闭你选择的精灵的抗锯齿。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM