# Frameplay API

# Unreal Scripts

# Start a Frameplay Session

# Blueprint


Image

# C++

	/* Start the Frameplay Session
	 * @param _worldContextObject - World Context Object to derive world
	 * @param _pDataAsset - Reference to the Frameplay Data Asset
	 * @param _playerAge - If player data is present
	 * @param _playerSex - If player data is present
	 * @param _playerId - If player data is present
	 * @param _playerLanguage - If player data is present (ISO_639-1 https://en.wikipedia.org/wiki/ISO_639-1)
	 */
	UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject", DisplayName = "Start Session", Keywords = "Frameplay StartSession", BlueprintAutocast = ""), Category = "Frameplay")
		static void StartSession(const UObject* WorldContextObject, UFrameplayDataAsset *_dataAsset, int _playerAge = -1, FPlayerSex _playerSex = FPlayerSex::Unknown, FString _playerId = "", FString _playerLanguage = "");

# Register a Camera Manager

# Blueprint


Image

# C++

	/** Tracks camera world position & rotation for gathering Tile impression metrics.
	*	Only one camera can be active at a time.	*
	*	@Param _aPlayerCameraManager APlayerCameraManager
	*/
	UFUNCTION(BlueprintCallable, meta = (DisplayName = "Register Camera Manager", Keywords = "Frameplay Register Camera Manager", BlueprintAutocast = ""), Category = "Frameplay")
		static void RegisterCameraManager(APlayerCameraManager * _aPlayerCameraManager, float _nearClipDistance = 0.0f);


# Register a Camera Component

# Blueprint


Image

# C++

	/** Tracks camera world position & rotation for gathering Ad Space impression metrics.
	 *	Only one camera can be active at a time.	 *
	 *	@Param _UCameraComponent The camera component
	 */
	UFUNCTION(BlueprintCallable, meta = (DisplayName = "Register Camera Component", Keywords = "Frameplay Register Camera Component", BlueprintAutocast = ""), Category = "Frameplay")
		static void RegisterCameraComponent(UCameraComponent *_uCameraComponent, float _nearClipDistance = 0.0f);

# Unregister a Camera

# Blueprint


Image

# C++

	/** Unregisters the current camera, stops all Ad Space metric collection.
	 *	Only one camera can be active at a time.
	 */
	UFUNCTION(BlueprintCallable, meta = (DisplayName = "Unregister Camera", Keywords = "Frameplay Deregister Camera", BlueprintAutocast = ""), Category = "Frameplay")
		static void UnregisterCamera();

# Is a Camera Registered?

# Blueprint


Image

# C++

	/** Is a camera currently registered?
	* @return True is a camera has been registered successfully
	*/
	UFUNCTION(BlueprintCallable, meta = (DisplayName = "Is Camera Registered", Keywords = "Frameplay Is Camera Registered", BlueprintAutocast = ""), Category = "Frameplay")
		static bool IsCameraRegistered();

# Has the Session Started?

# Blueprint


Image

# C++

	/** Has the Frameplay Session successfully started.
	* @return True if the session has started successfully
	*/
	UFUNCTION(BlueprintCallable, meta = (DisplayName = "Has Session Started", Keywords = "Frameplay Has Session Started", BlueprintAutocast = ""), Category = "Frameplay")
		static bool HasSessionStarted();

# FrameplayAdSpace

	/** Unique identifier generated when the Ad Space is registered. Field is shown on the Developer Dashboard */
	UPROPERTY(TextExportTransient, NonTransactional, NoClear, VisibleAnywhere, Category = "Frameplay")
		FString AdSpaceId = UFrameplayStaticLibrary::AdSpaceIdDefault;

	/** Used to identify the Ad Space. Field is shown on the Developer Dashboard */
	UPROPERTY(TextExportTransient, NoClear, VisibleAnywhere, Category = "Frameplay")
		FString Description = "New Unregistered AdSpace";

	/** Advertisements of this ratio will be displayed on this Ad Space. When scaling the Ad Space in Editor, this ratio will be enforced. Field is shown on the Developer Dashboard */
	UPROPERTY(NoClear, EditAnywhere, BlueprintReadWrite, Category = "Frameplay")
		ESurfaceRatio Ratio;

	/** A Dynamic Ad Space will refresh with a new advertisement every 60 seconds. A Static Ad Space will hold the first advertisement they load for the duration of the Frameplay Session or until destroyed. Field is shown on the Developer Dashboard.*/
	UPROPERTY(NoClear, EditAnywhere, BlueprintReadWrite, Category = "Frameplay")
		EContentRefeshType ContentRefreshType = EContentRefeshType::Dynamic;

	/** Single instance types are used if there will only ever be one instance of this Ad Space. Multi is used if the Ad Space will have multiple instances eg. part of a procedurally generated level. Field is shown on the Developer Dashboard*/
	UPROPERTY(NoClear, EditAnywhere, BlueprintReadWrite, Category = "Frameplay")
		EActorInstanceType ActorInstanceType = EActorInstanceType::SingleInstance;

	/*Optional activation trigger*/
	UPROPERTY(TextExportTransient, EditAnywhere, DisplayName = "Activation Trigger", Category = "Frameplay")
		ATriggerBase* m_pATrigger;

	/** If no advertisement is currently displayed and if unchecked the Ad Space will be invisible. If checked however, the Ad Space will be visible and will display the PlaceHolderMaterial */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Frameplay")
		bool PlaceholderVisibleDuringPlay = true;

	/** The material used when there is no advertisement currently displayed. Can be changed to a material more fitting of your environment */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Frameplay")
		UMaterial* PlaceholderMaterial;

	//** The material used when displaying an advertisement. Texture is overriden to display advertisements */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Frameplay")
		UDefaultAdMaterial* AdMaterial;
Last Updated: 6/3/2020, 10:04:03 AM