-AAG- Posted October 21, 2013 Share Posted October 21, 2013 I made a modification to my ads code and I will be very appreciative if some of you could give it a try. What I'm trying to achieve is a persistent banner at the bottom of the game that refreshes from time to time. I am especially interested on the banner not showing at all on i-devices of low resolution because it ends up on the way of game elements. So it should be hidden on anything i-device 4 or 4th generation. I tried to keep 5 and 5th gen in and the ipads of course. The banner should also be of varying sizes depending on the device. This are leadbolt ads and will only work on mobile devices. Please give it a test and let me know your results on what device. I'll be happy to help you in anyway I can. Test:http://gamesaag.net/boxedlb/boxed_index.html Thanks in advance! Quote Link to comment Share on other sites More sharing options...
AhmedElyamani Posted October 21, 2013 Share Posted October 21, 2013 Just tested on my 4th generation iPod, The game ran very slow at start, but a few moments later it ran perfectly smooth, the graphics were drawn nicely and I couldn't spot any bug. However I did not see any Ads. Quote Link to comment Share on other sites More sharing options...
-AAG- Posted October 21, 2013 Author Share Posted October 21, 2013 Great! If you didn't see any ads on 4th gen then is working perfectly. Maybe the slowness at the beginning is because of the ads initializing and then closing. Thank you very much! Quote Link to comment Share on other sites More sharing options...
IndieDevAustin Posted October 21, 2013 Share Posted October 21, 2013 Worked perfectly on my iPhone 4S in Chrome. No ads shown. Quote Link to comment Share on other sites More sharing options...
-AAG- Posted October 21, 2013 Author Share Posted October 21, 2013 Ads should show on chrome. That was weird.I will double check my code again. Thanks for testing. Quote Link to comment Share on other sites More sharing options...
IndieDevAustin Posted October 22, 2013 Share Posted October 22, 2013 I sent you a message. I saw no ads in Chrome or Safari on my iPhone 4S with iOS7. The bottom portion of your screen seems to be cut off in Safari, but not Chrome. Quote Link to comment Share on other sites More sharing options...
-AAG- Posted October 22, 2013 Author Share Posted October 22, 2013 It is normal for the bottom portion to be cut off. That is because of the way the scaling works. That is why I want no ads to be shown on safari since they will be on top of the tool bar and on the way of game elements. The way i am trying to do it is, after initializing the ads check for ios and safari and then hide the ads if true. This is what my code looks like: if(os_type == os_ios && browser_height <=960) { if(os_browser==browser_safari || os_browser==browser_safari_mobile) { leadbolt_hide_banner(); }}Why is that not working? Maybe this functions are not meant for what I am using them? Quote Link to comment Share on other sites More sharing options...
NokFrt Posted October 22, 2013 Share Posted October 22, 2013 I think you do it wrong. 1. browser_height does not return 960 on iPod/iPhone 4g as you expect because of DPI.2. You should not check type of os or browser because this is completely irrelevant. As I told you before. You should calculate height of your game graphic and than check if the banner Y is lower or higher. If it is lower you can hide it or move it. You know this:1. height of your internal resolution - it's 480 pixels (GAME_RES_HEIGHT)2. height of your game elements - it's somethink like 416 (GAME_ELEMENTS_HEIGHT)3. Y position of the banner (bannerY)4. height of your output resolution - I think you can use room_height for that - this depends on how your scaling method works. I don't have your source code anymore, look how I calculate the Y position of the banner, something like: bannerY = XXX - bannerH; (XXX is height of your output resolution) so now you can do something like this: var isBannerHidden = false; if (output_height < GAME_RES_HEIGHT) { // You never use smaller output resolution than 480 - at least I think so isBannerHidden = true; } else { var scale = output_height / internal_height; if (GAME_ELEMENTS * scale > bannerY) isBannerHidden = true; } if (isBannerHidden) leadbotl_hide_banner(); Quote Link to comment Share on other sites More sharing options...
-AAG- Posted October 23, 2013 Author Share Posted October 23, 2013 Looks great in portrait on my iPhone 5S...but when you turn the phone to the side the ad is placed badly. That's awesome! I know the ad will be in the way on landscape, but that's just covering a message to turn the device. Maybe I can hide the banner while on landscape too but I really don't care enough to trouble myself with it. I could also change the graphic of my message to be a long banner and place it near the top so the banner wont cover it. Thanks for testing. You should calculate height of your game graphic and than check if the banner Y is lower or higher. If it is lower you can hide it or move it. Yeah, I was just trying the easy way out like always. i will try to implement this. Thanks for coming all the way here to help me, i really didn't want to bother you with another email I will post a new version soon. Quote Link to comment Share on other sites More sharing options...
plicatibu Posted October 30, 2013 Share Posted October 30, 2013 It worked nice into my Motorola Razor I XT890. Quote Link to comment Share on other sites More sharing options...
-AAG- Posted October 31, 2013 Author Share Posted October 31, 2013 Yes, thanks to NokFrt who customized my ads code it is now super awesome. I get to show a persistent ad on the bottom of my game whenever there is enough room for it + I can manually place them on key points without affecting the persistent ones. It was a lot of work (for him) but they work out beautifully now. Quote Link to comment Share on other sites More sharing options...
plicatibu Posted November 1, 2013 Share Posted November 1, 2013 -AAG- would you mind sharing the code? Thank you. Quote Link to comment Share on other sites More sharing options...
-AAG- Posted November 1, 2013 Author Share Posted November 1, 2013 It is not my code. Please contact NokFrt for more details. Quote Link to comment Share on other sites More sharing options...
plicatibu Posted November 1, 2013 Share Posted November 1, 2013 NokFrt, would you mind sharing your code with us? Regards. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.