Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

GameCenter

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

Import Statement: import Felgo 4.0
Inherits:

PluginItem

Properties

Signals

Methods

Detailed Description

GameCenter plugin is a perfect extension to Felgo Game Network. You can configure Felgo Game Network to automatically synchronize 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.

Note: The corresponding handler is onAchievementReported.

See also reportAchievement().


achievementsReset(bool success)

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

Note: The corresponding handler is onAchievementsReset.

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.

Note: The corresponding handler is onScoreReported.

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 explicitly.

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.


Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded