Methods
Intermission extends Node.
Every method returns at once.
Answers arrive as signals.
Set up
Section titled “Set up”available
Section titled “available”func available() -> boolTrue when the Android plugin is in this build.
False in the editor, on other platforms, and in an Android build without the plugin.
When it is false, every request fails with AdError.NOT_AVAILABLE on the next frame.
initialize
Section titled “initialize”func initialize(app_key: String, test_mode: bool = false) -> voidStarts LevelPlay with your app key.
Answers with initialized.
In test mode every ad comes from LevelPlay’s demo app, and app_key may be empty. See Test mode.
Calling it again after it succeeded answers initialized(true) again, and after a failure it tries again.
is_initialized
Section titled “is_initialized”func is_initialized() -> boolTrue once initialize has succeeded.
is_test_mode
Section titled “is_test_mode”func is_test_mode() -> boolTrue when the plugin was initialized in test mode.
sdk_version
Section titled “sdk_version”func sdk_version() -> StringLevelPlay’s version, such as "9.8.0", or empty when available() is false.
Privacy
Section titled “Privacy”Call these before initialize, and again whenever the player changes their choice. See Consent.
set_gdpr_consent
Section titled “set_gdpr_consent”func set_gdpr_consent(granted: bool) -> voidConsent for personalised ads where the GDPR applies.
set_us_privacy_opt_out
Section titled “set_us_privacy_opt_out”func set_us_privacy_opt_out(opted_out: bool) -> voidA US player’s choice not to have their data sold or shared.
set_child_directed
Section titled “set_child_directed”func set_child_directed(child: bool) -> voidFor apps, or players, directed at children.
Full-screen ads
Section titled “Full-screen ads”See Full-screen ads.
load_ad
Section titled “load_ad”func load_ad(format: Format, ad_unit_id: String) -> voidLoads one interstitial (Format.INTERSTITIAL) or rewarded (Format.REWARDED) ad for the ad unit.
Answers with ad_loaded or ad_failed_to_load.
A load asked for before initialize has finished waits for it.
is_ad_ready
Section titled “is_ad_ready”func is_ad_ready(ad_unit_id: String) -> boolTrue when an ad is loaded for the ad unit and not yet shown.
show_ad
Section titled “show_ad”func show_ad(ad_unit_id: String, placement: String = "") -> voidShows the ad loaded for the ad unit.
Answers with ad_shown or ad_failed_to_show, then ad_closed.
placement names the moment in LevelPlay’s reports, and may be empty.
Banners
Section titled “Banners”See Banners.
load_banner
Section titled “load_banner”func load_banner(ad_unit_id: String, size: BannerSize = BannerSize.BANNER, placement: String = "") -> voidLoads a banner, hidden until show_banner.
Loading another replaces it.
Answers with banner_loaded or banner_failed_to_load, and banner_loaded again after every refresh.
show_banner
Section titled “show_banner”func show_banner(anchor: Anchor = Anchor.BOTTOM, margin_dp: float = 0.0) -> voidShows the banner centred at the top or the bottom of the screen, margin_dp in from that edge.
hide_banner
Section titled “hide_banner”func hide_banner() -> voidHides the banner. A hidden banner does not refresh.
destroy_banner
Section titled “destroy_banner”func destroy_banner() -> voidRemoves the banner.
Diagnostics
Section titled “Diagnostics”set_overlong_seconds
Section titled “set_overlong_seconds”func set_overlong_seconds(seconds: float) -> voidTurns on ad_overlong for full-screen ads still up after seconds.
Off (0) by default. See Misbehaving ads.
open_test_suite
Section titled “open_test_suite”func open_test_suite() -> voidOpens LevelPlay’s Integration Test Suite, in a debug build or in test mode, once initialized. Elsewhere it does nothing. See Test mode.
Intermission is an open source Godot plugin under the MIT licence, one of the toolsmade by Chaosmos. It is not sponsored by or affiliated with Unity Technologies or the Godot Foundation.