iOS
Android
Unity
REST Api
BDArenaConsoleController

Availability : ver 1.0 and later

Declared in : BDArenaConsoleController.h

Overview

The BDArenaConsoleController class is the main interface for accessing a prebuilt view controller

through which the local player can manage his profile information, register a new player account,

access the list of available leaderboards and achievements.

 

The BDArenaConsoleController object is a singleton and has only one instance in the application.

In order to get the unique instance of the BDArenaConsoleController object, the developer

must call the class method getInstance.

 

In order to show the BDArenaConsoleController interface, the developer must call the 

presentConsoleWithBaseViewController: method. The SDK, through this method,

determines if the device which is running the application is a tablet or a smartphone and,

based on this information, shows the view controller in the correct manner.

 

 

IMPORTANT

If the developer is planning to build a LANDSCAPE ONLY application, he will need to keep in mind that the BDArenaConsoleController implements an UIImagePickerController that needs that the Portrait orientation is supported by the application.

There are several ways to achieve that goal, one of which is to enable Portrait orientation for the application and override supportedInterfaceOrientations method within the UIViewControllers that are needed to be landscape only :

- (NSUInteger) supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskLandscape;
}

For different solutions, just try googling for 
'UIImagePickerController in landscape only application'

 

 

 

The BDArenaConsoleController class is a subclass of UITabBarController and can be configured
for showing the following sections :

 

MeSection

An UIViewController through which the local player can register a new account or

update his existing profile information.

 

LeaderboardsSection

An UIViewController that shows the list of available leaderboards and the scores list

associated with each one of them.

 

AchievementsSection 

An UIViewController that shows the list of available achievements and, related to the local player,

the completion value for each one of them.

 

The different sections can be activated setting showMeSection, showLeaderboardsSection

and showAchievementsSection properties of BDArenaConsoleController object.

 

If none of these properties is set to YES, only the MeSection is displayed.

 

The following code is what the developer needs to implement in order to show

the console to the local player :

 

   ...

    

    BDArenaConsoleController* arenaConsole = [BDArenaConsoleController getInstance];

 

    // show all sections

    arenaConsole.showMeSection = YES;

    arenaConsole.showLeaderboardsSection = YES;

    arenaConsole.showAchievementsSection = YES;

 

    // present console controller (self represents the current viewController)

    [arenaConsole presentConsoleWithBaseViewController:self];

 

    ...

 

 

 

With the above configuration, the console will look like the image that follows :

 

ios_console_1

Through all the available properties of the BDArenaConsoleController class, the developer

can easily customize the appearance of the console to smoothly fit his own application.

 

This kind of customization is provided by the SDK with the main goal to offer to the developers

a fast and easy way to integrate the Arena Daemon's features with a few lines of code.

 

The following code snippet, given three background images, shows how to set up the console

with a full UI customization :

 

   ...

    

    BDArenaConsoleController* arenaConsole  = [BDArenaConsoleController getInstance];

 

    arenaConsole.showMeSection                  = YES;

    arenaConsole.showLeaderboardsSection    = YES;

    arenaConsole.showAchievementsSection    = YES;

 

    arenaConsole.baseColor                      = [UIColor darkGrayColor];

    arenaConsole.textColor                       = [UIColor whiteColor];

    arenaConsole.textFieldFontColor           = [UIColor greenColor];

    arenaConsole.buttonColor                    = [UIColor darkGrayColor];

    arenaConsole.buttonTextColor              = [UIColor greenColor];

    arenaConsole.popoverColor                 = [UIColor greenColor];

    arenaConsole.avatarImageBorderColor  = [UIColor darkGrayColor];

    arenaConsole.privacyPolicyTextColor    = [UIColoryellowColor];

    arenaConsole.fontNameNormal            = @"Optima-Regular";

    arenaConsole.fontNameBold                = @"Optima-Bold";

    arenaConsole.fontSize                        = 15;

 

    arenaConsole.meBackgroundImage                 = [UIImage imageNamed:@"bg1.jpg"];

    arenaConsole.leaderboardsBackgroundImage    = [UIImageimageNamed:@"bg2.jpg"];

    arenaConsole.achievementsBackgroundImage   = [UIImageimageNamed:@"bg3.jpg"];

 

    [arenaConsole presentConsoleWithBaseViewController:self];

 

    ...

 

 

 

