Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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