lavalevel

Ad code

Dec 5th, 2014
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.31 KB | None | 0 0
  1.     local this = {}
  2.      
  3.     local platformName = system.getInfo("platformName")
  4.     local x, y = display.contentWidth * 0.5 - 160, platformName == "Android" and display.screenTop or 0
  5.      
  6.     local function onAd(event)
  7.         if event.isError then end
  8.     end
  9.      
  10.     function this.hide()
  11.         ads.hide()
  12.     end
  13.      
  14.     function this.show()
  15.         --if platformName == "Android" then ads.show("banner", "Bubblex", {x = x, y = y, w = 320, h = 50, timeout = 5}) -- use auto refresh for AdMob
  16.         --else
  17.  
  18.         ads.show("banner", {x = x, y = y}) -- end
  19.     end
  20.      
  21.     function this.initialize(group)
  22.         local ad = display.newRect(group, _w * .5 , 0 + 25, 320, 50)
  23.         ad:setFillColor(0.5)
  24.         local slatebit = display.newText({parent = group, text = "Slatebit Studios", x = display.contentCenterX + 3, y = display.screenTop + 29, font = "Bitmap", fontSize = 36})
  25.         slatebit:addEventListener("tap", function() system.openURL("http://www.slatebit.com/") end)
  26.      
  27.        -- if platformName == "Android" then ads.init("crossinstall", "####", onAd) -- use AdMob
  28.        -- else
  29.  
  30.         ads.init("iads", "com.lavalevel.pixelcamera", onAd) -- end
  31.         this.show()
  32.         timer.performWithDelay(30000, this.show, 0) -- make only for iAd
  33.     end
  34.      
  35.     return this
Advertisement
Add Comment
Please, Sign In to add comment