Cocos2d 2.0 バージョンに大きな問題があります =(
問題: アプリを起動した後、ゲーム シーンが画面に表示されず、何をしても真っ暗な画面が表示されます。
ここに私のコードからのストレッチがあります。
あなたたちが私を助けようとしてくれたら、私は感謝します = D ありがとう!
//AppDelegate from cocos2d basic template, I change this line
[director_ pushScene:[GameScene node]];
//my GameScene class implementation
- (id)init
{
if(self != nil)
{
BackgroundLayer *backgroundLayer = [BackgroundLayer node];
[self addChild:backgroundLayer z:0];
}
return self;
}
//then, my BackgroundLayer class implementation
- (id)init
{
if(self != nil)
{
CCSprite *backgroundImage = [CCSprite spriteWithFile:@"backgroundiPhone.png"];
CGSize screenSize = [[CCDirector sharedDirector] winSize];
[backgroundImage setPosition:CGPointMake(screenSize.width / 2, screenSize.height / 2)];
//yea the image is in the project, maybe if I add some color at the sprite to be sure?
[self addChild:backgroundImage z:0 tag:0];
}
return self;
}