Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / The iAds doesn't work properly, why?

Author
Message
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 1st Nov 2011 15:38
it always show in portrait form,no matter what api I use. I mean it's always on the left.

I want to rotate it ,and resize it , to make it in the proper position.

my game had finished, I just wanner add iAds on it.

can anyone give me a hand?

give my best
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 1st Nov 2011 15:56
Here's some code I used in iDork to rotate and position iAds:

#define DEG 0.0174532925
#define DEGREES_TO_RADIANS(__ANGLE__) ((__ANGLE__) / 180.0 * M_PI)

adView = [ [ ADBannerView alloc ] initWithFrame: CGRectZero ];

adView.requiredContentSizeIdentifiers = [ NSSet setWithObject:ADBannerContentSizeIdentifier480x32 ];
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier480x32;

CGSize windowSize;

windowSize.width = 480;
windowSize.height = 320;

adView.transform = CGAffineTransformMakeRotation ( DEGREES_TO_RADIANS ( 90 ) );
adView.center = CGPointMake ( adView.frame.size.width / 2, windowSize.width / 2 );

self.adView.delegate = self;

adView.hidden = YES;
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 1st Nov 2011 16:28
Let us know if it works Halley, this would be a very useful piece of code.
Thanks Mike for being so prompt & helpful.
halley
12
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 1st Nov 2011 16:41
it works . I just put the code into my game.

give my best
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 1st Nov 2011 18:18
Will try to test it. thanks guys, hope to see more of this kind of useful code snippets. If we have more of these, we won't bother TGC with new commands!!!!!

Login to post a reply

Server time is: 2024-04-25 12:40:29
Your offset time is: 2024-04-25 12:40:29