开发者

OpenFeint is on only half of the screen

I'm trying to implement OpenFeint in my Cocos2D iPhone game, but here's something weird that I didn't find how to solve. Here's how OpenFeint looks like when I initialize it: http://img842.imageshack.us/img842/8564/screenshot20100926at520.png And here's the code of the initialization:

[director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];
NSDictionary* settings = [NSDictionary dictionaryWithObjectsAndKeys:
                          [NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft], OpenFeintSettingDashboardOrientation,
                          @"NAME", OpenFeintSettingShortDisplayName,
                          [NSNumber numberWithBool:NO], Ope开发者_JS百科nFeintSettingEnablePushNotifications,
                          [NSNumber numberWithBool:YES], OpenFeintSettingAlwaysAskForApprovalInDebug, 
                          [NSNumber numberWithBool:YES], OpenFeintSettingDisableUserGeneratedContent, nil];
[OpenFeint initializeWithProductKey:@"PRODUCTKEY" andSecret:@"SECRET"
                     andDisplayName:@"NAME" andSettings:settings andDelegates: [OFDelegatesContainer containerWithOpenFeintDelegate:self]];
[[CCDirector sharedDirector] runWithScene: [MainMenuScene node]];


I've seen your post in a few places as I was having the same problem as you were. I just figured out a potential solution for you and thought I would reply. It seems that on some occasions OpenFeint is unable to access the keywindow and in that case creates it's own window that may not act as yours has been set up to do. The solution is to let OpenFeint know specifically which window to go after by adding it to the settings. My settings are below and as you can see I added the "OpenFeintSettingPresentationWindow" Setting with my keyed window. After doing this it worked wonderfully. Hope this helps!

NSDictionary* settings = [NSDictionary dictionaryWithObjectsAndKeys:
                            [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight], OpenFeintSettingDashboardOrientation,
                            window, OpenFeintSettingPresentationWindow,
                            @"ComingSoon", OpenFeintSettingShortDisplayName, 
                            [NSNumber numberWithBool:YES], OpenFeintSettingEnablePushNotifications,
                            nil];


Chances are you have the wrong settings bundle for orientations in your binary, delete landscape and add the iPhone universal settings bundle.


I'm not sure specifically what the problem is, but it looks like OpenFeint is trying to display in landscape but is somehow being rotated as if it was in Portrait mode. Can oyu double check to make sure your orientations are correct for both your app's primary view controller (or however you configure it in Cocos2D). And that OpenFeint is aware of it as well?


In cocos2d,the window just need to refer to the window in applicationDidFinishLaunching.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