【问题标题】:OpenFeint is on only half of the screenOpenFeint 只在屏幕的一半
【发布时间】:2010-09-26 23:13:05
【问题描述】:

我正在尝试在我的 Cocos2D iPhone 游戏中实现 OpenFeint,但这里有一些奇怪的东西我没有找到解决方法。 这是我初始化 OpenFeint 时的样子: http://img842.imageshack.us/img842/8564/screenshot20100926at520.png 这是初始化的代码:

[director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];
NSDictionary* settings = [NSDictionary dictionaryWithObjectsAndKeys:
                          [NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft], OpenFeintSettingDashboardOrientation,
                          @"NAME", OpenFeintSettingShortDisplayName,
                          [NSNumber numberWithBool:NO], OpenFeintSettingEnablePushNotifications,
                          [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]];

【问题讨论】:

    标签: iphone openfeint


    【解决方案1】:

    我在几个地方看到过你的帖子,因为我遇到了和你一样的问题。我刚刚为您找到了一个潜在的解决方案,并认为我会回复。似乎在某些情况下,OpenFeint 无法访问 keywindow,在这种情况下,它会创建自己的窗口,这可能不像您设置的那样。解决方案是通过将 OpenFeint 添加到设置中,让 OpenFeint 明确知道要跟踪哪个窗口。我的设置如下,如您所见,我用我的键控窗口添加了“OpenFeintSettingPresentationWindow”设置。这样做之后,效果非常好。希望这会有所帮助!

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

    【讨论】:

      【解决方案2】:

      您的二进制文件中的方向设置包可能有误,请删除横向并添加 iPhone 通用设置包。

      【讨论】:

        【解决方案3】:

        我不确定具体是什么问题,但看起来 OpenFeint 试图以横向显示,但不知何故被旋转,就好像它处于纵向模式一样。 oyu 可以仔细检查以确保您的方向对于您的应用程序的主视图控制器都是正确的(或者您在 Cocos2D 中对其进行配置)。 OpenFeint 也知道吗?

        【讨论】:

        • 如上一行所见,我在Cocos2D中将方向设置为Landscape-Left,然后在OpenFeint中也一样。实际上,我尝试了许多不同的方向,但都没有奏效,唯一可以正常工作的是纵向,但我的游戏是横向的……
        【解决方案4】:

        cocos2d中的窗口只需要引用applicationDidFinishLaunching中的窗口即可。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2020-11-07
          • 1970-01-01
          相关资源
          最近更新 更多