The console will look like the image that follows :

 

ios_console_2

The developer can always choose to present to the players a customized version of BDArenaConsoleController instance or programmatically recreate each section through the methods provided by BDArenaConnector object.

 

Properties

The console controller can be customized by the developer through the properties the class exposes. The following picture shows some of the customizable elements and what is the correspondent property name within the BDArenaConsoleController class.

 

console_ui_elements 

Showing sections

showMeSection

showLeaderboardsSection

showAchievementsSection

 

Customizing fonts, text colors and strings

baseColor

buttonColor

avatarImageBorderColor

buttonTextColor

textColor

privacyPolicyTextColor

textFieldFontColor

textFieldBorderColor

achievementsPercentageRingColor

fontNameNormal

fontNameBold

fontSize

popoverColor

leaderboardsStringForPoint

leaderboardsStringForPoints

 

Setting background images

meBackgroundImage

leaderboardsBackgroundImage

achievementsBackgroundImage

loginLogoutButtonImage

editRegisterButtonImage

editSaveButtonImage

editCancelButtonImage

passwordEditChangeButtonImage

ageButtonImage

genderSwitchBaseImage

genderSwitchHandleImage

 

Customizing tabBar

meTabbarIconSelectedImage

meTabbarIconUnselectedImage

leaderboardsTabbarIconSelectedImage

leaderboardsTabbarIconUnselectedImage

achievementsTabbarIconSelectedImage

achievementsTabbarIconUnselectedImage

meTabbarSelectedTextColor

meTabbarUnselectedTextColor

leaderboardsTabbarSelectedTextColor

leaderboardsTabbarUnselectedTextColor

achievementsTabbarSelectedTextColor

achievementsTabbarUnselectedTextColor

 

Managing native components in iOS7 and later

prefersTranslucentBars

prefersStatusBarHidden

preferredStatusBarStyle

 

Managing interface orientation

preferredInterfaceOrientationMask

 

Showing and hiding close button

showCloseButton

 

Setting delegate

consoleDelegate

 

 


 

 

 

showMeSection

 

Shows Me tab in the console controller.

 

