Book Image

Mastering Android Game Development

By : Raul Portales
Book Image

Mastering Android Game Development

By: Raul Portales

Overview of this book

Table of Contents (18 chapters)
Mastering Android Game Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
API Levels for Android Versions
Index

Opening the Play Games UI


To complete the integration of achievements and leaderboards, we are going to add buttons to open the native UI provided by GPGS to our main menu.

For this, we are going to place two buttons in the bottom–left corner of the screen, opposite the music and sound buttons. We will also check whether we are connected or not; if not, we will show a single sign-in button.

For these buttons we will use the official images of GPGS, which are available for developers to use. Note that you must follow the brand guidelines while using the icons and they must be displayed as they are and not modified. This also provides a consistent look and feel across all the games that support Play Games.

Since we have seen a lot of layouts already, we are not going to include another one that is almost the same as something we already have.

The main menu with the buttons to view achievements and leaderboards.

To handle these new buttons we will, as usual, set the MainMenuFragment as OnClickListener...