i search for a long time,but the code always for ios,some functions i don’t understand the means,wait for help.
The effect just like this picture.
I think you are looking for below code,
// create dark layer with alpha
darkLayer = CCLayerColor::create(ccc4(0,0,0,125));
just take good care of z value while adding child.
add those code in your init and make visible when you required.