@property (nonatomicassignBOOL showMeSection;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

showLeaderboardsSection

 

Shows Leaderboard tab in the console controller.

 

@property (nonatomicassignBOOL showLeaderboardsSection;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

showAchievementsSection

 

Shows Achievements tab in the console controller.

 

@property (nonatomicassignBOOL showAchievementsSection;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

baseColor

 

@property (nonatomicretainUIColor* baseColor;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

buttonColor

 

@property (nonatomicretainUIColor* buttonColor;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

avatarImageBorderColor

 

@property (nonatomicretainUIColor* avatarImageBorderColor;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

buttonTextColor

 

@property (nonatomicretainUIColor* buttonTextColor;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

textColor

 

@property (nonatomicretainUIColor* textColor;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

privacyPolicyTextColor

 

@property (nonatomicretainUIColor* privacyPolicyTextColor;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

textFieldFontColor

 

@property (nonatomicretainUIColor* textFieldFontColor;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

textFieldBorderColor

 

@property (nonatomicretainUIColor* textFieldBorderColor;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

achievementsPercentageRingColor

 

@property (nonatomicretainUIColor* achievementsPercentageRingColor;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

fontNameNormal

 

@property (nonatomicretainNSString* fontNameNormal;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

fontNameBold

 

@property (nonatomicretainNSString* fontNameBold;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

fontSize

 

@property (nonatomicassignCGFloat fontSize;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

popoverColor

 

@property (nonatomicretainUIColor* popoverColor;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

leaderboardsStringForPoint

 

@property (nonatomic, retain) NSString*   leaderboardsStringForPoint;

 

Discussion

This property overwrite the 'point' string appended to the score of the players

listed in the leaderboards section of the controller.
To make this property active, the developer needs to set

also the property leaderboardsStringForPoints.

 

Availability

available in SDK ver 2.8.4 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

leaderboardsStringForPoints

 

@property (nonatomic, retain) NSString*   leaderboardsStringForPoints;

 

Discussion

This property overwrite the 'points' string appended to the score of the players

listed in the leaderboards section of the controller.
To make this property active, the developer needs to set

also the property leaderboardsStringForPoint.

 

Availability

available in SDK ver 2.8.4 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

meBackgroundImage

 

@property (nonatomic, retain) UIImage* meBackgroundImage; 

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

leaderboardsBackgroundImage

 

@property (nonatomicretainUIImage* leaderboardsBackgroundImage;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

achievementsBackgroundImage

 

@property (nonatomicretainUIImage* achievementsBackgroundImage;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

loginLogoutButtonImage

 

@property (nonatomic, retain) UIImage*  loginLogoutButtonImage;

 

Recommended image size

200x40 pixels

 

Availability

available in SDK ver 1.9 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

editRegisterButtonImage

 

@property (nonatomic, retain) UIImage*  editRegisterButtonImage;

 

Recommended image size

200x40 pixels

 

Availability

available in SDK ver 1.9 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

editSaveButtonImage

 

@property (nonatomic, retain) UIImage*  editSaveButtonImage;

 

Recommended image size

200x40 pixels

 

Availability

available in SDK ver 1.9 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

editCancelButtonImage

 

@property (nonatomic, retain) UIImage*  editCancelButtonImage;

 

Recommended image size

200x40 pixels

 

Availability

available in SDK ver 1.9 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

passwordEditChangeButtonImage

 

@property (nonatomic, retain) UIImage*  passwordEditChangeButtonImage;

 

Recommended image size

155x30 pixels

 

Availability

available in SDK ver 1.9 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

ageButtonImage

 

@property (nonatomic, retain) UIImage*  ageButtonImage;

 

Recommended image size

80x30 pixels

 

Availability

available in SDK ver 1.9 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

genderSwitchBaseImage

 

@property (nonatomic, retain) UIImage*  genderSwitchBaseImage;

 

Recommended image size

80x30 pixels

 

Availability

available in SDK ver 1.9 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

genderSwitchHandleImage

 

@property (nonatomic, retain) UIImage*  genderSwitchHandleImage;

 

Recommended image size

30x30 pixels

 

Availability

available in SDK ver 1.9 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

meTabbarIconSelectedImage

 

@property (nonatomicretainUIImage* meTabbarIconSelectedImage;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

meTabbarIconUnselectedImage

 

@property (nonatomicretainUIImage* meTabbarIconUnselectedImage;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

leaderboardsTabbarIconSelectedImage

 

@property (nonatomicretainUIImage* leaderboardsTabbarIconSelectedImage;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

leaderboardsTabbarIconUnselectedImage

 

@property (nonatomicretainUIImage* leaderboardsTabbarIconUnselectedImage;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

achievementsTabbarIconSelectedImage

 

@property (nonatomicretainUIImage* achievementsTabbarIconSelectedImage;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

achievementsTabbarIconUnselectedImage

 

@property (nonatomicretainUIImage* achievementsTabbarIconUnselectedImage;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

meTabbarSelectedTextColor

 

@property (nonatomicretainUIColor* meTabbarSelectedTextColor;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

meTabbarUnselectedTextColor

 

@property (nonatomic, retain) UIColor* meTabbarUnselectedTextColor;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

leaderboardsTabbarSelectedTextColor

 

@property (nonatomic, retain) UIColor* leaderboardsTabbarSelectedTextColor;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

leaderboardsTabbarUnselectedTextColor

 

@property (nonatomic, retain) UIColor* leaderboardsTabbarUnselectedTextColor;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

achievementsTabbarSelectedTextColor

 

@property (nonatomic, retain) UIColor* achievementsTabbarSelectedTextColor;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

achievementsTabbarUnselectedTextColor

 

@property (nonatomic, retain) UIColor* achievementsTabbarUnselectedTextColor;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

prefersTranslucentBars

 

@property (nonatomicassignBOOL prefersTranslucentBars;

 

Availability

available in SDK ver 1.0 and later.

 

Discussion

This property, for iOS 7 and later systems, sets the preference about the behaviour

of the translucency for the bars used within the console controller.

 

Declared in

BDArenaConsoleController.h

 

 

 

prefersStatusBarHidden

 

@property (nonatomicassignBOOL prefersStatusBarHidden;

 

Availability

available in SDK ver 1.0 and later.

 

Discussion

This property, for iOS 7 and later systems, hides or shows the status bar

when the console controller is displayed.

This property takes effect only if UIViewControllerBasedStatusBarAppearance key

in the app’s Info.plist has the value set to YES.

 

Declared in

BDArenaConsoleController.h

 

 

 

preferredStatusBarStyle

 

@property (nonatomicassignUIStatusBarStyle preferredStatusBarStyle;

 

Availability

available in SDK ver 1.0 and later.

 

Discussion

This property, for iOS 7 and later systems, sets the status bar style when

the console controller is displayed.

 

Declared in

BDArenaConsoleController.h

 

 

preferredInterfaceOrientationMask

 

@property (nonatomic, assign) UIInterfaceOrientationMask preferredInterfaceOrientationMask;

 

Availability

available in SDK ver 2.3 and later.

 

Discussion

This property, for iOS 7 and later systems, sets the interface orientation mask

for the console controller.

 

Declared in

BDArenaConsoleController.h

 

 

 

showCloseButton

 

@property (nonatomicassignBOOL  showCloseButton;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

 

 

 

consoleDelegate

 

Sets the delegate for events notification.

 

@property (nonatomicassignid <BDArenaConsoleControllerDelegate> consoleDelegate;

 

Availability

available in SDK ver 1.0 and later.

 

Declared in

BDArenaConsoleController.h

Methods

Presenting controller

+ getInstance

+ hasInstance

- presentConsoleWithBaseViewController:

- dismissConsoleController

 

 


  

 

 

getInstance

 

Returns the unique instance of the BDArenaConsoleController object.

 

+ (BDArenaConsoleController*) getInstance;

 

Return value

The unique BDArenaConsoleController instance.

 

Discussion

The unique instance of the BDArenaConsoleController object is created by the initialization of the BDArenaConnector object through the call to initializeWithAppKey:runInSandbox method.

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaConsoleController.h

 

 

 

hasInstance

 

Checks the existence of a BDArenaConsoleController object instance.

 

+ (BOOL) hasInstance;

 

Return value

YES if a valid instance of BDArenaConsoleController exists or NO if it does not. 

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaConsoleController.h

 

 

 

presentConsoleWithBaseViewController:

 

Returns the unique instance of the BDArenaConsoleController object.

 

- (void) presentConsoleWithBaseViewController:(UIViewController*)parentController;

 

Parameters

parentController

    The view controller that will present the BDArenaConsoleController interface to the local player.

 

Discussion

The SDK internally determines the type of device that is running the application (tablet or smartphone)

and performs the correct steps for the presentation.

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaConsoleController.h

 

 

 

dismissConsoleController

 

Dismisses the previously shown BDArenaConsoleController object.

 

- (void) dismissConsoleController;

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaConsoleController.h