Advertisement
Guest User

Untitled

a guest
Jan 12th, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Haxe 4.01 KB | None | 0 0
  1. package;
  2.  
  3. class FGL {
  4.  
  5.     public function new() {
  6.        
  7.     }
  8.    
  9.     /**
  10.      * Displays an advert. The current version of the FGL SDK only
  11.      * supports full-screen takeover or interstitial adverts, therefore
  12.      * there are no options.
  13.      * You should call this method whenever you want to display an
  14.      * advert. Some good times to do this are on the main menu and
  15.      * in between levels.
  16.      */
  17.     public static inline function showAd():Void {
  18.         untyped fgl.showAd();
  19.     }
  20.     /**
  21.      * Displays the "More Games" cross promotional system. This
  22.      * system is a full screen page which contains links to cross
  23.      * promote other games in our network.
  24.      * By implementing the More Games system, you will benefit by
  25.      * receiving free traffic and promotion from other games in our
  26.      * network, which is vital for growth.
  27.      */
  28.     public static inline function showMoreGames():Void {
  29.         untyped fgl.showMoreGames();
  30.     }
  31.     /**
  32.      * Call this method to initiate a payment wall requesting for the
  33.      * game to be unlocked. This function takes advantage of In App
  34.      * Purchase APIs to offer the player a way to pay money for your
  35.      * game to be converted from a free game to a premium game.
  36.      * Calling this function will eventually result in either a call to the
  37.      * onSuccess or a call to the onFailure functions that you pass in.
  38.      * You should not implement any kind of messaging or alerts to
  39.      * the user as the FGL SDK will do that.
  40.      * @param onSuccessCallback
  41.      * @param onFailCallback
  42.      */
  43.     public static inline function initiateUnlockFunction( onSuccessCallback:Void->Void, onFailCallback:Void->Void ):Void {
  44.         untyped fgl.inApp.initiateUnlockFunction( onSuccessCallback, onFailCallback );
  45.     }
  46.     /**
  47.      * This function should be checked frequently because it may
  48.      * change without any form of notification. Whenever there's a
  49.      * chance to display premium content to the player, check to see
  50.      * if the game is unlocked.
  51.      * A good example of this would be when the player reaches the
  52.      * "Level select" screen. If you are selling extra levels as premium
  53.      * content, you should check at this point to see if the game is
  54.      * unlocked and allow the user to select and use the content if the
  55.      * above function returns true.
  56.      * @return Returns true if premium content is available to the player.
  57.      */
  58.     public static inline function getIsPremium():Bool {
  59.         return untyped fgl.isPremium();
  60.     }
  61.     /**
  62.      * You must check this property before displaying or rendering
  63.      * your More Games button.
  64.      * @return true if cross promotion is available on the current platform.
  65.      */
  66.     public static inline function getIsCrossPromotionEnabled():Bool {
  67.         return untyped fgl.crossPromotionEnabled;
  68.     }
  69.     /**
  70.      * You must check this property before displaying or rendering
  71.      * your Unlock or Upgrade button.
  72.      * @return true if the current platform has in app purchases enabled.
  73.      */
  74.     public static inline function getIsUnlockEnabled():Bool {
  75.         return untyped fgl.unlockEnabled;
  76.     }
  77.     /**
  78.      * @return true if you should be displaying publisher branding on your menu.
  79.      */
  80.     public static inline function getIsBrandingEnabled():Bool {
  81.         return untyped fgl.brandingEnabled;
  82.     }
  83.     /**
  84.      * When branding is enabled, this will return a URI or Data URI for
  85.      * the image that needs to be displayed
  86.      * @return src attribute for a DOM <img> tag or a HTML5 Image object
  87.      */
  88.     public static inline function getBrandingLogo():String {
  89.         return untyped fgl.getBrandingLogo();
  90.     }
  91.     /**
  92.      * This function should be called when the branding logo is tapped
  93.      * or clicked by the player.
  94.      */
  95.     public static inline function onBrandingClick():Void {
  96.         untyped fgl.handleBrandingClick();
  97.     }
  98.     /**
  99.      * Submit the score in response to a user pressing a submit button:
  100.      * @param p_value The score
  101.      */
  102.     public static inline function submitScore( p_value:Int ):Void {
  103.         untyped fgl.submitScore( p_value );
  104.     }
  105.     /**
  106.      * Show the scoreboard UI. This happens automatically after submitScore
  107.      */
  108.     public static inline function showScoreboard():Void {
  109.         untyped fgl.displayScoreboard();
  110.     }
  111.    
  112. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement