abhishek kumar
abhishek kumar

Reputation: 95

How to set a transparent image as a background?

I want to display a fullscreen transparent image anytime there is an active menu button in cocos2d. How do I do that?

Upvotes: 2

Views: 434

Answers (1)

user481081
user481081

Reputation:

If you're looking to provide a popup dialog underlay, you can use CCLayerColor:

CCLayerColor* underlay = [CCLayerColor layerWithColor:ccc4(0, 0, 0, 127)];

[self addChild:underlay z:(something less than your button's z)];

If it has to be a specific image, initialize the image and do the second line above using your CCSprite.

Upvotes: 1

Related Questions