(转自 stackoverflow) http://stackoverflow.com/questions/22974453/game-center-sandbox-mode-display-multiple-leaderboards
最近项目中遇到在gamecenter中显示 多个 排行榜 的问题,但是按照ABGameKitHelper
的方法,只能显示单个排行榜,然后点击左上角的按钮才能显示多个排行版,通过查z资料在 stackoverflow上找到了解决办法,特此mark一下 。 感谢大家的帮助。
- (void) showGameCenter{
if (![[ABGameKitHelper sharedHelper] hasConnectivity]) return;
//Check if device runs on iOS 5
if([[[UIDevice currentDevice]systemVersion]intValue]==5)
{
//If so, we must use the GKLeaderboardViewController
GKLeaderboardViewController *leaderboard = [[GKLeaderboardViewController alloc] init];
if (leaderboard != nil)
{
leaderboard.leaderboardDelegate = self;
[[self topViewController] presentViewController:leaderboard animated:YES completion:nil];
}
}else if ([[[UIDevice currentDevice]systemVersion]intValue]>=6)
{
//if it runs on iOS 6 or higher, we use GKGameCenterViewController
GKGameCenterViewController *gameCenterController = [[GKGameCenterViewController alloc] init];
if (gameCenterController != nil)
{
gameCenterController.gameCenterDelegate = self;
gameCenterController.viewState = GKGameCenterViewControllerStateDefault;
[[self topViewController] presentViewController:gameCenterController animated:YES completion:nil];
}
}
}
And don't forget to add :
- (void) gameCenterViewControllerDidFinish:(GKGameCenterViewController *)gameCenterViewController{
[gameCenterViewController dismissViewControllerAnimated:YES completion:nil];
}
Using this function will allow you to show a nice view containing all your leaderboards and achievements.
相关推荐
###排行榜应用 通过学习meteorJS 应用程序托管在meteor.com 帐户密码,帐户用户界面 CRUD 播放器 没有“自动发布”和“不安全”模块
ng-排行榜 这是用角流星制作的流星排行榜的一种实现方式在上查看 这是了解 angular-meteor 与核心流星火焰模板有何不同的一个很好的开始。 出于这个原因,我将 blaze 代码作为控制器中的注释。 我可能会在某个时候写...
OSGi排行榜显示如何将OSGi用作Web服务平台。 使用蓝图,声明式服务,元类型服务,Redis和Apache CXF演示OSGi的各个方面。 Apache Karaf用作OSGi运行时(提供了Jedis的Shell扩展和Karaf的功能)。...
Towards the end of the book, you will polish your game with fun menus, integrate with Apple Game Center for leaderboards and achievements, and then finally, learn how to publish your finished games ...
Now that Apple has introduced the GameKit framework to its iOS SDK, you can integrate Game Center features directly into your iPhone and iPad apps. This concise cookbook shows you how it's done, with ...
GKTapper 是一个ios例子程序,解释了如何使用GameCenter中的 Leaderboards 及 Achivements。
You will learn, in detail, how to use Unity 5 and the programming language C# to make a fully interactive game that keeps track of player progress, Game Center Leaderboards, and Achievements, as well...
Easy Achievements and Leaderboards v1.5.3
VALORANT和游戏中可能使用的排行榜API重要...区域表地区名称地区代码北美不适用欧洲欧盟朝鲜KR 巴西BR 亚太地区美联社拉美拉美入门URL参数将模板URL中的{param}替换为下表中给出的值,请参见下面的示例请求模板网址: ...
unity游戏得分离线排行榜系统源码Offline Leaderboards High Scores 插件资源 直接用 Requires Unity 5.3.5 or higher. Add a local (ie. not online) high score board to your game easily with this pack. It ...
:racing_car: @pmndrs/赛车游戏 现场演示(当前状态): : 这个项目展示了 React 在游戏中的可行性。 每件事都是一个自包含的组件,使用来表达具有 React 语义.../ ui - intros , heads up displays , leaderboards
Game Center * iTunes Setup * Init The Game Center * Leaderboards * Achievements * Changes * Friends * Real-Time Multiplayer * Trun Based Multiplayer In-App purchases (Cons. / Non-Cons.) * ...
Game Center and Game Kit are Apple’s answers to integrating social aspects into iOS games, making it easier than it has ever been before to add items like leaderboards, achievements, multiplayer, ...
You will learn how to build a math test game, a Simon-like memory game, a retro pong-style game, and for the grand finale, a Snake-style, retro arcade game with real Google Play leaderboards and ...
* Init The Game Center * Leaderboards * Achievements * Changes * Friends * Real-Time Multiplayer * Trun Based Multiplayer In-App purchases (Cons. / Non-Cons.) * iTunes Setup * Coding ...
Rankings & Leaderboards 排名和排行榜Unity游戏开发插件资源unitypackage 版本1.0.1 支持Unity版本2020.3.15或更高 排名和排行榜为轻松创建您自己的排行榜实施奠定了基础。功能丰富,具有排序、突出显示当前用户和...
A multi-chapter Game Center case study shows how multiple iOS features can be combined to do even more. All source code may be downloaded at https://github.com/dfsw/icf. Coverage includes: Adding ...
sporty-leaderboards
去创造 curl -X ' POST ' \ ' ... -H ' accept: */* ' \ -H ' Content-Type: application/json ' \ -d ' { "name" : "spring sale" } ' 阅读 curl -X ' GET ' \ ... -H ' accept: */* '
You'll learn how to write clean, easily maintainable, easily expandable game code, and to create online leaderboards for your games. You'll also find out how to make money with games: enabling in-app...