1
\$\begingroup\$

In my cocos2d iphone project I have one major layer, the game layer. When the user presses the pause button the scene is paused and another scene is pushed onto it, the pause scene.

[[CCDirector sharedDirector] pushScene:[PauseLayer node]];

I realize the pause scene as a CCLayerColor. I want the layer to be transparent but I can't set both color and opacity. The layer is always black, although I can see my menu on it.

self = [super initWithColor:ccc4(255, 255, 255, 50)]

Any ideas?

\$\endgroup\$
1
\$\begingroup\$

when you are changing the scene, no function is called from your gameScene so CCLayerColor draw itself on a black screen. to solve this you have to either not change the scene or add your game scene to the background layer of puase scene. ar you can also override pause scene draw method and call [gamescene draw] inside it.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.