Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

Your Answer


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.