我可以在cocos2d的粒子系统中翻转纹理吗?
我想为落叶或从上面掉落的小纸制作粒子效果,就像秋天或婚礼上一样。所以我想也许我可以为叶子或纸张使用纹理,让它们从天上掉下来,同时纹理应该随机翻转 X/Y。但我找不到任何属性或方法可以让我这样做。
所以我的问题是,我可以吗? 如果我无论如何都无法翻转纹理,我怎样才能做出效果呢?
I want to make an particle effect for fallen leaf or little paper fallen from above, like it was autumn or on a wedding. So I think maybe I could use a texture for leaf or paper, let them fallen from sky, in the mean time, texture should flip X/Y randomly. But I can't find any property or method to let me do this.
So my question is, can I?
If I can't flip texture anyway, how can I make the effect?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CCParticleSystem 本身无法随机翻转纹理。
但由于 CCParticleSystem 派生自 CCNode,您可以尝试将scaleX/scaleY 属性设置为-1 以翻转整个粒子系统。这样你就可以在同一位置运行两个粒子系统,一个翻转,另一个不翻转。
The CCParticleSystem itself can't flip the textures randomly.
But since CCParticleSystem derives from CCNode you could try and set the scaleX/scaleY property to -1 to flip the entire particle system. That way you could run two particle systems at the same location, one flipped and the other unflipped.