跳到主要内容

Getting Started

1. Preparation

  • Integrate PGOS SDK at first

  • Copy the plugin folders PGOSOverlay and INTLSDKPlugin into the directory Plugins of your game project.

  • Regenerate the game project files with Generate Visual Studio project files in the context menu of the .uproject file

  • Add the modules PgosWeaver and PgosWeaverINTL as dependencies into {YourGameProjectName}.Build.cs

    PrivateDependencyModuleNames.AddRange(new [] { "PgosWeaver", "PgosWeaverINTL" });

1.1 Configure the Account Provider

Currently, we support INTL account. You may need to register a developer account if you don't have one. Check the following links for more details:

1.2 Configure INTL SDK

  • Follow the configuration guide of INTL SDK to modify the INTL config file with your developer account (Plugins\INTLSDKPlugin\Source\INTLSDKPlugin\INTLSDK\resources\INTLConfig.ini)

  • Also, we provide a more convenient way to configurate the SDK via the UE4 Editor. In the Editor, navigate to Settings->Project Settings->Plugins->PgosWeaver, and you can see the settings as below:

    image-20211111195208585

    • Add any Key-Value pairs to Variables under INTL Settings section. The plugin will automatically overwrite those configurations inINTLConfig.ini when the game is launched.

2. Initialization

Before starting logging in, title_region_id is required to set with SetOverlayConfig.

  1. Copy title_region_id from PGOS Web Portal title_region_id

  2. Call SetOverlayConfig before logging in

    with Blueprint

    set_overlay_config_bp

    with C++

    UPgosBlueprintFunctionLibrary::SetOverlayConfig(EPgosOverlayConfigKey::TitleRegionId, TEXT("your_title_region_id_here"));

3. Logging in

Note: Refer to this page for further information.

4. Visibility Control

You can change the visibility of PGOS Overlay through SetOverlayVisibility():

show_hide

It's also available in C++:

// set Overlay visibility
UPgosBlueprintFunctionLibrary::SetOverlayVisibility(bVisible);

// get Overlay visibility
bool bVisible = UPgosBlueprintFunctionLibrary::GetOverlayVisibility();

4.1 Callback for Visibility Change

If you want to get notified once the visibility of Overlay is changed, you can register a callback:

callback

UPgosWidgetManager* WidgetManager = UPgosBlueprintFunctionLibrary::GetOverlayWidgetManager();
WidgetManager->OnOverlayVisibilityChanged.AddUObject(...);