I am using cocos2d 3.0.
In AppDelegate class I have implemented admob and it works fine, but it is always on the screen. But I want admob to be hidden during the main scene and to appear when it is game over. In AppDelegate.h I have
#import <UIKit/UIKit.h>
#import "cocos2d.h"
#import "GADBannerView.h"
typedef enum _bannerType
{
kBanner_Portrait_Top,
kBanner_Portrait_Bottom,
kBanner_Landscape_Top,
kBanner_Landscape_Bottom,
}CocosBannerType;
#define BANNER_TYPE kBanner_Portrait_Top
@interface AppController : CCAppDelegate
{
CocosBannerType mBannerType;
GADBannerView *mBannerView;
float on_x, on_y, off_x, off_y;
}
-(void)hideBannerView;
-(void)showBannerView;
In MainScene class I've tried to write
mBannerView.hidden = YES;
but it is said that mBannerView is undeclared identifier.
I guess i should somehow use -(void) hideBannerView, but I don't know how.
Could you please tell me what should I do to hide admob on certain scenes.