2

I've read Ray Wenderlich's tutorial on sprite masking: http://www.raywenderlich.com/4428/how-to-mask-a-sprite-with-cocos2d-2-0. However, my understanding of openGL is poor, and this tutorial doesn't produce the effect I desire. What I would like to do is to mask one sprite/layer with another, and move the sprite behind the mask to create a "shiny" animation, like so:

enter image description here

Additionally, how could I make the mask dynamic (ex: changing the text string), and how could I make a sprite or layer count its children as part of the mask?

4

2 回答 2

1

我认为您可以通过动画来做到这一点,将“反射精灵”放在“遮罩精灵”下方,然后将“反射精灵”从左向右移动。

于 2020-07-23T14:35:00.963 回答
0

我认为这个 Github 存储库会对你有所帮助。

https://github.com/tonybeltramelli/Cocos2D-Mask-Shader

于 2013-05-20T14:34:08.897 回答