# Ad Spaces

An Ad Space is a Node that displays intrinsic advertisements to the player. They load images at runtime in both JPG or PNG formats.

# Creating Ad Spaces

Create an Ad Space by calling frameplay::ad_space::create and configure with the following parameters to best fit your game environment:

  1. Set the Ad Space name to a uniquely identifiable name
  2. Configure the image ratio to one of our preset advertisement aspect ratios
  3. Set the texture quality multiplier to your required texture quality.
  4. Set the refresh type to either dynamic or static (Dynamic ads will refresh a new ad every 60 seconds. Static will only request a single advertisement)
  5. Set the Ad Space size using the height or width property. (Ad Spaces will remain in their fixed aspect ratio to ensure the advertisement display remains valid)
  6. Set the Ad Space position using the x & y coordinates
  7. Add the child node to your scene graph
#include "frameplay.h"

const content_configuration content_config{

const ad_space_configuration ad_space_config{
  "Level-1 Ad Space",

const auto ad_space = frameplay::ad_space::create(ad_space_config, frameplay::height(100));
ad_space->setPosition(200, 100);

//Add child to the Scene Graph

You do not need to call ::init(); on the ad space.

# Ad Space Configuration

# Name

A unique description to identify this Ad Space (Eg. position or context in the current Scene). Unique names enables Frameplay to provide improved Ad Space level reporting.

# Content Configuration

The content configuration describes the content that the ad space will display. You can specify the ratio of the ad space, adjust the quality of the delivered content, and choose between static or dynamic ad content. For more details, see the guidelines.

# Ratio

Frameplay offers a variety of horizontal and vertical Ad Space ratios designed to fit in your game environments. There are 11 supported ratios: 3:2, 2:3, 4:3, 3:4, 16:9, 9:16, 21:9, 9:21, 40:9, 9:40, 60:9, and 1:1.

# Texture Quality Multiplier

The texture quality multiplier determines the advertisement texture size. Set to either quarter, half or original. This combines with the global texture quality setting to determines the maximum resolution of texture downloaded.

# Refresh Type

Ad Space refresh type can be either dynamic or static. Dynamic ads will refresh a new ad every 60 seconds. This allows for multiple impressions over time. The Static option will only request a single advertisement.

# Size

The frameplay::width or frameplay::height are used to configure the Ad Space size. Ad Spaces will remain in their fixed aspect ratio to ensure the advertisement display remains valid.

# Channel Name (optional)

Ad Spaces with the same Channel Name and Content Configuration will load Synchronized creative.

# Placeholder Materials

Ad Spaces will not always have an advertisement loaded. A Placeholder will be used instead. Default placeholder textures can be found in the resources folder ~Resources\Frameplay\Placeholders.

You can customize these Placeholders with your own textures to fit your environment.


# Load a Mock Advertisement

Build and run your Cocos2d-x application. When the Ad Space Node is spawned and visible it will request, download and display a mock advertisement.

For ads to load a session needs to be started, more on that HERE


Congratulations! You have created your first intrinsic advertisement.

# On Ad Loaded Event

on_texture_loaded is a multicast_delegate<void()> on each Ad Space that is fired once an advertisement has been loaded. Subscribe with on_texture_loaded.add(my_listener), where my_listener is an std::function<void()>

Last Updated: 9/16/2022, 1:51:02 AM