# Frameplay API

# Start a Frameplay Session

# Blueprint

Image

# C++

    /* Create FPlayer_Data Struct
  * @param _allowDataCollection - If player data is present
  * @param _age - If player data is present
  * @param _gender - If player data is present
  * @param _language - If player data is present (IETF Language Tag https://en.wikipedia.org/wiki/ISO_639-1))
  * @param _id - If player data is present
  */
    FPlayer_Data MakePlayerData(UData_Collection allowDataCollection, int32 age = -1,
              EFrameplayGender gender = EFrameplayGender::unknown,
              FString language = "", FString id = "");

 /* Start the Frameplay Session
  * @param _Player_Data - To be constructed using MakePlayerData()
  */
    UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject", DisplayName = "Start Session", Keywords = "Frameplay StartSession", BlueprintAutocast = ""), Category = "Frameplay")
  static void Start_Session(FPlayer_Data Player_Data);

# Register a Camera Manager

# Blueprint

Image

# C++

 /** Tracks camera world position & rotation for gathering Ad Space impression metrics.
 * Only one camera can be active at a time. *
 * If this function is not called, the default is to take the camera manager from Player 0 *
 * @Param _camera APlayerCameraManager
 */
    UFUNCTION(BlueprintCallable, meta = (DisplayName = "Set Frameplay Camera Reference", Keywords = "Set Frameplay Camera Reference", BlueprintAutocast = ""), Category = "Frameplay")
  static void set_camera(APlayerCameraManager* camera);

# Deregister a Camera Manager

Deregistering a Camera Manager will disable all background calculations of Ad Space impression metrics. This is intended to be used for optimization purposes during especially taxing and computationally expensive scenes. After disabling metric calculations, it is important not to forget to register the Camera Manager again.

# Blueprint

Image

# C++

 /** Deregisters the current camera, stops all Ad Space metric collection.
  */
 UFUNCTION(BlueprintCallable, meta = (DisplayName = "Remove Frameplay Camera Reference", Keywords = "Remove Disable Frameplay Camera Reference", BlueprintAutocast = ""), Category = "Frameplay")
  static void remove_camera();

# On Ad Loaded Event

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

# C++

DECLARE_MULTICAST_DELEGATE(FOnTextureLoadedDelegate);

FOnTextureLoadedDelegate OnTextureLoaded{};
Last Updated: 1/18/2023, 5:04:52 AM