LibGDX:如何实施Google Play游戏服务? [英] LibGDX: How to Implement Google Play Game Services?

查看:132
本文介绍了LibGDX:如何实施Google Play游戏服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我检查了[ https: //github.com/libgdx/libgdx/wiki/Google-Play-Games-Services-in-LibGDX][1] ,但该教程要求我从此处导入BaseGameUtils:[

I checked [https://github.com/libgdx/libgdx/wiki/Google-Play-Games-Services-in-LibGDX][1] but that tutorial requiers me to import BaseGameUtils from here: [https://github.com/playgameservices/android-basic-samples][2] but it seems that the BaseGameUtils was removed. How can I go about with the implementation of GooglePlay Game services?

推荐答案

我最近刚刚在我的libgdx项目之一中实现了Google Play游戏.不要看过libgdx教程,因为它们已经过时了.您不需要libgdx特定的扩展名.可以在以下示例项目中找到未弃用的现代Google Play游戏服务代码:

I recently just implemented Google Play Games into one of my libgdx projects. Don't look at libgdx tutorials as they are outdated. You don't need a libgdx specific extension. Non deprecated modern Google Play Game services code can be found on the example projects here:

https://github.com/playgameservices/android-basic-samples

将整个软件库下载到您的计算机上,加载到android studio中,然后播放代码.大部分内容都可以简单地复制并粘贴以满足您的需求.对我来说真的很好.

Download the whole repo to your computer, load into android studio, and play around with the code. Most of it can be simply copy and pasted to fit your needs. Worked really well for me.

我使用的一般方法是将代码写入项目的android部分,然后使用接口将其绑定到我的核心libgdx代码中.参考这篇文章(第二个答案,而不是第一个答案):

The general approach I used was to write the code into the android portion of my project and then tie it into my core libgdx code using interfaces. Reference this post (the second answer, not first):

libGDX警报对话框

即使您不打算像上面的文章中所示显示警报对话框,也可以通过遵循这种技术使核心libgdx项目做android特定的事情

even if you aren't planning on displaying alert dialogs as shown in the above post, you can make your core libgdx project do android specific things by following this technique

这篇关于LibGDX:如何实施Google Play游戏服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