# Banner

Banners are persistent ads pinned to the top or bottom of the screen. Use them on **idle screens** — main menu, lobby, pause overlay — and hide them during active gameplay.

### When to use

* You have a stable UI region where a banner won't overlap with controls.
* You want medium-tier passive monetization without interrupting the player.
* For more flexible placements (multiple banners, custom positions, responsive layouts) use [Advanced Banners](/playgama/sdk/api/advertisement/advanced-banners.md) instead.

#### Is Banner Supported <a href="#is-banner-supported" id="is-banner-supported"></a>

Check this before reserving screen space or showing banner UI. Hide banner areas on platforms that do not support banners.

{% tabs %}
{% tab title="Plain JS" %}

```javascript
bridge.advertisement.isBannerSupported
```

{% endtab %}

{% tab title="Unity" %}

```csharp
// Possible values: true, false
Bridge.advertisement.isBannerSupported
```

{% endtab %}

{% tab title="Construct 3" %}

<figure><img src="/files/s3g5zovwZIYfqplE2Dej" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="GDevelop" %}

<figure><img src="/files/f3Lyfm3AMg9HO40eW1wS" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Godot" %}

```gdscript
Bridge.advertisement.is_banner_supported
```

{% endtab %}

{% tab title="GameMaker" %}

```javascript
playgama_bridge_advertisement_is_banner_supported()
```

{% endtab %}

{% tab title="Defold" %}

```lua
bridge.advertisement.is_banner_supported()
```

{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
bridge.advertisement.isBannerSupported
```

{% endtab %}

{% tab title="Scratch" %}

<figure><img src="/files/utzGJ5UtEbXRbqdSuVR4" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

#### Show Banner <a href="#show-banner" id="show-banner"></a>

Show a banner in a stable UI area where it will not overlap gameplay controls.

{% tabs %}
{% tab title="Plain JS" %}

```javascript
let position = 'bottom' // optional, 'top' | 'bottom', default = bottom
let placement = 'test_placement' // optional
bridge.advertisement.showBanner(position, placement)
```

{% endtab %}

{% tab title="Unity" %}

```csharp
private void Start()
{
    var position = BannerPosition.Bottom; // optional, 'Top' | 'Bottom', default = Bottom
    var placement = "test_placement"; // optional
    Bridge.advertisement.ShowBanner(position, placement);
}
```

{% endtab %}

{% tab title="Construct 3" %}
Parameters:

* Position `Top` | `Bottom`
* Placement (optional)

<figure><img src="/files/4YoxilCNQUZQA1ejM3pN" alt=""><figcaption></figcaption></figure>

<details>

<summary>Copy This Example</summary>

```
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"on-start-of-layout","objectClass":"System"}],"actions":[{"id":"show-banner","objectClass":"PlaygamaBridge","parameters":{"position":"bottom","placement":"\"test_placement\""}}]}]}
```

</details>
{% endtab %}

{% tab title="GDevelop" %}
Parameters:

* Position (`top` | `bottom`)
* Placement (optional)

<figure><img src="/files/Ga7fNlm5Lm7SRpigUiXw" alt=""><figcaption></figcaption></figure>

<details>

<summary>Copy This Example</summary>

```
{"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"DepartScene"},"parameters":[""]}],"actions":[{"type":{"value":"PlaygamaBridge::ShowBanner"},"parameters":["","\"bottom\"","\"test_placement\"",""]}]}],"eventsCount":1,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}
```

</details>
{% endtab %}

{% tab title="Godot" %}

```gdscript
var position = Bridge.BannerPosition.BOTTOM # optional, 'TOP' | 'BOTTOM', default = 'BOTTOM'
var placement = "test_placement" # optional
Bridge.advertisement.show_banner(position, placement)
```

{% endtab %}

{% tab title="GameMaker" %}

```javascript
var position = "bottom" // optional, "top" | "bottom", default = "bottom"
var placement = "test_placement" // optional
playgama_bridge_advertisement_show_banner(position, placement)
```

{% endtab %}

{% tab title="Defold" %}

```lua
local bridge = require("bridge.bridge")

function init(self)
	local position = "bottom" -- optional, "top" | "bottom", default = "bottom"
	local placement = "test_placement" -- optional
	bridge.advertisement.show_banner(position, placement)
end
```

{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
let position = 'bottom' // optional, 'top' | 'bottom', default = bottom
let placement = 'test_placement' // optional
bridge.advertisement.showBanner(position, placement)
```

{% endtab %}

{% tab title="Scratch" %}

<figure><img src="/files/5qP3XtvUyUelo2BRkXxo" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

#### Hide Banner <a href="#hide-banner" id="hide-banner"></a>

Hide the current banner before gameplay resumes or when the screen no longer has safe space for it.

