简体   繁体   English

Cocos2D 2.0-更改CCParticle的颜色

[英]Cocos2D 2.0 - Changing color of a CCParticle

So after messing around with my game, there's a thing that I wanted to share with you that I discovered about CCParticle. 因此,在弄乱了我的游戏之后,我想与您分享关于CCParticle的一件事。

  • How do I change the color of the particles in a CCParticleSystem? 如何更改CCParticleSystem中粒子的颜色?

  • When I was on cocos 1.x, I could change it with startColor, endColor, but in 2.0, whenever I do it, it stays black. 当我使用cocos 1.x时,可以使用startColor,endColor进行更改,但是在2.0中,每当执行此操作时,它将保持黑色。 Why? 为什么?

A:In Cocos2D 2.0, it stays the same, but unlike in 1.x, you must first make sure that the particle texture is white, because otherwise it will not blend with the color you want! 答:在Cocos2D 2.0中,它保持不变,但是与1.x不同,您必须首先确保粒子纹理是白色的,因为否则它将不会与您想要的颜色融合! Make sure too that the texture is correctly added, because if not, it will show big black pixels and that's probably not the result you want! 还要确保正确添加了纹理,因为如果不正确,它将显示黑色大像素,而这可能不是您想要的结果!

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

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