How to mask sprites in cocos2d alpha gradient?

I would like to ensure that CCNode (maybe CCLayer, CCSprite, etc.) can mask all its children with a shader so that they can mask out gradually as they approach the borders of the node without directly changing the opacity value. For example, a menu might look like this:

Menu with items that fade near the edges

The mask in this case will be a gradient, which may look something like this:

enter image description here

+5
source share
2 answers

- Ray Wenderlich, , . , , , CCRenderTexture, , , , node, .

0

, , , , , , - . , , , , .

, , "" .

z-, , . , .

, Claustrophobic.

0

All Articles