{% tabs %}
{% tab title="Plain JS" %}

```javascript
bridge.advertisement.hideBanner()
```

{% endtab %}

{% tab title="Unity" %}

```csharp
Bridge.advertisement.HideBanner()
```

{% endtab %}

{% tab title="Construct 3" %}

<figure><img src="/files/SebRa1uwJkO56EDqsxUD" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="GDevelop" %}

<figure><img src="/files/9Y40JItJpCWSG9nauihY" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Godot" %}

```gdscript
Bridge.advertisement.hide_banner()
```

{% endtab %}

{% tab title="GameMaker" %}

```javascript
playgama_bridge_advertisement_hide_banner()
```

{% endtab %}

{% tab title="Defold" %}

```lua
bridge.advertisement.hide_banner()
```

{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
bridge.advertisement.hideBanner()
```

{% endtab %}

{% tab title="Scratch" %}

<figure><img src="/files/zwzOmRKl9WYmqYanZV8k" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

#### Banner State <a href="#banner-state" id="banner-state"></a>

Track banner state to adjust layout, avoid empty ad space, and debug failed loads.

{% tabs %}
{% tab title="Plain JS" %}

```javascript
bridge.advertisement.bannerState
```

```javascript
// Listen for banner state changes
bridge.advertisement.on(bridge.EVENT_NAME.BANNER_STATE_CHANGED, state => {
    console.log('Banner state: ', state)
})
```

Possible values: `loading`, `shown`, `hidden`, `failed`.
{% endtab %}

{% tab title="Unity" %}

```csharp
Bridge.advertisement.bannerState
```

Possible values: `Loading`, `Shown`, `Hidden`, `Failed`.

```csharp
// To track banner state changes, subscribe to the event
private void Start()
{
    Bridge.advertisement.bannerStateChanged += OnBannerStateChanged;
}

private void OnBannerStateChanged(BannerState state)
{
    Debug.Log(state);
}
```

{% endtab %}

{% tab title="Construct 3" %}

```java
PlaygamaBridge.BannerState
```

Current state of the banner. Possible values: `loading`, `shown`, `hidden`, `failed`.
{% endtab %}

{% tab title="GDevelop" %}

```javascript
PlaygamaBridge::BannerState()
```

Current state of the banner. Possible values: `loading`, `shown`, `hidden`, `failed`.
{% endtab %}

{% tab title="Godot" %}

```gdscript
Bridge.advertisement.banner_state
```

Returns the current state of the banner. Possible values: `loading`, `shown`, `hidden`, `failed`.

{% tabs %}
{% tab title="Godot 3.x" %}

<pre class="language-gdscript"><code class="lang-gdscript"><strong># To track banner state changes, connect to the signal
</strong>func _ready():
    Bridge.advertisement.connect("banner_state_changed", self, "_on_banner_state_changed")

func _on_banner_state_changed(state):
    print(state)
</code></pre>

{% endtab %}

{% tab title="Godot 4.x" %}

<pre class="language-gdscript"><code class="lang-gdscript"><strong># To track banner state changes, connect to the signal
</strong>func _ready():
    Bridge.advertisement.connect("banner_state_changed", Callable(self, "_on_banner_state_changed"))

func _on_banner_state_changed(state):
    print(state)
</code></pre>

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="GameMaker" %}

```javascript
playgama_bridge_advertisement_banner_state()
```

```javascript
// Listen for banner state changes

// via Async Social Event
if async_load[? "type"] == "playgama_bridge_advertisement_banner_state_changed" {
    switch async_load[? "data"] {
        case "loading":
            // your logic here
            break
        case "shown":
            // your logic here
            break
        case "hidden":
            // your logic here
            break
        case "failed":
            // your logic here
            break
    }
}
```

Possible values: `loading`, `shown`, `hidden`, `failed`.
{% endtab %}

{% tab title="Defold" %}

```lua
bridge.advertisement.banner_state()
```

```lua
local bridge = require("bridge.bridge")

function init(self)
	bridge.advertisement.on("banner_state_changed", function (_, state)
		print("Banner state changed: ", state)
	end)
end
```

Possible values: `loading`, `shown`, `hidden`, `failed`.
{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
bridge.advertisement.bannerState
```

```javascript
bridge.advertisement.on(EVENT_NAME.BANNER_STATE_CHANGED, this.onBannerStateChanged.bind(this));

onBannerStateChanged(state: BANNER_STATE) {
   console.log('Banner state: ', state)
}
```

Possible values: `loading`, `shown`, `hidden`, `failed`.
{% endtab %}

{% tab title="Scratch" %}

<figure><img src="/files/6XFfFyPA014qOYZBF76Y" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.playgama.com/playgama/sdk/api/advertisement/banner.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
