How to solve the problem that cocos2d-x doesn’t work on the layer setting setopacity()


I wanted to set the whole layer as translucent, but it didn’t work. Later, I found that the solution was very poor

layer:setOpacity(255 * 0.4)

I don’t understand. Why doesn’t the official set cascade opacityenabled to true by default? Isn’t it pure cheating? It’s not mentioned in the document that you can’t find it on stackhoverflow. Finally, I found a solution from a Japanese blog:Cocos2d-x ででノノドのノドのをノドにっっっノドドの