• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Smart banner ad (Admob)

A

Ashraf Hamdi

Guest
Hi everyone,
Google play services extension supports only those banner sizes :-
  • GoogleMobileAds_Banner
  • GoogleMobileAds_MRect
  • GoogleMobileAds_Full_Banner
  • GoogleMobileAds_Leaderboard
  • GoogleMobileAds_Skyscraper
but where is the "Smart Banner" ?! it's very important for landscape games and it's suitable for all screen sizes.
please can anyone tell me how to add this banner to my game?
many thanks.
 

Mataca

Member
1- Go to game\extensions\GooglePlayServicesExtension\AndroidSource\Java
Open with notepad++ GooglePlayServicesExtension.java

2- Search:

Code:
case 5: BannerSize = AdSize.WIDE_SKYSCRAPER; break;
add:

Code:
case 6: BannerSize = AdSize.SMART_BANNER; break;
screenshot:



3- Go to game maker, extensions, and add the smart banner



4- Use it:


Code:
GoogleMobileAds_AddBanner("ca-app-pub-XXXXXXXX", 6);
GoogleMobileAds_MoveBanner(display_get_width()/2-GoogleMobileAds_BannerGetWidth()/2, display_get_height()-GoogleMobileAds_BannerGetHeight())
note: This command is for middle bottom banner.
 
A

Ashraf Hamdi

Guest
Many thanks for your great help, i did that but the SmartBanner didn't take the whole screen width (landscape) and i don't know why!
 
y
[QUOTE = "Mataca, publicación: 49825, miembro: 4510"] 1- Ve al juego \ extensiones \ GooglePlayServicesExtension \ AndroidSource \ Java
Abrir con bloc de notas ++ GooglePlayServicesExtension.java

2- Búsqueda:

[código] caso 5: BannerSize = AdSize.WIDE_SKYSCRAPER; romper; [/ code]

añadir:

[código] caso 6: BannerSize = AdSize.SMART_BANNER; romper; [/ code]

captura de pantalla:



3- Vaya al creador de juegos, extensiones y agregue el banner inteligente



4- Úselo:


[código] GoogleMobileAds_AddBanner ("ca-app-pub-XXXXXXXX", 6);
GoogleMobileAds_MoveBanner (display_get_width () / 2-GoogleMobileAds_BannerGetWidth () / 2, display_get_height () - GoogleMobileAds_BannerGetHeight ()) [/ code]

nota: este comando es para la pancarta inferior central. [/CITAR]
y video reward?
 
Top