0

我的 cocos2d ipad 应用程序在 ipad 中正确加载。但是在默认加载屏幕之后,它不会全屏加载。

  @implementation IntroLayer


 +(CCScene *) scene
 {  
 CCScene *scene = [CCScene node];

 IntroLayer *layer = [IntroLayer node];

 [scene addChild: layer];

 return scene;
 }


 -(id) init
 {
if( (self=[super init])) {

    CGSize size = [[CCDirector sharedDirector] winSize];

    CCSprite *background;

    if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ) {
        background = [CCSprite spriteWithFile:@"Default.png"];
        background.rotation = 90;
    } else {
        background = [CCSprite spriteWithFile:@"Default-Landscape~ipad.png"];
    }
    background.position = ccp(size.width/2, size.height/2);

    [self addChild: background];
}

return self;
 }

 -(void) onEnter
 {
[super onEnter];
[[CCDirector sharedDirector] replaceScene:[CCTransitionFade transitionWithDuration:1.0 scene:[HelloWorldLayer scene] ]];
 }
  @end
4

0 回答 0