Check if the platform supports displaying banner ads. Use this to determine if you can include banner advertisements in your game
bridge.advertisement.is_banner_supported()
Ensure that in-game banners are not displayed during gameplay on CrazyGames. Please refer to .
Show Banner
Display a banner ad within your game to generate revenue through advertising.
local bridge = require("bridge.bridge")
function init(self)
local options = {
vk = {
position = "top",
layoutType = "resize",
canClose = false
},
crazy_games = {
position = "top"
},
game_distribution = {
position = "top"
},
msn = {
position = "top:728x90"
}
}
bridge.advertisement.show_banner(options)
end
Hide Banner
Hide the currently displayed banner ad when it is no longer needed.
bridge.advertisement.hide_banner()
Banner State
Monitor the state of the banner ad to manage its display and troubleshoot issues.
bridge.advertisement.banner_state()
local bridge = require("bridge.bridge")
function init(self)
bridge.advertisement.on("banner_state_changed", function (_, state)
print("Banner state changed: ", state)
end)
end