<tfoot id='6Kl1U'></tfoot>
    • <bdo id='6Kl1U'></bdo><ul id='6Kl1U'></ul>
    1. <legend id='6Kl1U'><style id='6Kl1U'><dir id='6Kl1U'><q id='6Kl1U'></q></dir></style></legend>
      <i id='6Kl1U'><tr id='6Kl1U'><dt id='6Kl1U'><q id='6Kl1U'><span id='6Kl1U'><b id='6Kl1U'><form id='6Kl1U'><ins id='6Kl1U'></ins><ul id='6Kl1U'></ul><sub id='6Kl1U'></sub></form><legend id='6Kl1U'></legend><bdo id='6Kl1U'><pre id='6Kl1U'><center id='6Kl1U'></center></pre></bdo></b><th id='6Kl1U'></th></span></q></dt></tr></i><div id='6Kl1U'><tfoot id='6Kl1U'></tfoot><dl id='6Kl1U'><fieldset id='6Kl1U'></fieldset></dl></div>

        <small id='6Kl1U'></small><noframes id='6Kl1U'>

        排行榜没有添加到屏幕 cocos2d

        时间:2024-08-12

        • <bdo id='WaP9j'></bdo><ul id='WaP9j'></ul>

          <small id='WaP9j'></small><noframes id='WaP9j'>

            <tfoot id='WaP9j'></tfoot>
            <i id='WaP9j'><tr id='WaP9j'><dt id='WaP9j'><q id='WaP9j'><span id='WaP9j'><b id='WaP9j'><form id='WaP9j'><ins id='WaP9j'></ins><ul id='WaP9j'></ul><sub id='WaP9j'></sub></form><legend id='WaP9j'></legend><bdo id='WaP9j'><pre id='WaP9j'><center id='WaP9j'></center></pre></bdo></b><th id='WaP9j'></th></span></q></dt></tr></i><div id='WaP9j'><tfoot id='WaP9j'></tfoot><dl id='WaP9j'><fieldset id='WaP9j'></fieldset></dl></div>

              <tbody id='WaP9j'></tbody>

                  <legend id='WaP9j'><style id='WaP9j'><dir id='WaP9j'><q id='WaP9j'></q></dir></style></legend>
                  本文介绍了排行榜没有添加到屏幕 cocos2d的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  I used the code below to show the Leaderboard but all i got it the console this

                  cocos2d: surface size: 480x320
                  

                  the code:

                  - (void)showLeaderboardForCategory:(NSString *)category
                  {
                      // Only execute if OS supports Game Center & player is logged in
                      if (hasGameCenter)
                      {    
                  
                          // Create leaderboard view w/ default Game Center style
                          GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init];
                  
                          // If view controller was successfully created...
                          if (leaderboardController != nil)
                          {
                              // Leaderboard config
                              leaderboardController.leaderboardDelegate = self;   // The leaderboard view controller will send messages to this object
                              leaderboardController.category = category;  // Set category here
                              leaderboardController.timeScope = GKLeaderboardTimeScopeAllTime;    // GKLeaderboardTimeScopeToday, GKLeaderboardTimeScopeWeek, GKLeaderboardTimeScopeAllTime
                  
                              // Create an additional UIViewController to attach the GKLeaderboardViewController to
                              myViewController = [[UIViewController alloc] init];
                  
                              // Add the temporary UIViewController to the main OpenGL view
                              [[[CCDirector sharedDirector] openGLView] addSubview:myViewController.view];
                  
                              // Tell UIViewController to present the leaderboard
                              [myViewController presentModalViewController:leaderboardController animated:YES];
                          }
                      }
                  }
                  

                  Finally I called the code like this :

                      [[GameCenterManager sharedGameCenterManager] showLeaderboardForCategory:@"LeaderBoard"];
                  

                  解决方案

                  I found the solution I must write :

                      [[[[CCDirector sharedDirector] openGLView] window] addSubview:myViewController.view];
                  

                  instead of :

                      [[[CCDirector sharedDirector] openGLView] addSubview:myViewController.view];
                  

                  这篇关于排行榜没有添加到屏幕 cocos2d的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在场景 cocos2d 之间传递音频 下一篇:Cocos2d - iPhone 上的月食效果

                  相关文章

                  <small id='GdXcR'></small><noframes id='GdXcR'>

                • <legend id='GdXcR'><style id='GdXcR'><dir id='GdXcR'><q id='GdXcR'></q></dir></style></legend>

                • <i id='GdXcR'><tr id='GdXcR'><dt id='GdXcR'><q id='GdXcR'><span id='GdXcR'><b id='GdXcR'><form id='GdXcR'><ins id='GdXcR'></ins><ul id='GdXcR'></ul><sub id='GdXcR'></sub></form><legend id='GdXcR'></legend><bdo id='GdXcR'><pre id='GdXcR'><center id='GdXcR'></center></pre></bdo></b><th id='GdXcR'></th></span></q></dt></tr></i><div id='GdXcR'><tfoot id='GdXcR'></tfoot><dl id='GdXcR'><fieldset id='GdXcR'></fieldset></dl></div>
                  1. <tfoot id='GdXcR'></tfoot>
                        <bdo id='GdXcR'></bdo><ul id='GdXcR'></ul>