GameCenter

Integrate with GameCenter to send your games' highscores from V-Play Game Network to Apple Game Center on iOS devices. More...

Import Statement: import VPlayPlugins 1.0
Inherits:

PluginItem

Properties

Signals

Methods

Detailed Description

GameCenter plugin is a perfect extension to V-Play Game Network. You can configure V-Play Game Network to automatically syncrhonize new user highscores to Apple Game Center.

Property Documentation

authenticated : bool

This property indicates if the local player is authenticated with Game Center. You should not call other GameCenter related methods if this property is false, so it is a good practice to bind the property to other elements dealing with GameCenter, e.g. hide a button if the player is not authenticated:

 SimpleButton {
   text: "Highscores"

   visible: gameCenter.authenticated
   onClicked: gameCenter.showLeaderboard();
 }

Signal Documentation

achievementReported(bool success)

This handler is called after an achievement was reported to GameCenter. The success property indicates if it was successful. In normal you however don't need to take further actions in case of a failure because the plugin keeps track of achievements and synchronizes them as soon as it is possible again.

See also reportAchievement().


achievementsReset(bool success)

This handler is called after the achievements were resest for the authenticated player. The success property indicates if it was successful.

See also resetAchievements().


scoreReported(bool success)

This handler is called after a score was reported to GameCenter. The success property indicates if it was successful. In normal you however don't need to take further actions in case of a failure because the plugin keeps track of scores and synchronizes them as soon as it is possible again.

See also reportScore().


Method Documentation

authenticateLocalPlayer()

Call this function to authenticate the player with Game Center. Usually you do this as soon as your GameWindow item is loaded:

 GameWindow {
   GameCenter {
     id: gameCenter

     onAuthenticatedChanged: console.log("Authenticated:", authenticated);
   }

   Component.onCompleted: gameCenter.authenticateLocalPlayer();
 }

reportAchievement(string identifier, real percentageComplete, bool bannerVisible)

Call this function to send a new achievement with the specific to Game Center. The parameters percentageComplete (default value is 100) and bannerVisible (default value is false) are optional. The bannerVisible parameter specifies if you want to display an iOS native banner notification to the user after an achievement was unlocked or not.

See also achievementReported.


reportScore(int score, string identifier)

Call this function to send a new highscore to Game Center with identifier as the leaderboard identifier. The score currently only supports integer values. The identifier is optional, if it is omitted the score gets posted to the default leaderboard according to your iTunes Connect settings.

See also scoreReported.


resetAchievements()

Call this function to reset all gained achievements for the current user. This is useful for testing purposes or in your game if your player wants to reset his achievements explicetly.

See also achievementsReset.


showAchievements()

Call this function to display the current player's achievements as native modal view.


showLeaderboard(string identifier)

Call this function to display a specific leaderboard as native modal view. The identifier property is optional, if the identifier is omitted an overview screen of all available leaderboards is shown.


Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support