Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package;
- class FGL {
- public function new() {
- }
- /**
- * Displays an advert. The current version of the FGL SDK only
- * supports full-screen takeover or interstitial adverts, therefore
- * there are no options.
- * You should call this method whenever you want to display an
- * advert. Some good times to do this are on the main menu and
- * in between levels.
- */
- public static inline function showAd():Void {
- untyped fgl.showAd();
- }
- /**
- * Displays the "More Games" cross promotional system. This
- * system is a full screen page which contains links to cross
- * promote other games in our network.
- * By implementing the More Games system, you will benefit by
- * receiving free traffic and promotion from other games in our
- * network, which is vital for growth.
- */
- public static inline function showMoreGames():Void {
- untyped fgl.showMoreGames();
- }
- /**
- * Call this method to initiate a payment wall requesting for the
- * game to be unlocked. This function takes advantage of In App
- * Purchase APIs to offer the player a way to pay money for your
- * game to be converted from a free game to a premium game.
- * Calling this function will eventually result in either a call to the
- * onSuccess or a call to the onFailure functions that you pass in.
- * You should not implement any kind of messaging or alerts to
- * the user as the FGL SDK will do that.
- * @param onSuccessCallback
- * @param onFailCallback
- */
- public static inline function initiateUnlockFunction( onSuccessCallback:Void->Void, onFailCallback:Void->Void ):Void {
- untyped fgl.inApp.initiateUnlockFunction( onSuccessCallback, onFailCallback );
- }
- /**
- * This function should be checked frequently because it may
- * change without any form of notification. Whenever there's a
- * chance to display premium content to the player, check to see
- * if the game is unlocked.
- * A good example of this would be when the player reaches the
- * "Level select" screen. If you are selling extra levels as premium
- * content, you should check at this point to see if the game is
- * unlocked and allow the user to select and use the content if the
- * above function returns true.
- * @return Returns true if premium content is available to the player.
- */
- public static inline function getIsPremium():Bool {
- return untyped fgl.isPremium();
- }
- /**
- * You must check this property before displaying or rendering
- * your More Games button.
- * @return true if cross promotion is available on the current platform.
- */
- public static inline function getIsCrossPromotionEnabled():Bool {
- return untyped fgl.crossPromotionEnabled;
- }
- /**
- * You must check this property before displaying or rendering
- * your Unlock or Upgrade button.
- * @return true if the current platform has in app purchases enabled.
- */
- public static inline function getIsUnlockEnabled():Bool {
- return untyped fgl.unlockEnabled;
- }
- /**
- * @return true if you should be displaying publisher branding on your menu.
- */
- public static inline function getIsBrandingEnabled():Bool {
- return untyped fgl.brandingEnabled;
- }
- /**
- * When branding is enabled, this will return a URI or Data URI for
- * the image that needs to be displayed
- * @return src attribute for a DOM <img> tag or a HTML5 Image object
- */
- public static inline function getBrandingLogo():String {
- return untyped fgl.getBrandingLogo();
- }
- /**
- * This function should be called when the branding logo is tapped
- * or clicked by the player.
- */
- public static inline function onBrandingClick():Void {
- untyped fgl.handleBrandingClick();
- }
- /**
- * Submit the score in response to a user pressing a submit button:
- * @param p_value The score
- */
- public static inline function submitScore( p_value:Int ):Void {
- untyped fgl.submitScore( p_value );
- }
- /**
- * Show the scoreboard UI. This happens automatically after submitScore
- */
- public static inline function showScoreboard():Void {
- untyped fgl.displayScoreboard();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement