UIKit
との両方を使用してiPhoneアプリケーションを作成していますcocos2d
。今、私の1つで、サブビューとしてをViewControllers
追加しています。HelloWorldLayer
正常に追加されました。
現在、このレイヤーは黒の背景色で追加されています。背景色をclearColor
正確に透明にしたいので、ViewControllerのコンテンツ(のコンテンツを除く)を表示できますHelloWorldLayer
。
CCLayer
背景色を変更する方法を知っています。私はそれのために使用ccc4(r, g, b, a)
しています。
ここに私のコードを識別します:
-(id) init
{
// always call "super" init
// Apple recommends to re-assign "self" with the "super's" return value
if( (self=[super initWithColor:ccc4(0, 0, 0, 128)]) ) {
CGSize windowSize = [[CCDirector sharedDirector] winSize];
CCSprite *imgRoof;
imgRoof = [CCSprite spriteWithFile:@"Tops.png"];
imgRoof.position = ccp(windowSize.width/2,windowSize.height/2);
[self addChild:imgRoof];
CCAction* action = [CCBlink actionWithDuration:20 blinks:20];
[imgRoof runAction:action];
}
return self;
}
のカラーコードを知りたいだけclearColor
ですccc4()
。誰かが私を助けてくれますか、私は本当に立ち往生しています。
よろしくお願いします!!!